How to create a tear off menu in TKinter. Help Needed

Jim Segrave jes at nl.demon.net
Fri Apr 7 02:07:03 EDT 2006


In article <1144351644.629167.115470 at g10g2000cwb.googlegroups.com>,
ishtar2020 <ishtar2020 at hotmail.com> wrote:
>Hi everybody
>
>I'd appreciate some help on creating a tear off menu with TkInter. I've
>been reading some documentation but still no luck.
>
>Please don't get confused: when I mean "tear off" menu I don't mean a
>drop-down or a pop-up menu, but those options which yield to another
>batch of sub-options when scrolled over, (as for example, the File->New
>option from internet explorer).
>
>I'm sure TkInter supports those widgets because the IDLE editor is
>built on it and it's got some tear off options like File->Recent Files.

I created an extension for Tkinter which allows for popup menus (onesl
which appear when a parent menu item is under the cursor and close if
you then move away). It was an early experiment for me with Tkinter,
so I'm sure it can be heavily improved. It's available on 

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442500

(see the notes, the demonstration program doesn't work correctly on
Windows, because I forgot the directory separator is a  '\'. But the
code itself works to create cascading auto-pop-up menus, or any other
widget you want to pop-up as part of a menu.



-- 
Jim Segrave           (jes at jes-2.demon.nl)




More information about the Python-list mailing list