Creating ContextMenus at runtime on LInux

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

Creating ContextMenus at runtime on LInux

Post by evil » Fri Jan 18, 2019 3:02 pm

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: 2968
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Creating ContextMenus at runtime on LInux

Post by airsoftsoftwair » Sat Jan 19, 2019 5:43 pm

Yes, it's a bug. Happens on Windows too. Will be fixed, thanks for reporting!

evil
Posts: 129
Joined: Mon Jun 14, 2010 1:38 pm

Re: Creating ContextMenus at runtime on LInux

Post by evil » Sat Jan 19, 2019 6:15 pm

Okay. Thank you!

Post Reply