Using multiple screens on multiple windows
Posted: Sun Nov 28, 2021 2:58 pm
I have a problem using multiple screens on multiple windows created with RapaGUI. Precisely, if I create two windows with one screen each, when I try to click the mouse on the first screen created, the event is detected correctly, while instead clicks made on the other screen are ignored. An example that highlights what happens:
The program opens two windows. Selecting the screen contained in "Window1", the message "User clicked on screen:1" is printed correctly. Selecting the screen on the other window should print "User clicked on screen:2", but nothing happens.
I'm using Hollywood 9 and RapaGUI 2.1.
Where is the mistake?
Code: Select all
@VERSION 9,0
@REQUIRE "RapaGUI", {Link = True}
@DISPLAY 1,{Width=500, Height=500, Color=#WHITE}
@DISPLAY 2,{Width=500, Height=500, Color=#WHITE}
Function p_EventFunc(msg)
Switch msg.action
Case "OnMouseDown":
; User clicked on a screen
DebugPrint("User clicked on screen:"..msg.ID)
Case "RapaGUI":
Switch msg.attribute
; User close program
Case "CloseRequest":
End
EndSwitch
EndSwitch
EndFunction
XML$="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><application id=\"DemoApp\">"
XML$=XML$.."<window title=\"Window1\" id=\"Window1\" notify=\"CloseRequest\"><vgroup><hollywood display=\"1\"/></vgroup></window>"
XML$=XML$.."<window title=\"Window2\" id=\"Window2\" notify=\"CloseRequest\"><vgroup><hollywood display=\"2\"/></vgroup></window>"
XML$=XML$.."</application>"
moai.CreateApp(XML$)
InstallEventHandler({RapaGUI = p_EventFunc})
InstallEventHandler({OnMouseDown = p_EventFunc})
Repeat
WaitEvent
Forever
I'm using Hollywood 9 and RapaGUI 2.1.
Where is the mistake?