pyFLTK - Setting Menus


Description

This helper function has been deprecated. Use Fl_Menu_.copy() or Fl_Menu_.add() instead.

Methods

setMenu(PyObject *widget, PyObject *args)

This is a native Pythom function that adds a menu list to the specified widget.

Example

     from fltk import *

     def onFileQuit(ptr, data):
         print "Callback Data: ", data
         import sys
	 sys.exit(0)

     .
     .
     menu = Fl_Menu_Bar(0,0,105,25)
     userData = "User callback data"
     setMenu(menu, (("&File", 0, 0, 0, FL_SUBMENU), 
                    ("&Quit", 0, onFileQuit,userData, 0), 
		    (None, 0),
		    ("&Edit", 0, 0, 0, FL_SUBMENU),
		    (None, 0),
		    ("&Help", 0, 0, 0, FL_SUBMENU),
		    ("About...", 0, about_cb, 0, 0),
		    ))

     .
     .
     Fl.run()