Page 1 of 1

Multiple Displays

Posted: Tue Sep 10, 2019 6:12 pm
by LarsB
Hi,

is it possible to have more than one display with RappaGUI in a window?
I am getting an error that "Error in line 31 (DispTest.hws): Could not find display 2!"

I tried to boil it down as much as I could.
First the xml which should be stored in a file "NewGUI2.xml"

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">

 <menubar id="mymenubar">
 <menu title="Datei">
 <item id="menabout">About...</item>
  <item id="menaboutrapagui"> About RapaGUI...</item>
         <item/>
         <item id="menquit">Quit</item>
      </menu>
   </menubar>

<window title="Test" menubar="mymenubar">

<vgroup>

<hgroup>
<hollywood display="1"  height="55" width="420"/>	
</hgroup>
<hollywood display="2"  height="155" width="220"/>
</vgroup> 

</window>
</application>
And here is the Hollywood script which generates the error. I tried wihtout RappaGUI with conventional displays. That did work.

Code: Select all

@REQUIRE "RapaGUI"
@FONT 1,"Arial",32
UseFont(1)
SetFontColor(#RED)

Function EventFunktion(msg)
Switch msg.action

					
Case "RapaGUI"

   Switch msg.attribute
     
  
      Case "Selected":
	 Switch msg.id	
	 Case "menaboutrapagui":
	    moai.DoMethod("app", "aboutrapagui")
	 Case "menquit":
	    End
       EndSwitch
   										    
     EndSwitch
    EndSwitch
EndFunction
		
InstallEventHandler({RapaGUI = EventFunktion})
moai.CreateApp(FileToString("NewGUI2.xml"))
Print("Hello")

SelectDisplay(2)
Print("Hello2")	
	
Repeat
CheckEvent()	
Forever
Thanks for your attention.
Lars

Re: Multiple Displays

Posted: Wed Sep 11, 2019 11:05 am
by Clyde
Yes, that is possible. I remember that I had problems, too. Try to use the numbers 1 and 3 or 2 and 3.

Re: Multiple Displays

Posted: Wed Sep 11, 2019 11:24 am
by jPV
LarsB wrote: Tue Sep 10, 2019 6:12 pm is it possible to have more than one display with RappaGUI in a window?
Yes.
I am getting an error that "Error in line 31 (DispTest.hws): Could not find display 2!"
I can't see that you'd created the display 2 there in your example code (.hws), that's why you can't select it. By default Hollywood creates one display and its ID is 1. If you want more displays, then you have to create them yourself by using @DISPLAY or CreateDisplay(). RapaGUI XML only tells which display it should use, but doesn't create them for you.

Re: Multiple Displays

Posted: Wed Sep 11, 2019 12:36 pm
by LarsB
Ahh, ... thought it was my mistake. I was confused because on one hand you can set attributes to some degree i.e. width and hight. So I thought the command to create the display was done by the xml and passthough to Hollywood. Which after all is not logic. But..dont search for logic when you enter the chambers of the human heart ;) Anyway...thank you very much for looking at the code. It is really inspiring here. :) Thanx!