[Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-09-25 Thread mkieverpy
Dear list, I built a GUI using tkinter and tix (python 3.1/linux) and have a frame which wants to receive key events in a certain "mode". I do this when initializing the frame: class WBuildMenu(Frame, View): ... self._keyID = self.bind('', self._onKey, add=True) and later when entering the

Re: [Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-09-26 Thread mkieverpy
Hello Michael, Me: What I really get is this: I only get FocusOut when the mouse leaves the application window. I do not get FocusOut event when I click some other part of the application window which nonetheless results in the frame losing focus and no longer receiving key events. Currently, m

Re: [Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-10-07 Thread mkieverpy
Hello Michael, I'm back and tested a bit more. I updated to standard packages (debian wheezy) python 3.2 tcl/tk 8.5 tix 8.4.3 to avoid any problems with who is using who. I then expanded your test program to emulate my configuration and what I want to implement. There I noticed that it's not a ti

Re: [Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-10-08 Thread mkieverpy
Hello Michael, I found a workaround: import tkinter root = tkinter.Tk() f = tkinter.Frame(root) f.pack(fill='both', expand=1) tkinter.Button(f, text='foo').pack() f2 = tkinter.Frame(root) f2.pack(fill='both') tkinter.Button(f2, text='bar').pack(

Re: [Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-10-11 Thread mkieverpy
Hi, On Wed, 10 Oct 2012 11:37:35 +0200, Michael Lange wrote: (...) The problem is when I use the 'Tab' key to move the focus. The first 'Tab' moves the focus to the 'foo' button. 'f' no longer gets key events but does not get the focus out event either. The next 'Tab' moves the focus to the 'b

Re: [Tkinter-discuss] FocusOut not working as expected - tix broken?

2012-10-16 Thread mkieverpy
Hello, thanks for the new hints/information Michael and Bryan. I don't know if your hints would work in my setup, though. Except bind_all, which should work, I guess. My program structure: I have a Frame, which is nearly the complete toplevel window (only a title label and quit button outside; t

Re: [Tkinter-discuss] tkinter extensions

2013-06-13 Thread mkieverpy
> Tix ( > http://www.python.org/doc/current/lib/module-Tix.html) I am a tix user and I found the Demo in the python distribution very helpful (in the path 'Demo/tix/'). As far as I can remember it contains examples for nearly every tix widget. Regards, Matth

Re: [Tkinter-discuss] Button Press Freezes

2013-06-13 Thread mkieverpy
Quaki Gaffar: >Here's my situation. I have two tkinter buttons: > >Play Button: plays a sound >Stop Button: to stop the sound during play > >Code is as follows: > >def Play(self): >//plays a file with pygame module > >def Stop(self): >//Stop using pygame stop Greg Ewing: >No, mus

Re: [Tkinter-discuss] Event debugger

2015-01-04 Thread mkieverpy
Hello Vasilis, >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? if your on X11 xev (+ possibly a pipeline through grep) might be sufficient for your debugging needs. I'm not a heavy user

Re: [Tkinter-discuss] Event debugger

2015-01-05 Thread mkieverpy
Hi Vasilis and Michael, I thought you could use xev just by starting it in another shell with "xev -id ". Or do you lose some info by running it this way? (I mean even more than by the other heavy restrictions - they seem to make xev useless for event debugging. I'll have to look at the other t

Re: [Tkinter-discuss] creating widgets generically, with a loop?

2006-06-21 Thread mkieverpy
> > Some background info: I have a Python/Tkinter script that displays a > dialog with buttons, where each button launches a file for editing. > Sort of like an HTML file in a browser, except with my script I can > launch it using a particular program. > > I've been trying to figure out a way of

Re: [Tkinter-discuss] creating widgets generically, with a loop?

2006-06-21 Thread mkieverpy
> > Some background info: I have a Python/Tkinter script that displays a > dialog with buttons, where each button launches a file for editing. > Sort of like an HTML file in a browser, except with my script I can > launch it using a particular program. > > I've been trying to figure out a way of

Re: [Tkinter-discuss] simple script -Tkinter question.

2006-07-04 Thread mkieverpy
Hi jkuo! >Hi everyone, >Here is my simple Tkinter script: >## start of entry.py >from Tkinter import * >root=Tk() >e1=Entry(root, width=16) >e1.pack() >e2=Entry(root, width=16) >e2.pack() >mainloop() >## end You should call 'root.mainloop()'! Just mainloop() is the mainloop of Tcl, not Tk. I don

Re: [Tkinter-discuss] simple script -Tkinter question.

2006-07-04 Thread mkieverpy
Michael Lange wrote: >Really? From Tkinter.py it looks to me like it should be equivalent: > >def mainloop(n=0): >"""Run the main loop of Tcl.""" >_default_root.tk.mainloop(n) > >(...snip...) I trusted the documentation :-(. So I thought this to be the cause of this strange behaviour. Otherwise I

Re: [Tkinter-discuss] Unicode in Tkinter in MacOS

2006-10-04 Thread mkieverpy
Mike Gasser wrote: > This may be just a Mac problem, but I find that in MacOS (10.4) I can > only get Tkinter to display the characters in the Latin-1 set and > Japanese. Possibly others, I don't know, but many Unicode characters > display as garbage characters. The simplest way to illustrate thi

Re: [Tkinter-discuss] Unicode in Tkinter in MacOS

2006-10-04 Thread mkieverpy
Mike Gasser wrote: > This may be just a Mac problem, but I find that in MacOS (10.4) I can > only get Tkinter to display the characters in the Latin-1 set and > Japanese. Possibly others, I don't know, but many Unicode characters > display as garbage characters. The simplest way to illustrate thi

Re: [Tkinter-discuss] Unicode in Tkinter in MacOS

2006-10-04 Thread mkieverpy
Mike Gasser wrote: > This may be just a Mac problem, but I find that in MacOS (10.4) I can > only get Tkinter to display the characters in the Latin-1 set and > Japanese. Possibly others, I don't know, but many Unicode characters > display as garbage characters. The simplest way to illustrate thi

Re: [Tkinter-discuss] Textbox in undecorated window (was - no subject -)

2006-10-07 Thread mkieverpy
Sorin Schwimmer wrote: >I am trying to use a textbox in an undecorated window. It works under Windows, >it fails under Linux. >Here is a test code: > ... The code works fine for me. What does not work? SuSE Linux 9.x, Python 2.4.1, Tk/Tcl 8.4.6, X11 with twm. What's your Linux configuration? Ma

Re: [Tkinter-discuss] OptionMenu, change the list of choices

2006-10-24 Thread mkieverpy
Vasilis Vlachoudis wrote: > > values=["One","Two","Three"] # Initial list > o = OptionMenu(frame, *values) > #... > #then later in the code read new values from a file > newvalues = f.readline().split() > o.config(???=newvalues) > With m = o.children ['menu'] you can access the menu which imp

Re: [Tkinter-discuss] Method to call when gui is first displayed

2006-11-27 Thread mkieverpy
Tony Cappellini askted: >I want to call the function which talks to CVS after the gui is displayed, >but without formal having to do anything. >After I call mainloop(), the gui is displayed, but then nothing happens >until the user selects a menu option. (as it should be). >Is there a tk method t

Re: [Tkinter-discuss] Method to call when gui is first displayed

2006-11-27 Thread mkieverpy
Tony Cappellini askted: >I want to call the function which talks to CVS after the gui is displayed, >but without formal having to do anything. >After I call mainloop(), the gui is displayed, but then nothing happens >until the user selects a menu option. (as it should be). >Is there a tk method t

Re: [Tkinter-discuss] Method to call when gui is first displayed

2006-11-27 Thread mkieverpy
Oops, sorry - too fast. The Map-Event occurs every time the widget is mapped to the screen, i.e. every transition from iconified->windowed calls ready(). So the ready-callback should be changed so it runs only once. Some questions from me: Any pointer to a better documentation (better than 'man n

Re: [Tkinter-discuss] Method to call when gui is first displayed

2006-11-27 Thread mkieverpy
> On Mon, Nov 27, 2006 at 09:54:52AM +0100, [EMAIL PROTECTED] wrote: > > >I want to call the function which talks to CVS after the gui is displayed, > > >but without formal having to do anything. > . > > The problem is: you should use the event callback just to start > > the n

Re: [Tkinter-discuss] Method to call when gui is first displayed

2006-11-27 Thread mkieverpy
> On Mon, Nov 27, 2006 at 09:54:52AM +0100, [EMAIL PROTECTED] wrote: > > >I want to call the function which talks to CVS after the gui is displayed, > > >but without formal having to do anything. > . > > The problem is: you should use the event callback just to start > > the n

Re: [Tkinter-discuss] How to dettach a Toplevel

2006-11-30 Thread mkieverpy
Sorin Schwimmer wrote: >Hi Michael, While the two toplevel solution will work nicely, I'm not sure how >would I close the main >application (at one point I want to be able to do so). >As for the other suggestion, that was my first >approach, but it doesn't work. >I don't know why, and sometime I

Re: [Tkinter-discuss] Problems with lambda functions in callbacks

2007-02-16 Thread mkieverpy
Hello Dídac, just to add an explanation, why your code doesn't work: >from Tkinter import * > >root = Tk(); > >def cb(x): >print x; >for i in range(5): >b = Button(root,text=i,command=lambda:cb(i)); The part "lambda:cb(i)" is a function which gets evaluated (called) when a button is

Re: [Tkinter-discuss] Multipage Postscript printing from canvas

2007-02-20 Thread mkieverpy
Hello Vasilis, the options to the postscript function are quite extensively explained in the tk canvas man-page (man n canvas). (Beware! I never used this :-) What I have seen from a cursory glance: Use pagewidth or pageheight options for scaling to A4/Letter size Use x, y, height and width opt

Re: [Tkinter-discuss] Unicode characters in canvas postscript

2007-03-20 Thread mkieverpy
Hello Vasilis, >I want to add "print to postscript" functionality on my program. I have >used the "postscript" method of Canvas, and it works nicely apart from >all no-latin (Unicode) characters. On the screen appear Ok but on the >postscript are replaced by question marks ?. Do you mean questio

Re: [Tkinter-discuss] Possibly n00bish question about ImageTk

2007-06-28 Thread mkieverpy
Hi Alan, in your function 'moo' 'pi' is a local variable which gets garbage collected when the function returns. Thus your image goes to gc nirvana. Making 'pi' global like this def moo(master): global pi img = Image.open('plotfig.png') f = Tkinter.Frame(master, width=800, height=600

Re: [Tkinter-discuss] Unicode in MacOSX: any progress?

2007-10-10 Thread mkieverpy
Hello Michael, in my answer back in october 2006 to Mike Gasser on this list, I referred to a thread I found here: http://aspn.activestate.com/ASPN/Mail/Message/tcl-mac/2865240 This thread discusses a patch for tk 8.4.9 to enable support for something called "Apple Type Services for Unicode Imag

Re: [Tkinter-discuss] .mainloop(), what's the parameter for?

2007-11-20 Thread mkieverpy
Hi Ron, I didn't know that parameter either, so I thought I'd take a look. I found the following loop in 'Tkapp_MainLoop' in '_tkinter.c': while (Tk_GetNumMainWindows() > threshold && !quitMainLoop && !errorInCmd) { ... The parameter 'n' is the 'threshold' in the above 'if'. If I un

Re: [Tkinter-discuss] Problems to show menubar

2007-11-26 Thread mkieverpy
Hi Mathias, you need to attach your menubar to a Toplevel window. A simple Frame cannot have a menubar. It works, if you change your code like this: from Tkinter import * class DistManager(Frame): ... def createMenuBar(self): menub

Re: [Tkinter-discuss] General Doubt about tkinter windows...

2007-12-03 Thread mkieverpy
Hi José, >I am trying to develop a simple application in python (I am very newby), but >I have some general doubts… my main window is Tk(), I am using grid manager, >and when in the application user changes the view, what I do is take a frame >out of the grid and put another one (and sometimes th

Re: [Tkinter-discuss] Threads and GUI

2008-01-23 Thread mkieverpy
Hello Bob, You wrote: >Is there anything that is OK for a thread to do to the GUI? Like >would just calling .update() on a Button() be OK? It seems to work, >but is it OK? >I'm calling it on a "Stop" button, specifically, in the thread every >quarter second, instead of peppering the code

Re: [Tkinter-discuss] fgstipple on Text widget

2008-03-25 Thread mkieverpy
Hi Ron, >from Tkinter import * >root = Tk() >t = Text(root) >t.insert( END, '01234567890123456789' ) >t.tag_add( 'x', '1.4', '1.12') >t.tag_config( 'x', fgstipple='gray12' ) >t.pack( ) >root.mainloop() your code works fine for me. With 'grey12' the text is just hard to see. Retry with 'grey75'.

Re: [Tkinter-discuss] lower() in class Misc

2008-04-02 Thread mkieverpy
Hi Ron, >Don't know if this is the place to report this. Not really a bug, however, >method lower() is defined twice in class Misc in the module Tkinter.py. >Both definitions are identical. right place would have been here: http://bugs.python.org/ I created a corresponding entry with a patc

Re: [Tkinter-discuss] thread module

2008-04-05 Thread mkieverpy
Hi Amit, >1. I created a global variable named "QuitThread" on my main module. >2. I initially set it to "False". >3. When clicking on the "Run" button of my GUI (defined in the main >module), a new thread starts using start_new_thread, where QuitThread is >one of the variables in its tuple