overrideredirect vs. text entry etc. widget

S

Sean DiZazzo

I just googled this post:

http://mail.python.org/pipermail/python-list/2006-September/575832.html

something like:

from Tkinter import *

root = Tk()
Entry(root).pack()
Button(root, text='Quit', command=sys.exit).pack()
root.overrideredirect(1)
root.mainloop()

the button works boths under linux(debian) and windows, but the entry
widget only works on windows, any idea?

I am making a skinnalbe music player, so the issue must be solved.

Whats interesting is that if you call overrideredirect from a button
command, it works as expected. Well, at least the text entry field
behaves for me on Ubuntu...

from Tkinter import *

root = Tk()

def override():
if root.overrideredirect():
root.overrideredirect(False)
else:
root.overrideredirect(True)

root.withdraw()
root.deiconify()

Entry(root).pack()
Button(root, text='Override', command=override).pack()
root.mainloop()

~Sean
 
K

kernus

Whats interesting is that if you call overrideredirect from a button
command, it works as expected.  Well, at least the text entry field
^^^^^^^^^^^^^^^^^so, Sean, you know how to *click this magic button in
the programming way*?
 
S

Sean DiZazzo

^^^^^^^^^^^^^^^^^so, Sean, you know how to *click this magic button in
the programming way*?

Did you try it? Did it work?

I tried, using button.invoke(), and a few less obvious ways
(self.tk.call()...), but couldn't do it programatically. I don't
understand why manually clicking the button in the gui is any
different than calling it's function, or calling invoke(). I'd be
interested to know.

I also tried calling it from a different thread, or giving the gui
some time to initialize before calling it. No love. Only manually
clicking it seems to work.

I also found some documentation that clearly states "overrideredirect
might not work on some platforms." So I guess I have one of those
platforms!

~Sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top