Sorry if this is a silly question, but I am struggling to understand the
way Tkinter works.
What I want to do is this:
Take a Menubar -widget as the one in the pmwdemos. In reaction to a
menu-item selected I want a window to open within the frame of the larger
widget with an entryfield in it. It must accept input and when the input
is finished, the entryfield-widget must be removed with the original
window still there.
I have tried this, but it doesn't work:
(The code is most of the time an adaptation of the Pmw's Entryfield demo)
import sys
import Tkinter
import Pmw
def printme(text):
print text
class Hoofspyskaart:
def __init__(self, parent):
self.balloon = Pmw.Balloon(parent)
self.ouer = parent
....
menuBar.addmenuitem('Edit', 'command', "Vra 'n vraag",
command = self._kryantwoord,
label = 'Vraag')
def _kryantwoord(self):
raam = Pmw.Group(self.ouer)
antwoord = Pmw.EntryField(raam.interior(),
labelpos = 'w',
label_text = 'Vraag:',
value = ' ',
errorbackground = 'grey70')
antwoord.grid()
printme(antwoord.get())
antwoord.destroy()
Can somebody help please?
Johann
--------------------------------------------------------------------------
| Johann Spies Windsorlaan 19 |
| jhs...@alpha.futurenet.co.za 3201 Pietermaritzburg |
| Tel/Faks Nr. +27 331-46-1310 Suid-Afrika (South Africa) |
--------------------------------------------------------------------------
"Let your character be free from the love of money,
being content with what you have; for He Himself has
said, "I will never desert you, nor will I ever
forsake you."
Hebrews 13:5