Gerardo Juarez wrote:
> I'm having problems with a widget, which I've been able to isolate to the
> following example:
>
> from Tkinter import *
>
> def display():
> global x
> print x
>
> root = Tk()
> x = 0
> check = Checkbutton(root, variable=x)
> check.pack()
> button = Button(te
Hi Gerardo,
You can't user a regular python variable for "x", you need to create, in
this case, an IntVar "control variable". See revised code below, also
see http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html
Cam Farnell
from Tkinter import *
def display():
print x.g
Hi,
I'm having problems with a widget, which I've been able to isolate to the
following example:
from Tkinter import *
def display():
global x
print x
root = Tk()
x = 0
check = Checkbutton(root, variable=x)
check.pack()
button = Button(text='Display variable', command=display)
butto
Hi Michael,
I see your point, but this is not what I am looking for. What I'm trying to
achieve goes on the
following lines: the user has a GUI and works. A daemon (I'm on Linux) receives
a message
for the user, so it pops-up a little notification symbol (there is actualy a
bit more inter-proce
On Tue, 28 Nov 2006 09:25:06 -0800 (PST)
Sorin Schwimmer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> If I have:
>
>
> from Tkinter import *
> root=Tk()
> tl=Toplevel()
> root.mainloop()
>
>
> and then close the root window, it will take tl with it. Is there a way to
> keep tl alive after root dies?
Problem:
>>> from Tix import *
>>> root=Tk()
>>> nb=NoteBook(root)
>>> nb.add('pg_1', label='pg 1')
>>> nb.pages()
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/local/lib/python2.4/lib-tk/Tix.py", line 1160, in pages
ret.append(self.subwidget(x))
File "/usr/local/l
The "global" was omitted when I cut the code down to a skeleton example;
it's in my big program.
I have avoided "update" for the same reason. Even the New Mexico Tech
documentation
(http://infohost.nmt.edu/tcc/help/pubs/tkinter/universal.html) says
never to use "update" inside a callback. Thus
- Original Message -
From: Sorin Schwimmer
To: tkinter-discuss@python.org
Sent: Tuesday, November 28, 2006 11:42 AM
Subject: Re: [Tkinter-discuss] Stumped
I never tried Bob's Greschke idea of using update() in a callback, because
of this reason:
http://www.pythonware.com/library/tkinter
I never tried Bob's Greschke idea of using update() in a callback, because of
this reason:
http://www.pythonware.com/library/tkinter/introduction/x9374-event-processing.htm
Sorin
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam pro
Adding the - lines seems to work.
> from Tkinter import *
> import time
>
> def on_button():
> for J in range(10):
> print J
> if CancelNow:
> break
> time.sleep(1)
-- Root.update()
>
> def Cancel(Event):
-- global CancelNow
> print 'Cancel
Add in your functions, first statement after def
global CancelNow
This way everybody refers *the same* flag.
I would normally move your second-last statement (CancelNow = False) just below
imports.
De-stumped?
Sorin
___
This is probably really simple but I haven't yet figured it out. It
happens in the context of a much larger program but stripped to it's
essence is per the little program below.
The general idea is that the user clicks on a button, that initiates an
operation which is going to take some time, s
Hi,
If I have:
from Tkinter import *
root=Tk()
tl=Toplevel()
root.mainloop()
and then close the root window, it will take tl with it. Is there a way to keep
tl alive after root dies?
Thanks,
Sorin
Yaho
13 matches
Mail list logo