Using RxMUI
  • Just looking around
    Posts: 8 from 2020/2/8
    I've been having a bit of fun with Arexx scripting for a few days, and I wanted to to have a go creating some kind of GUI app with it after I happened to notice RxMUI.library on grunch. Anway, I installed RxMUI via grunch, which seems to have placed it in System:Libs. Only right now I'm having trouble actually getting it to work in scripts...

    I'm trying this right out of the RxMUI guide:
    Code:
    /* Rexx MUI testing! */

    status.Frame = "Text"
    status.BackGround = "TextBack"
    status.PreParse = "1B63"x
    status.Contents = "Ready!"
    res = NewObj("Text", status)


    But upon running it I get:
    +++ Error 15 in line 7: Function not found

    Is there something special I have to do to get it to recognize the new library?

    Any help is apreciated, thanks!


    [ Edited by meguca 15.09.2020 - 20:33 ]
  • »15.09.20 - 19:30
    Profile
  • ghh
  • Cocoon
    Cocoon
    ghh
    Posts: 60 from 2017/7/16
    From: Prague
    Works with XNewObj("Text","status")
    Code:
    /* RxMUI test ghh */
    signal on halt
    signal on break_c
    call Init
    call CreateApp
    call HandleApp
    /**************************************** init libs Alfie ****/
    Init: procedure expose global.
    l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
    if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
    call Pragma("W","N")
    call RxMUIOpt("DebugMode ShowErr")
    return
    /******************************************************** app ****/
    CreateApp: procedure expose global.

    app.Title="RxMUI template"
    app.Version="$VER: RxMUI test 0.1"
    app.Copyright="ghh"
    app.Author="ghh"
    app.Description="RxMUI test"
    app.Base="RXMUIAPP"
    app.SubWindow="win" /* start gui */
    win.ID="MWIN"
    win.Title="RxMui window title"
    win.Contents="mgroup"
    status.Frame="Text"
    status.BackGroud="TextBack"
    status.PreParse="1B63"x
    status.Contents="I am ready"
    mgroup.0=XNewObj("Text","status")
    mgroup.1="bgr"
    bgr.Class="group"
    bgr.Horiz=1
    bgr.0=Button("okbutton","Ok")
    bgr.1=Button("quitbutton","Quit") /* end gui */
    /*********************************************************** notify ****/
    if NewObj("Application","App")>0 then exit
    call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
    call Notify("okbutton","Pressed",0,"App","return","say 'ok'")
    call Notify("QUITBUTTON","PRESSED",0,"APP","RETURNID","QUIT")
    call set("win","open",1)
    return
    /*********************************************** main event Alfie ****/
    HandleApp: procedure expose global.
    ctrl_c=2**12
    do forever
    call NewHandle("App","h",ctrl_c)
    if and(h.signals,ctrl_c)>0 then exit
    select
    when h.event="QUIT" then exit
    otherwise interpret h.event
    end
    end
    /****************************************************** exit signal ****/
    halt:
    break_c:
    exit
  • »15.09.20 - 22:27
    Profile Visit Website
  • ghh
  • Cocoon
    Cocoon
    ghh
    Posts: 60 from 2017/7/16
    From: Prague
    You can use NewObj in a stand-alone function that creates an object.
    Code:
    /* RxMUI test ghh */
    signal on halt
    signal on break_c
    call Init
    call CreateApp
    call HandleApp
    /**************************************** init libs Alfie ****/
    Init: procedure expose global.
    l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
    if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
    call Pragma("W","N")
    call RxMUIOpt("DebugMode ShowErr")
    return
    /******************************************************** app ****/
    CreateApp: procedure expose global.

    app.Title="RxMUI template"
    app.Version="$VER: RxMUI test 0.2"
    app.Copyright="ghh"
    app.Author="ghh"
    app.Description="RxMUI test"
    app.Base="RXMUIAPP"
    app.SubWindow="win" /* start gui */
    win.ID="MWIN"
    win.Title="RxMui window title"
    win.Contents="mgroup"
    mgroup.0="bgr"
    bgr.Class="group"
    bgr.Horiz=1
    bgr.0=Button("okbutton","Ok")
    bgr.1=Button("quitbutton","Quit") /* end gui */
    /*********************************************************** notify ****/
    if NewObj("Application","App")>0 then exit

    call maketext()

    call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
    call Notify("okbutton","Pressed",0,"App","return","say 'ok'")
    call Notify("QUITBUTTON","PRESSED",0,"APP","RETURNID","QUIT")
    call set("win","open",1)
    return
    /**/
    maketext: procedure expose global.
    status.Frame="Text"
    status.BackGroud="TextBack"
    status.PreParse="1B63"x
    status.Contents="I am ready"
    if NewObj("Text","status")>0 then exit
    call Add("mgroup","status") /* add to mgroup (at the end of the group) */
    return
    /**/
    /*********************************************** main event Alfie ****/
    HandleApp: procedure expose global.
    ctrl_c=2**12
    do forever
    call NewHandle("App","h",ctrl_c)
    if and(h.signals,ctrl_c)>0 then exit
    select
    when h.event="QUIT" then exit
    otherwise interpret h.event
    end
    end
    /****************************************************** exit signal ****/
    halt:
    break_c:
    exit
  • »16.09.20 - 00:39
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    You may check the libs with Code:
    rxlib
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »16.09.20 - 07:44
    Profile
  • Just looking around
    Posts: 8 from 2020/2/8
    Quote:

    ghh wrote:
    Works with XNewObj("Text","status")
    Code:
    /* RxMUI test ghh */
    signal on halt
    signal on break_c
    call Init
    call CreateApp
    call HandleApp
    /**************************************** init libs Alfie ****/
    Init: procedure expose global.
    l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
    if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
    call Pragma("W","N")
    call RxMUIOpt("DebugMode ShowErr")
    return
    /******************************************************** app ****/
    CreateApp: procedure expose global.

    app.Title="RxMUI template"
    app.Version="$VER: RxMUI test 0.1"
    app.Copyright="ghh"
    app.Author="ghh"
    app.Description="RxMUI test"
    app.Base="RXMUIAPP"
    app.SubWindow="win" /* start gui */
    win.ID="MWIN"
    win.Title="RxMui window title"
    win.Contents="mgroup"
    status.Frame="Text"
    status.BackGroud="TextBack"
    status.PreParse="1B63"x
    status.Contents="I am ready"
    mgroup.0=XNewObj("Text","status")
    mgroup.1="bgr"
    bgr.Class="group"
    bgr.Horiz=1
    bgr.0=Button("okbutton","Ok")
    bgr.1=Button("quitbutton","Quit") /* end gui */
    /*********************************************************** notify ****/
    if NewObj("Application","App")>0 then exit
    call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
    call Notify("okbutton","Pressed",0,"App","return","say 'ok'")
    call Notify("QUITBUTTON","PRESSED",0,"APP","RETURNID","QUIT")
    call set("win","open",1)
    return
    /*********************************************** main event Alfie ****/
    HandleApp: procedure expose global.
    ctrl_c=2**12
    do forever
    call NewHandle("App","h",ctrl_c)
    if and(h.signals,ctrl_c)>0 then exit
    select
    when h.event="QUIT" then exit
    otherwise interpret h.event
    end
    end
    /****************************************************** exit signal ****/
    halt:
    break_c:
    exit



    Oh I didn't know that you had to load the libraries first... Thanks so much for these examples, it helps a lot!
  • »16.09.20 - 18:11
    Profile