[Idea] A MUI dynmod for Python
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    Hello everyone,

    I'm putting here a simple example of what can be a use case of a MUI application creation with a possible MUI python module.

    I would like discuss here about that: implementation, usage, API, etc...

    PS: yes I know... You should have some Python knowledge to discuss here :-D


    [ Edited by Yomgui on 2006/10/27 9:08 ]

     Attached file(s) 
    And now... next project!
  • »19.10.06 - 13:27
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Chain-Q
    Posts: 347 from 2003/10/12
    From: 1 AU, EU, DE/HU
    Well, first, i've no clue of Python at all ;-), but since Python is an interpreted language, i'd check what similar languages offer for MUI. So what about taking a look on RXMUI? :-)

    And if you ask me, for a scripting language, i'd offer some very simple way to create requesters in scripts, next to basic API support, of course. It would be very useful then to create setup GUI's for stuff otherwise requiring config file editing and/or command line setup. (Like a GUI for MOSNet which first comes to mind, but there are many other things too.)
    [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
    [.Free Pascal Compiler MorphOS Port.]
    [.Hosting AmigaSpirit.hu.]
  • »19.10.06 - 15:44
    Profile Visit Website
  • Butterfly
    Butterfly
    Sergio
    Posts: 90 from 2005/2/16
    I would say the more syntactic sugar, the sweeter :)
    Making MUI objects appear as normal python objects and MUI attributes as regular python attributes would be nice.
    MUI Classes and attributes could be gnerated on the fly by reading a user-modifiable definition file.
    The event handling loop could be invoked through a run() command, and objects notified on event-handling methods like change_attr(self, new_value).
    Just my two cents - I know some python and little MUI.
  • »19.10.06 - 17:45
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    Good news!

    I've succeded to make my first application with one window and a button inside,
    using my MUI python module!

    I've put here a .zip file with 3 files, that will permit you to test that. (you need to be logged to see the attachments)
    Unzip the archive in RAM: for example and install files like that:

    * _muimaster.pym goes into LIBS:python2.4/lib-dynload
    * mui.py goes into LIBS:python2.4/plat-morphos
    * mui_test.py is keeped in RAM:

    Now open a new CLI and go into RAM:, then type python mui_test.py.

    To leave the application just press CTRL-C in the CLI or send a CTRL-C signal
    to the python task.

    As you see, notification is not implemented yet, but I hope I can do that soon.

    The _muimaster module handles perfectly a creation/destruction of any kind of MUI classes and builtins objects.
    But the way that it handles builtins objects is bit buggy and crashes the system. So prefer NewObject(), "xxx.mui" or "xxx.mcc" classes.
    I've not used buildtins in mui.py to construct a Button object.

    Anyway, NewObject() objects work good...

    You can set/get also any created object, check mui_test.py and mui.py for examples.

    BR,
    Guillaume

    [ Edited by Yomgui on 2006/10/27 13:11 ]

     Attached file(s) 
    And now... next project!
  • »27.10.06 - 08:08
    Profile Visit Website
  • Butterfly
    Butterfly
    Sergio
    Posts: 90 from 2005/2/16
    Very good news, where is the archive?
  • »27.10.06 - 10:18
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    Sergio: a the end of my previous post. Visible only if you are registred. So normaly you should see it.
    And now... next project!
  • »27.10.06 - 12:01
    Profile Visit Website
  • Butterfly
    Butterfly
    Sergio
    Posts: 90 from 2005/2/16
    Oops, yes I see it now. I was expecting a link in the message itself...
  • »27.10.06 - 20:06
    Profile