From pollastri at iriti.cnr.it Thu Jul 5 17:29:02 2007 From: pollastri at iriti.cnr.it (Fabrizio Pollastri) Date: Thu, 05 Jul 2007 17:29:02 +0200 Subject: [Tkinter-discuss] Temporary disabling TCL execution Message-ID: <468D0E3E.7090500@iriti.cnr.it> Hello, I am trying to disable temporary TCL execution during the instantiation of Tkinter classes. The scope is to build the Tkinter python structure of a Tk widget tree already generated by direct TCL commands. I tried a "monkey patch" on the call method of tkapp as follow from Tkinter import * def dummy_tk_call(*args): return root = Tk() original_call = root.tk.call root.tk.call = dummy_tk_call # disable TCL execution # put here code needing no TCL execution root.tk.call = original_call # enable TCL execution ... The problem is that root.tk.call is a read only attribute. Any solution is welcome. Cheers, F. Pollastri. From gonatan at gmx.de Fri Jul 6 12:56:52 2007 From: gonatan at gmx.de (=?ISO-8859-15?Q?Marcus_Gna=DF?=) Date: Fri, 06 Jul 2007 12:56:52 +0200 Subject: [Tkinter-discuss] how to maximize a window (beginner question!) Message-ID: <468E1FF4.6070709@gmx.de> I like to know how I can maximize a window at program start. I haven't found any hint so far. Hope you can help me ... Marcus From Cameron at phaseit.net Fri Jul 6 16:17:45 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Fri, 6 Jul 2007 14:17:45 +0000 Subject: [Tkinter-discuss] how to maximize a window (beginner question!) In-Reply-To: <468E1FF4.6070709@gmx.de> References: <468E1FF4.6070709@gmx.de> Message-ID: <20070706141745.GA13441@lairds.us> On Fri, Jul 06, 2007 at 12:56:52PM +0200, Marcus Gna? wrote: . . . > I like to know how I can maximize a window at program start. > I haven't found any hint so far. Hope you can help me ... . . . Apparently no one has yet updated and transcribed for Tkinter. That would make a nice tiny task for someone ... Is the maximization on that page the sort you had in mind? From surya.garg at sevasys.com Mon Jul 9 18:51:59 2007 From: surya.garg at sevasys.com (Surya Prakash Garg) Date: Mon, 09 Jul 2007 22:21:59 +0530 Subject: [Tkinter-discuss] Opening one frame after closing another Message-ID: <469267AF.1060803@sevasys.com> Hello, I am a newbie in the field of python. I want to create a wizard using python language. in which i am creating some buttons to open another frame and closing the parent frame. Right now i am facing problems in passing arguments from one frame to another frame. for example to dispose current frame i use frame1.destroy but am not able to navigate. Here is the code......... import os, sys from Tkinter import * from ImageTk import PhotoImage # <== use PIL replacement class # rest of code unchanged imgdir = 'images' imgfile = 'sevasys1.jpg' icon= 'sevasys2.ico' imgpath = os.path.join(imgdir, imgfile) icopath = os.path.join(imgdir, icon) x0=0 y0=0 xoff=200 yoff=80 xhor=600 yver=450 class Application(Frame): def __init__(self, master,my): """ Initialize the frame. """ my=Frame.__init__(self, master) my.pack() my.create_frame1() def create_frame1(self): frame1=Frame(self) frame1.pack() frame1.imgobj = PhotoImage(file=imgpath) # now JPEGs work! c = Canvas(frame1, width=xhor, bg='white', height=yver-70) c.grid(row=0,column=0) c.create_line(x0, yver-70, xhor, yver-70) c.create_line(x0, yver-72, xhor, yver-72) c.create_image(x0,y0,image=frame1.imgobj,anchor=NW) c.create_text(x0+350,y0+50,text='Welcome to SSM 0.0.001 Wizard', fill='Black', font=('verdana', 15), anchor=N) c.create_text(x0+350,y0+100,text='The Support Wizard will help you in troubleshooting \nnetwork related problems. Click Next to \ncontinue or Cancel to exit Support Wizard', fill='Black', font=('verdana', 10), anchor=N) bttn_cancel = Button(text='Cancel', command=sys.exit, underline=0) bttn_cancel.config(font=('verdana', 12)) bttn_cancel.pack(side=RIGHT, anchor=E,padx=18) bttn_next = Button(text='Next', command=self.create_frame2, underline=0) bttn_next.config(font=('verdana', 12)) bttn_next.pack(side=RIGHT, ipadx=10,anchor=E) bttn_back = Button(text='Back', underline=0) bttn_back.config(font=('verdana', 12),state=DISABLED) bttn_back.pack(side=RIGHT, ipadx=10,anchor=E) frame1.destroy() def create_frame2(self): self.frame1.destroy() ## self.destroy() frame2=Frame(self) frame2.pack() frame2.imgobj = PhotoImage(file=imgpath) # now JPEGs work! c = Canvas(frame2, width=xhor, bg='white', height=yver-70) c.grid(row=0,column=0) c.create_line(x0, yver-70, xhor, yver-70) c.create_line(x0, yver-72, xhor, yver-72) c.create_image(x0,y0,image=frame2.imgobj,anchor=NW) c.create_text(x0+350,y0+50,text='Welcome to SSM 0.0.001 Wizard', fill='Black', font=('verdana', 15), anchor=N) c.create_text(x0+350,y0+100,text='The Support Wizard will help you in troubleshooting \nnetwork related problems. Click Next to \ncontinue or Cancel to exit Support Wizard', fill='Black', font=('verdana', 10), anchor=N) frame2.bttn_cancel = Button(text='Cancel', command=sys.exit, underline=0) frame2.bttn_cancel.config(font=('verdana', 12)) frame2.bttn_cancel.pack(side=RIGHT, anchor=E,padx=18) frame2.bttn_next = Button(text='Next1', underline=0) frame2.bttn_next.config(font=('verdana', 12)) frame2.bttn_next.pack(side=RIGHT, ipadx=10,anchor=E) frame2.bttn_back = Button(text='Back', underline=0) frame2.bttn_back.config(font=('verdana', 12),state=DISABLED) frame2.bttn_back.pack(side=RIGHT, ipadx=10,anchor=E) ## app2.__init__(self) ## app2.create_widget(self) ##class Application2(Application): ## def __init__(self): ## """ Initialize the frame. """ ## Frame.__init__(self) ## self.pack() ## self.create_widget() ## def create_widget(self): ## self1.imgobj = PhotoImage(file=imgpath) # now JPEGs work! ## c = Canvas(self, width=xhor, bg='white', height=yver-70) ## c.grid(row=0,column=0) ## c.create_line(x0, yver-70, xhor, yver-70) ## c.create_line(x0, yver-72, xhor, yver-72) ## c.create_image(x0,y0,image=self.imgobj,anchor=NW) ## c.create_text(x0+350,y0+50,text='Welcome to SSM 0.0.001 Wizard', fill='Black', font=('verdana', 15), anchor=N) ## c.create_text(x0+350,y0+100,text='The Support Wizard will help you in troubleshooting \nnetwork related problems. Click Next to \ncontinue or Cancel to exit Support Wizard', fill='Black', font=('verdana', 10), anchor=N) ## bttn_cancel = Button(text='Cancel', command=sys.exit) ## bttn_cancel.config(font=('verdana', 12)) ## bttn_cancel.pack(side=RIGHT, anchor=E,padx=18) ## bttn_next = Button(text='Next') ## bttn_next.config(font=('verdana', 12)) ## bttn_next.pack(side=RIGHT, ipadx=10,anchor=E) ## bttn_back = Button(text='Back') ## bttn_back.config(font=('verdana', 12),state=DISABLED) ## bttn_back.pack(side=RIGHT, ipadx=10,anchor=E) ##class Application2(Canvas): ## ## def __init__(self, master): ## """ Initialize the frame. """ ## Canvas.__init__(self, master) ## self.create_w() ## ## def create_w(self): ## y=self.create_text(11,22,text="Welcome to the SevaSys support") ## x=self.create_line(0,150, 50,100, 0,50, 50,0,smooth=1) root = Tk() root.title("SevaSys Support Module v 0.0.001") root.geometry(str(xhor)+"x"+str(yver)+"+"+str(xoff)+"+"+str(yoff)) root.resizable(0,0) root.iconbitmap('sevasys2.ico') app = Application(root) ##app2 = Application2(root) root.mainloop() any help will be appreciated thanks and regards Surya Prakash Garg -- This message has been scanned for viruses and dangerous content by SevaSecure Mail Service, and is believed to be clean. From rowen at cesmail.net Mon Jul 9 21:44:25 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Mon, 09 Jul 2007 12:44:25 -0700 Subject: [Tkinter-discuss] Opening one frame after closing another References: <469267AF.1060803@sevasys.com> Message-ID: In article <469267AF.1060803 at sevasys.com>, Surya Prakash Garg wrote: > Hello, > > I am a newbie in the field of python. I want to create a wizard using > python language. in which i am creating some buttons to open another > frame and closing the parent frame. Right now i am facing problems in > passing arguments from one frame to another frame. for example to > dispose current frame i use frame1.destroy but am not able to navigate. > Here is the code......... Here's a few thoughts: - Instead of thinking in terms of "passing data from one frame to another" I suggest you keep the data in an object (the "model"). The different frames then can read and write the data in the model as necessary. This split (between GUI elements and model) allows you to tweak the GUI more easily. To share that model data, create an instance of the data model object as an attribute of your Application class. Then all methods of the class can easily get to the data model. - At the moment it looks as if create_frame1 creates and packs a frame and then destroys it. I suspect you want create_frame1 to only create and pack it. Then have callback functions from the various buttons do the "navigation" by hiding the current frame and showing the next desired frame. - The frames might be wanted again (if the user backs up in the process) so instead of destroying each frame when done I suggest you hang onto them and just pack_forget/pack (or better yet, grid_remove/grid) as appropriate. -- Russell From vvinuv at gmail.com Wed Jul 11 16:32:27 2007 From: vvinuv at gmail.com (Vinu Vikram) Date: Wed, 11 Jul 2007 20:02:27 +0530 Subject: [Tkinter-discuss] install tkinter separately Message-ID: <637563b70707110732p387e0315w9050c5a2b76641d1@mail.gmail.com> Hi All I am working in machine which has python 2.3.4. The machine is a cluster and maintains by other people. One of my program use tkinter it is not available in the machine. Does anybody know how to install tkinter module separately in my user account? Thanking You Vinu V -- VINU VIKRAM http://iucaa.ernet.in/~vvinuv/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070711/c7844626/attachment.htm From Jeffrey.L.Hensley at erdc.usace.army.mil Fri Jul 13 16:27:20 2007 From: Jeffrey.L.Hensley at erdc.usace.army.mil (Hensley, Jeffrey L ERDC-ITL-MS Contractor) Date: Fri, 13 Jul 2007 09:27:20 -0500 Subject: [Tkinter-discuss] Dialog and mainloop (UNCLASSIFIED) Message-ID: Classification: UNCLASSIFIED Caveats: NONE I have an application in the works but seem to have a basic misunderstanding of the implementation of standard dialog windows. When the user presses a button to commit an action, I wish to pop up a dialog with a "Are you sure?" query. I'm trying to use the basic askyesno. If the user chooses to continue, we go on our merry way and processing occurs (potentially very time consuming). HOWEVER, even though the user has pressed "yes" or "no", the dialog window itself does not disappear until I fall out of the function and, I believe, the process has returned to the mainloop. The behavior I have now is, well, unacceptable. The underlying processing may take some time, there are messages being written to a status window, etc; and the user is stuck looking at the dialog not aware of what is going on. Am I missing something? [well, of course I am!] Suggestions/comments? ************************************************************** Jeff Hensley, Ph.D. Phone: 601-634-4596 EQM On-site lead, ERDC PET Fax: 601-634-2324 3909 Halls Ferry Road Jeffrey.L.Hensley at erdc.usace.army.mil Vicksburg, MS 39180-6199 http://www.erdc.hpc.mil ************************************************************** Classification: UNCLASSIFIED Caveats: NONE From gerardo at computo-industrial.com.mx Sun Jul 15 21:41:49 2007 From: gerardo at computo-industrial.com.mx (Gerardo Juarez) Date: Sun, 15 Jul 2007 15:41:49 -0400 (EDT) Subject: [Tkinter-discuss] Dialog and mainloop (UNCLASSIFIED) In-Reply-To: Message-ID: Use a Toplevel window, display your dialog there and add a button whose command is "withdraw". Like this: def winmsg(s): w = Toplevel() Label(w, text=s, relief='groove').pack(padx=10, pady=5) Button(w, text='Ok', command=w.withdraw).pack(pady=5) Every time I call winmsg() with a message I wish to display, the popup dialog appears. When the user reads the message and presses the button, the popup is immediately gone. I think this is what you want. Note that this simple dialog is not modal, but that's a problem you may run into further down the line, certainly not now. Gerardo On Fri, 13 Jul 2007, Hensley, Jeffrey L ERDC-ITL-MS Contractor wrote: > Classification: UNCLASSIFIED > Caveats: NONE > > I have an application in the works but seem to have a basic misunderstanding > of the implementation of standard dialog windows. > > When the user presses a button to commit an action, I wish to pop up a dialog > with a "Are you sure?" query. I'm trying to use the basic askyesno. If the > user chooses to continue, we go on our merry way and processing occurs > (potentially very time consuming). > > HOWEVER, even though the user has pressed "yes" or "no", the dialog window > itself does not disappear until I fall out of the function and, I believe, > the process has returned to the mainloop. > > The behavior I have now is, well, unacceptable. The underlying processing may > take some time, there are messages being written to a status window, etc; and > the user is stuck looking at the dialog not aware of what is going on. > > Am I missing something? [well, of course I am!] > > Suggestions/comments? > > ************************************************************** > Jeff Hensley, Ph.D. Phone: 601-634-4596 > EQM On-site lead, ERDC PET Fax: 601-634-2324 > 3909 Halls Ferry Road Jeffrey.L.Hensley at erdc.usace.army.mil > Vicksburg, MS 39180-6199 http://www.erdc.hpc.mil > ************************************************************** > > Classification: UNCLASSIFIED > Caveats: NONE > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > From rowen at cesmail.net Tue Jul 17 19:36:12 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Tue, 17 Jul 2007 10:36:12 -0700 Subject: [Tkinter-discuss] Workaround for submenus not displaying in 8.4.15 Message-ID: Under Tcl/Tk 8.4.15 (at least on MacOS X) submenus of menubutton menus don't display (submenus do work fine from the menu bar). This is tk bug 1731734. Anyway, this is causing grief for my application and I was wondering if anyone had found a workaround (other than reverting to an older Tcl/Tk, which I really don't want to do -- this is the first universal binary of Tcl/Tk that reliably keeps track of mouse position; in fact it's the *only* version of Aqua Tcl/Tk other than 8.4.11 that does this). I suppose I could rewrite my application to never use menubuttons with submenus, but I was hoping to not have to change the existing user interface. -- Russell From rowen at cesmail.net Thu Jul 26 00:57:51 2007 From: rowen at cesmail.net (Russell E. Owen) Date: Wed, 25 Jul 2007 15:57:51 -0700 Subject: [Tkinter-discuss] Workaround for submenus not displaying in 8.4.15 References: Message-ID: In article , "Russell E. Owen" wrote: > Under Tcl/Tk 8.4.15 (at least on MacOS X) submenus of menubutton menus > don't display (submenus do work fine from the menu bar). This is tk bug > 1731734. > > Anyway, this is causing grief for my application and I was wondering if > anyone had found a workaround... The recent AciveState Tcl/Tk 8.4.15 contains a fix for this bug. So an easy answer is use that. Thanks again to Daniel A. Steffen for his many great improvements to Aqua Tcl/Tk. -- Russell From dmitry-gerasimov at yandex.ru Thu Jul 26 12:41:36 2007 From: dmitry-gerasimov at yandex.ru (Dmitry Gerasimov) Date: Thu, 26 Jul 2007 15:41:36 +0500 Subject: [Tkinter-discuss] Per-state option sintax in TkTreectrl Message-ID: Hello! I'm trying to release example from tktreectrl named biglist.tcl using wraper TkTreectrl. There are some lines in tcl source like $T style layout $S eRectTop.e -detach yes -indent no -iexpand xy -draw {yes open no {}} containing per-state values like "{yes open no {}}" for options. How them can be specified for wraper? Writing something like tree.style_layout("styItem","eRectTop", detach="yes", indent="no" , iexpand="xy", draw = "{yes open no {}}") gives unhandled TclError "expected boolean value but got "yes open no {} " on the run. From klappnase at web.de Mon Jul 30 20:25:43 2007 From: klappnase at web.de (Michael Lange) Date: Mon, 30 Jul 2007 20:25:43 +0200 Subject: [Tkinter-discuss] Per-state option sintax in TkTreectrl In-Reply-To: References: Message-ID: <20070730202543.1e06c07b.klappnase@web.de> On Thu, 26 Jul 2007 15:41:36 +0500 Dmitry Gerasimov wrote: > Hello! > I'm trying to release example from tktreectrl named biglist.tcl using > wraper TkTreectrl. There are some lines in tcl source like > > $T style layout $S eRectTop.e -detach yes -indent no -iexpand xy -draw > {yes open no {}} > > containing per-state values like "{yes open no {}}" for options. How > them can be specified for wraper? Writing something like > > tree.style_layout("styItem","eRectTop", detach="yes", indent="no" , > iexpand="xy", draw = "{yes open no {}}") > > gives > > unhandled TclError > "expected boolean value but got "yes open no {} " > > on the run. Hi Dmitry, I think you should use a tuple, like tree.style_layout(draw = ("yes", "open", "no", "")) I hope this helps Michael