Yesterday, I've finished my lower layer for one of my project on MorphOS: creating a Python module to wrap MUI. Many of GUI Toolkits on others platforms supported by Python have already wrapped into module, so why not MUI?

In its first shape, this wrapper will be split into 2 layers:

  1. The lower layer: it's a C module, that interface the Python side with MUI objects and the BOOPSI api. It's raw, simple and permit to handle any kind of MUI objects (builtins or not, created by this wrapper or not).
  2. The upper layer: it's a pure Python module using the lower C module. This layer declares MUI MCC as classes. This permits to fix and get control on attributes/methods allowed by MCC. It's a Pythonization of MUI.

Creating a MUI object can be done by using the OOO paradigm of Python or the simple function based paradigm:

Functional example:

from mui import *

# Creating a new main window with a simple text gadget
win = Window(RootObject=Text(Content='Hellow world!'))

# Now creating the application
app = Application(
 Version     = "$VER: PyMUITest 0.1 (06.06.07)",
 Copyright   = "(C)2007, Yomgui",
 Author      = "Yomgui",
 Description = "PyMUI test",
 Base        = "PYMUITEST")
# ... and link your window to it
app.AddWindow(win)

win.Open = True # it's like a classical MUI attribute access

# Run !
app.mainloop()

Let me finish the upper layer now ;-)