Multiple Displays

Discuss GUI programming with the RapaGUI plugin here
Post Reply
LarsB
Posts: 72
Joined: Sat May 06, 2017 4:37 pm

Multiple Displays

Post 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
User avatar
Clyde
Posts: 349
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: Multiple Displays

Post 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.
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Multiple Displays

Post 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.
LarsB
Posts: 72
Joined: Sat May 06, 2017 4:37 pm

Re: Multiple Displays

Post 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!
Post Reply