uses packed row frames lab pack(side=leftand fixed-width labels ent pack(side=leftexpand=yesfill=xor use grid(rowcolif browsebtn button(rowtext='browse 'btn pack(side=rightif not extendbtn config(commandlambdavar set(askopenfilename(or var get()elsebtn config(commandlambdavar set(var get(askopenfilename()return var nextexample - ' runpackdialog function is the actual callback handler invoked when tool names are selected in the main shellgui window it uses the form row builder module of example - and applies the custom modal dialog techniques we studied earlier example - pp \gui\shellgui\packdlg py popup gui dialog for packer script argumentsand run it from glob import glob from tkinter import from packer import pack from formrows import makeformrow filename expansion gui widget stuff use pack script/module use form builder tool def packdialog() new top-level window win toplevel(with row frames ok button win title('enter pack parameters'var makeformrow(winlabel='output file'var makeformrow(winlabel='files to pack'extend=truebutton(wintext='ok'command=win destroypack(win grab_set(win focus_set(go modalmouse grabkeyboard focuswait win wait_window(wait till destroyelse returns now return var get()var get(fetch linked var values def runpackdialog()outputpatterns packdialog(if output !"and patterns !""patterns patterns split(filenames [for sublist in map(globpatterns)filenames +sublist print('packer:'outputfilenamespack(ofile=outputifiles=filenamespop-up gui dialog till ok or wm-destroy do non-gui part now do expansion manually unix shells do this auto should show msgs in gui too if __name__ ='__main__'root tk(button(roottext='popup'command=runpackdialogpack(fill=xbutton(roottext='bye'command=root quitpack(fill=xroot mainloop( gui coding techniques