Arexx command to iconify a program?
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2238 from 2003/4/10
    From: France
    Hello,

    is there a AREXX command to iconify a program please?

    I would like to iconify Easy2Install when it launch a program.

    I use Hollywood but i don't find an Hollywood command for that unfortunally...
  • »04.08.24 - 08:44
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3110 from 2003/3/5
    From: Canada
    MUI applications respond to "HIDE" command by default.
  • »04.08.24 - 10:43
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    Hmm, MUIRoyale apps have support for the Iconified attribute of Application class, but RapaGUI doesn't seem to have support for this attribute!?
  • »04.08.24 - 16:48
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2238 from 2003/4/10
    From: France
    Quote:

    igracki a écrit :
    Hmm, MUIRoyale apps have support for the Iconified attribute of Application class, but RapaGUI doesn't seem to have support for this attribute!?

    Yes, you can iconfied with RapaGUI too, but here i have a problem to send an AREXX command (HIDE) to an Hollywood app to iconify the GUI. An Arexx port named EASY2INSTALL is open but no action about iconification.

    Rxcmd EASY2INSTALL HIDE

    has no effect...

    Work with FLOWSTUDIO.1 for example
  • »04.08.24 - 18:47
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Samurai_Crow
    Posts: 162 from 2009/12/10
    From: Minnesota, USA
    I love RapaGUI myself but there are no Amiga/AROS/MorphOS specific features in RapaGUI on purpose. It's strictly cross-platform and to suggest adding it would require a wxWidgets equivalent to also be available. Is it so much more of a nuisance to switch to MUI-Royale?

    I'm still waiting for Royale 2.0 for an MUI specific feature of being able to have word-wrappable buttons to use as links. Maybe it won't come. I guess having an AmigaGuide viewer in Hollywood is as unimportant as a Tapatalk-style forum browser now that we have a good web browser on MorphOS.

    (Sorry for the off-topic banter, BTW )

    [ Edited by Samurai_Crow 04.08.2024 - 14:03 ]
  • »04.08.24 - 19:00
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    @Papiosaur:
    I don't think that RapaGUI Hollywood apps have an ARexx Port, I made a quick search for arexx/rexx in RapaGUIs guide with no success.

    @Samurai_Crow:
    What do you mean with "word-wrappable buttons"?
    You can use "\n" in button's text to have multiple lines.
  • »04.08.24 - 19:17
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Samurai_Crow
    Posts: 162 from 2009/12/10
    From: Minnesota, USA
    Quote:

    igracki wrote:
    What do you mean with "word-wrappable buttons"?
    You can use "\n" in button's text to have multiple lines.


    I mean like a link in Amigaguide where each button's position is wrapped into the hypertext around it. Each word is a button so the text-wrapping includes each button. MUI has an escape code to allow any object to be embedded into the text.
  • »04.08.24 - 20:16
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3110 from 2003/3/5
    From: Canada
    Quote:

    Samurai_Crow wrote:
    I'm still waiting for Royale 2.0 for an MUI specific feature of being able to have word-wrappable buttons to use as links. Maybe it won't come.


    MUI doesn't have support for that so I'd find that unlikely to happen.
  • »04.08.24 - 21:08
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    @Papiosaur:
    Yes, you can create an arexx port yourself, but then you have to do an own iconify function yourself, f.e close your window, add an icon to workbench etc.
    All MUI apps automatically have an HIDE arexx command.

    In MUI Royale apps you can set the Iconified attribute of the application class to iconify your app.

    I wrote a small shell command to hide a window from shell WinAction.
    Code:
    Usage for your Easy2Install app:
    WinAction Easy2Install HIDE
  • »04.08.24 - 21:11
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    I uploaded a new version of WinAction
    Its now a full implementation of Intuition's WindowAction() function.
    Code:

    0:00.02 [ 0] Dev:ecx/my/WinAction> WinAction ?
    NAME/A,ACTION/A,X=LEFT/N,Y=TOP/N,W=WIDTH/N,H=HEIGHT/N: ?

    Perform an action to a window
    NAME/A: Name of the window, case sensitive
    ACTION/A: One of the actions below, not case sensitive
    X=LEFT, Y=TOP, W=WIDTH, H=HEIGHT: Only for the actions BOX, MOVE and SIZE

    Possible window actions are:
    ACTIVATE - activate it
    BACK - put it to the back
    FRONT - put it to the front
    FBACK - put all windows of the same "family" to back
    FFRONT - put all windows of the same "family" to front
    MIN - minimize it
    MAX - maximize it
    RESTORE - restore size and pos
    OPENMENU - open window's menu
    HIDE - hide the window
    SHOW - show the window
    ZIP - zip the window
    CLOSE - send an IDCMP_CLOSEWINDOW

    Special actions with parameters
    BOX - change the window's position and size
    Example: WinAction TestWin BOX x=100 y=234 w=555 h=333
    MOVE - move the window's left and top position
    Example: WinAction TestWin MOVE x=100 y=-200
    SIZE - resize the window, the values will be ADDED/SUBTRACTED!
    Example: WinAction TestWin SIZE 222 -111
  • »05.08.24 - 16:55
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 535 from 2003/2/25
    From: France
    Quote:

    igracki wrote:
    I uploaded a new version of WinAction
    Its now a full implementation of Intuition's WindowAction() function.
    Code:

    0:00.02 [ 0] Dev:ecx/my/WinAction> WinAction ?
    NAME/A,ACTION/A,X=LEFT/N,Y=TOP/N,W=WIDTH/N,H=HEIGHT/N: ?

    Perform an action to a window
    NAME/A: Name of the window, case sensitive
    ACTION/A: One of the actions below, not case sensitive
    X=LEFT, Y=TOP, W=WIDTH, H=HEIGHT: Only for the actions BOX, MOVE and SIZE

    Possible window actions are:
    ACTIVATE - activate it
    BACK - put it to the back
    FRONT - put it to the front
    FBACK - put all windows of the same "family" to back
    FFRONT - put all windows of the same "family" to front
    MIN - minimize it
    MAX - maximize it
    RESTORE - restore size and pos
    OPENMENU - open window's menu
    HIDE - hide the window
    SHOW - show the window
    ZIP - zip the window
    CLOSE - send an IDCMP_CLOSEWINDOW

    Special actions with parameters
    BOX - change the window's position and size
    Example: WinAction TestWin BOX x=100 y=234 w=555 h=333
    MOVE - move the window's left and top position
    Example: WinAction TestWin MOVE x=100 y=-200
    SIZE - resize the window, the values will be ADDED/SUBTRACTED!
    Example: WinAction TestWin SIZE 222 -111



    Would be nice to have a way to query the screen size for doing some math for placing the window on a corner for example.
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »05.08.24 - 19:01
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2100 from 2003/2/24
    From: po-RNO
    Very nice tool, thanks!

    I'd like to have an option to LIST all available window names, and QUERY current values of an individual window (position, size, hide status... either with single values or all at once, don't know which would be better... single values with no extra info would probably be easier to pick by some other program).

    @Papiosaur:
    BTW. I've sent you couple mails, have you noticed them or are they in the spam folder :)

    [ Edited by jPV 06.08.2024 - 08:30 ]
  • »06.08.24 - 05:29
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    New v1.1 of WinAction
    I added a LIST and QUERY option including a QueryFormat string to query just a single value or with a customize string.
    The NAME option can now also be an hexaddress (f.e. 0x1B9C8F24), for windows w/o a title or multiple windows with the same name.

    Code:

    :00.02 [ 0] Dev:ecx/my/WinAction> WinAction ?
    NAME,ACTION,LIST/S,X=LEFT/N,Y=TOP/N,W=WIDTH/N,H=HEIGHT/N,QF=QUERYFORMAT/K: ?

    Perform an action to a window
    NAME : Name of the window, case sensitive
    ACTION: One of the actions below, not case sensitive, can be abbreviated
    LIST : List all available windows

    For the actions BOX, MOVE and SIZE:
    X=LEFT, Y=TOP, W=WIDTH, H=HEIGHT

    For QUERY action: QF=QUERYFORMAT/F
    %a: address %A: hasAlpha %h: height
    %H: hidden? %m: is MUI? %o: opacity
    %t: title %T: screen title %w: width
    %x: leftEdge %y: topEdge %z: zoom state
    default is: "%t (%T) %x/%y, %wx%h, %H, HasAlpha: %A, %m, Opacity=%o, Zoomed=%z"

    Possible window actions are:
    ACTIVATE - activate it
    BACK - put it to the back
    FRONT - put it to the front
    FBACK - put all windows of the same "family" to back
    FFRONT - put all windows of the same "family" to front
    MIN - minimize it
    MAX - maximize it
    RESTORE - restore size and pos
    OPENMENU - open window's menu
    HIDE - hide the window
    SHOW - show the window
    ZIP - zip the window
    CLOSE - (try to) close the window (sends a IDCMP_CLOSEWINDOW)
    QUERY - query values of a window, see QF=QUERYFORMAT option

    Special actions with parameters
    BOX - change the window's position and size (X, Y, W, H)
    Example: WinAction TestWin BOX x=100 y=234 w=555 h=333
    MOVE - move the window's left and top position (X, Y)
    Example: WinAction TestWin MOVE x=100 y=-200
    SIZE - resize the window, the values will be ADDED/SUBTRACTED! (W, H)
    Example: WinAction TestWin SIZE 222 -111
  • »07.08.24 - 20:17
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2100 from 2003/2/24
    From: po-RNO
    Cool, thanks, but couple of things:

    Window names in QUERY are truncated to 32 characters (+ some non-printable character).

    For example, LIST shows this when opening a text file:
    WINDOW [ 899/ 219, 1440x 972] "System:Prefs/Env-Archive/sys/net/hosts" (0x2A64C394)

    But QUERY shows it like this:
    Ram Disk:> winaction 0x2A64C394 query qf=%t
    System:Prefs/Env-Archive/sys/netB


    And how I can get ZOOMED to YES? Whatever I try it's always NO...


    And about the original question in this thread, would it be possible to trigger iconifying for MUI apps somehow? AFAIK all MUI apps can be iconified by pressing the (optional) iconify button on the window border, or by selecting Iconify from the MUI popup button menu. I think this doesn't need support from programs themselves? Could the same action be triggered programmatically somehow?

    The HIDE option isn't quite the same, because there won't be an icon on the desktop and you'll have to know exactly what to do to get it shown again. Iconified program is easier for users to notice and bring the GUI back by doubleclicking an icon.


    And not wanting to nitpick, but should the output from QUERY be more consistent? Now there's VISIBLE/HIDDEN, HasAlpha: YES/NO, ISMUI/NOMUI, Zoomed=YES/NO, etc. I think it would be better if they all would be in the same form... maybe PROPERTY=YES/NO/othervalue, or so...
  • »08.08.24 - 14:45
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    Thanks for reporting bugs and for suggestions!

    For iconifying a MUI app, I need to find a way to get the AppObject which belongs to a window.
    But I don't know how?

    New version can be found here
    08-Aug-2024: v1.2
    Fix: QUERY command truncated window's title (and window's screentitle)
    [reported by jPV]
    Chg: QUERY output is now more consistent (Yes/No for all properties)
    [suggested by jPV]
    Chg: Changed default QUERYFORMAT to reflect the changes in QUERY
  • »08.08.24 - 17:06
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    Okay v1.3 now has an ICONIFY action for MUI windows, get it here

    @jPV: I noticed too, that the ZOOM status seems to not work.
    I simply check for WFLG_ZOOMED in win.flags.

    [ Edited by igracki 08.08.2024 - 20:51 ]
  • »08.08.24 - 18:38
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2238 from 2003/4/10
    From: France
    Thanks to add iconify option!

    Unfortunally don't work with Easy2Install... the others functions work...

    Easy2Install window appears in LIST

    Maybe possibility to launch the "Iconify" option via the menu of the window? It work if i do the action manually.

    [EDIT]
    JUMP to others screens will be a good feature for your tool i think.
    SAVE values to the icon of the app will be nice too
  • »08.08.24 - 19:24
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    I just tested it with Easy2Istall and saw that it doesn't work...

    It's because some MUI apps doesn't have a BrokerPort like Easy2Install

    I need this to get the task of the MUI app...

    But I already have an other idea to solve the problem;)

    Not now, have to go to work now
  • »09.08.24 - 04:40
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 417 from 2003/2/24
    From: Berlin
    Quote:

    jPV wrote:
    And for some reason, when I iconify a MultiView window with WinAction, I get two icons on the desktop. One icon displays "Multiview" as its name and another displays the document name. If I iconify the window manually, I only get one icon with the document name.


    Hmm, strange, I only set MUIA_Application_Iconified to TRUE to iconify an app.

    Here is v1.4 of WinAction.
    If the app of a window can't be found, it now tries to use the given name as basename
    to find the app object.
    Code:
    f.e. WinAction EASY2INSTALL.1 I

    iconifies the Easy2Install app.
    It can also be used to UnIconify the app!

    Code:
    09-Aug-2024: v1.4
    Chg: ICONIFY: if the MUI app of a window can't be found, use the NAME
    argument as the basename of a MUI app to find its app object
    Finally Easy2Install can be iconified;)
    This also can be used to Uniconify a MUI app!
    NEW: LIST now also shows a list of MUI apps, the second entry is the basename
  • »09.08.24 - 19:15
    Profile Visit Website