From: Alex T. <al...@tw...> - 2005-08-09 17:14:05
|
I've written a "wrapper" function to let me easily do pop-up menus, without having to remember how to deal with wxPython directly each time I want it. The calling interface is pretty simple, you pass in - the background (i.e. usually "self") - list of items as strings (one-level of submenu as a sub-list is allowed) - (x,y) to display the menu. For example: result = helpful.popUpMenu(self, ["one", "two", ["Three", "Four"], "555"], self.components.Button.position) print "menu gives", result The result is either the string selected, or None. Hopefully, this (or some better equivalent) will become part of PythonCard, but in the meantime you can find this (and the multiButtonDialog I mentioned a few weeks back) at www.tweedly.net/Python/helpful.pys -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.2/65 - Release Date: 07/08/2005 |