Creating ContextMenus at runtime on LInux

Discuss GUI programming with the RapaGUI plugin here
Post Reply
evil
Posts: 177
Joined: Mon Jun 14, 2010 1:38 pm

Creating ContextMenus at runtime on LInux

Post by evil »

I want to change the contextmenu of an object at runtime.
Area.ContextMenu has the applicability of IS.
On AmigaOS3 everything works well, but on Linux (could not test on Win/Mac)
the Menus are shown, but their events arent handled.
A Bug??

Best regars

George

A small code-snippet:

Code: Select all

@REQUIRE "RapaGUI"
xml$=[[
    <?xml version="1.0" encoding="iso-8859-1"?>
    <application id="app">
        <menu title="Menu" id="ctxmenu">
            <item id="req1">Requester 1</item>
            <item id="req2">Requester 2</item>
            <item id="quit">Beenden</item>
        </menu>

        <window>
            <hgroup>
                <button id="testbutton">TestButton</button>
                <rectangle/>
            </hgroup>
        </window>
    </application>
]]

Function p_eventfunc(msg)
    Switch msg.id
        Case "req1" moai.request("Ok","Requester 1","Ok")
        Case "req2" moai.request("Ok","Requester 2","Ok")
        Case "quit" end()
    EndSwitch
EndFunction

InstallEventHandler({Rapagui=p_eventfunc})

moai.createapp(xml$)
moai.set("testbutton","contextmenu","ctxmenu")
Repeat
    WaitEvent()
Forever
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Creating ContextMenus at runtime on LInux

Post by airsoftsoftwair »

Yes, it's a bug. Happens on Windows too. Will be fixed, thanks for reporting!
evil
Posts: 177
Joined: Mon Jun 14, 2010 1:38 pm

Re: Creating ContextMenus at runtime on LInux

Post by evil »

Okay. Thank you!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Creating ContextMenus at runtime on LInux

Post by airsoftsoftwair »

Code: Select all

- Fix [Windows/macOS/Linux]: Setting Area.ContextMenu didn't work correctly for context menu which hadn't
  been initialized yet
Post Reply