Common Features of the MIEN GUIs

All of the MIEN toplevel GUIs are derived from the MIEN "BaseGUI" class, which provides some common behaviors. Custom user or extension GUIs that derive from this class and use its methods will also have these common behaviors.

Menu Commands

Mac OS X Note

If you use Mac OS, note that MIEN windows each provide their own menu bar, at the top of the window. This behavior applies to all platforms, and differs from the typical Mac behavior of one menu bar per app, at the top of the screen. When MIEN is active, the Mac menu bar will contain a single "Python" menu, which has no useful functions other than to quit the app (which can also be done from the File menu of the main window).

Some versions of MIEN have an incompatibility with some versions of Mac OS which prevents MIEN from correctly detecting that it is running on Mac. If this happens, the menu bar will display at the top of the screen, rather than the top of the window. This is a bug (descibed here), and should be corrected by updating MIEN. MIEN is usable in this single-menu bar state, but some operations are cumbersome and error prone. If an update doesn't resolve the issue, please report the bug, along with your version of MIEN and your version of Mac OS.

Standard File Menu

Most MIEN apps have a File menu as the first (left-most) menu in the menu bar, and this menu provides a set of common functions, as well as some functions specific to a particular app. In a few add-on GUIs the first menu may not be named File, but may still provide some or all of these standard File menu functions.

Python Menu

Most MIEN GUIs have a "Python" main menu, although a few of them don't, or only have the menu when they are the master GUI. When this menu is present, it provides access to a Python interpreter that is bound to the current GUI. Since Python doesn't limit access to object members, this interpreter can be used to change the state of the GUI or any element of the current document in any way that you like. This can be very useful when experimenting with new analysis protocols or when writing extensions. If you need to examine the internal state, or make a quick change that isn't provided by a GUI function, the interpreter can do this for you. Needless to say this is also quite dangerous. It is easily possible to produce unstable states in the GUIs by changing things at the command line. Save your data and/or know what you are doing. Also, changes in state created at the command line are not monitored by the GUIs. You will need to manually refresh displays to see the changes you made, and you will usually not be able to use GUI Undo functions. Still, the payoff for working in this somewhat unstable environment is tremendous power and flexibility.

When you launch a Python shell from this menu, the name gui will be bound to the current GUI in the Python environment. This name gives you access to the GUIs methods and state. Since every MIEN gui carries a reference to the current document in the data member document, the interactive command line can access the current document using gui.document. To figure out what you can do with these objects, you will need to read some of the MIEN API documentation. Of course, if you are familiar with Python's introspection abilities, you can also poke around in the interpreter and see what you find. For example dir(gui), dir(gui.document), help(gui.document.getElements). Many GUI methods are undocumented at the source code level, so, for example help(gui.save) isn't very informative. Most of the methods of NMPML objects (elements of MIEN documents) are documented, though, so help(gui.docement.xpath) is more informative.

Which commands you have available at the Python menu depend on how you run MIEN, and what Python packages you have installed.

 

Last edit: 05/29/09

Index