tkinter menu (newbie question)

Stephane Ninin stefnin.nospam at yahoo.fr
Wed Jun 19 14:55:32 CEST 2002


Eric Brunel <eric.brunel at pragmadev.com> a tapote dans
news:aepps0$al$1 at wanadoo.fr: 

Thanks for the help. 

> This doesn't suffice. With all that code, you just created a frame
> that has an attribute named menubar with the menu in it, but you
> didn't do anything to actually display the menu (there's no "magical"
> attributes in Python: if you do not do something with an attribute, it
> is only just that, an attribute...).
> 

> What you should do is to make MyApp a sub-class of Tk instead of Frame
> (this is more pratical this way), and add at the end of the
> constructor the line:
> 
> self.configure(menu=self.menubar)
>

If I want to use several of these windows,  
can still use for base class Tk, instead of Frame ? 


> And that should do the work. Oh: and don't forget to add parameter
> "self" to your "nothing" method, or you'll get a nice traceback when
> you do File->Quit...
> 

Yep... already had it before :) 
I am not completely used to this self first parameter yet.


  Thanks again.

-- 
  Stephane Ninin
stefnin.nospam at yahoo.fr
Les cons, ca ose tout... C'est meme a ca qu'on les reconnait.



More information about the Python-list mailing list