From george.korony at avx.com Wed Dec 24 21:05:37 2014 From: george.korony at avx.com (George Korony) Date: Wed, 24 Dec 2014 15:05:37 -0500 Subject: [Tkinter-discuss] msvcrt - Button problem Message-ID: I am running Python on Windows. (Do not ask why....I have to!) In the following code I do register the keyboard hit for the first run of the program. But if I wait and then restart the run with the button command the hit does not register. Of course the program has to be run "directly" - not using the GUI. Is there a solution for my problem? Thanks, George ?from Tkinter import * from time import sleep import msvcrt class Test(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.parent = master self.grid() self.button= Button(self, text="start", relief="raised",bd=5, padx=10, command=self.doLoop) self.button.grid() self.doLoop() def doLoop(self): n=5 while n>0: print "n: ",n sleep(1) print "hit: ",msvcrt.kbhit() n-=1 root=Tk() app=Test(root) root.mainloop() ? -- George Korony AVX Corporation 801 17th Ave S. Myrtle Beach, SC 29578 Phone: 843-444-2859 Fax: 843-444-2809 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Vasilis.Vlachoudis at cern.ch Sun Dec 28 16:45:20 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Sun, 28 Dec 2014 15:45:20 +0000 Subject: [Tkinter-discuss] Event debugger Message-ID: <0BC70B5D93E054469872FFD0FE07220E011ABCE26E@CERNXCHG54.cern.ch> Hi all, in my application I have a lost event in a multi listbox to activate . The program is quite long about 100000 lines of code and I cannot find where the event is lost. My su -------------- next part -------------- An HTML attachment was scrubbed... URL: From Vasilis.Vlachoudis at cern.ch Sun Dec 28 16:48:39 2014 From: Vasilis.Vlachoudis at cern.ch (Vasilis Vlachoudis) Date: Sun, 28 Dec 2014 15:48:39 +0000 Subject: [Tkinter-discuss] Event debugger In-Reply-To: <0BC70B5D93E054469872FFD0FE07220E011ABCE26E@CERNXCHG54.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220E011ABCE26E@CERNXCHG54.cern.ch> Message-ID: <0BC70B5D93E054469872FFD0FE07220E011ABCE2CC@CERNXCHG54.cern.ch> Hi all, in my application I have a lost event in a multi listbox. The program is quite long about 100000 lines of code and I cannot find where the event is lost. My suspicion is that I lose the Focus in the middle of the double event. When I use or everything works, but not with the . So my questions is, does it exist any event debugger so I can monitor the events on a specific widget to find out what happens in between the two clicks? Thanks in advance Vasilis -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.odonnell at uam.es Sun Dec 28 22:40:28 2014 From: michael.odonnell at uam.es (Michael O'Donnell) Date: Sun, 28 Dec 2014 22:40:28 +0100 Subject: [Tkinter-discuss] Event debugger In-Reply-To: <0BC70B5D93E054469872FFD0FE07220E011ABCE2CC@CERNXCHG54.cern.ch> References: <0BC70B5D93E054469872FFD0FE07220E011ABCE26E@CERNXCHG54.cern.ch> <0BC70B5D93E054469872FFD0FE07220E011ABCE2CC@CERNXCHG54.cern.ch> Message-ID: Hi Vasilis, Sorry I can't answer your specific question about event debuggers for tkinter. However, general advice: try and make a simplified version of the problem which you can send the list. Usually, in the making of it, you solve the problem. Also, are you aware that if you bind AND either of or , ALL of them will be called when a double-click occurs. If you have a button-1 event binding, does it do anything which will de-focus the widget so that the second click is no longer in the same space? (e.g., closing the lsitbox, etc.) Mick On 28 December 2014 at 16:48, Vasilis Vlachoudis wrote: > Hi all, > > in my application I have a lost event in a multi listbox. > The program is quite long about 100000 lines of code and > I cannot find where the event is lost. > My suspicion is that I lose the Focus in the middle of the double event. > When I use or everything works, but > not with the . > > So my questions is, does it exist any event debugger so I can monitor > the events on a specific widget to find out what happens in between the > two clicks? > > Thanks in advance > Vasilis > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inq1ltd at inqvista.com Mon Dec 29 19:49:00 2014 From: inq1ltd at inqvista.com (inq1ltd) Date: Mon, 29 Dec 2014 13:49 -0500 Subject: [Tkinter-discuss] Event debugger Message-ID: <3177845.t0MadjfpSx@mach-123> Vasilis, If I understand your problem correctly, I may try this. I expect that your code is in a class. class Kdata: vkey = '' # add this under you class # definition # add lines of code # # more lines of code # make your binder but before the binder add KdataSB.vkey = like this; KdataSB.vkey = something.bind('', self.Fclose) # # many more lines of code # # somewhere in this code write import module file from module file import KdataSB # write print KdataSB.vkey, 'line xxx\n' whenever I run my program, the above print statement sends to output, this number, 30555847260 # you will get something else you should be able to write this print statement where ever you think the binder should exist. You should get the same number in each place jimonlinux for inqvista.com From azane at nnu.edu Tue Dec 30 09:01:17 2014 From: azane at nnu.edu (Andrew Zane) Date: Tue, 30 Dec 2014 00:01:17 -0800 Subject: [Tkinter-discuss] Re: making tkFileDialog and tkMessageBox modal on Win32 Message-ID: I had to add a little bit to make the dialog modal to the parent. So anyway, here?s to helping! : ) My comments are prefaced with an #A:, and my modifications are surrounded by the #A tag, #A - #/A, that is. def tk_wrapgrab(tk, f, kw): #retrieved from: http://grokbase.com/t/python/tkinter-discuss/05468hr5qs/making-tkfiledialog-and-tkmessagebox-modal-on-win32 # Wrap a dialog in a grab pair. # Use to make tkFileDialog and tkMessageBox application-modal. # Not needed for tkSimpleDialog. # tk - grab target, this is what will wait for the tkDialog to close # f - tkFileDialog.askopenfilename, tkMessageBox.showinfo, etc. # kw - dictionary of key-word arguments to f kw['parent'] = tk #A: No need to specify parent then. Grab target here is synonomous to parent. tk.grab_set() #A: Grab parent, making parent the only active window (of application) while tkDialog is open. retval = f(**kw) #A tk.wait_variable(retval) #A: Parent wait for the variable, disabling parent until tkDialog returns. Thus, tkDialogs are application-modal. # If we did a global grab, the tkDialog would be globally-modal. #/A tk.grab_release() return retval