Creating Menus and Assigning

First, we create the main menu:

(define main-menu (tk 'create-widget 'menu))

Second, we create the sub-menu edit as a descendant of main-menu:

(define edit-menu (main-menu 'create-widget 'menu))

The other sub-menu file should not be torn off: 

(define file-menu (main-menu 'create-widget 'menu #:tearoff #f))

Finally, we assign main-menu to the root window:

(tk 'configure #:menu main-menu)

The menu is empty, so there is not so much to be seen:

rootMenuEmpty

See also menu.


© Author | Home | Sitemap