AddPage method

Discuss GUI programming with the MUI Royale plugin here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

AddPage method

Post by djrikki »

Image

Snippet:

Code: Select all

    Local xml$
    
	xml$ = "<vgroup id=\"MENU2tab\" title=\"\33A[12] MENU2\">"
	xml$ = xml$ .. "<listtree id=\"MENU2\" notify=\"active;doubleclick\" cyclechain=\"1\" weight=\"250\" dragdropsort=\"True\">"
	xml$ = xml$ .. "</listtree>"
	xml$ = xml$ .. "</vgroup>"
	         	
	;Create new Menu and attach        
    mui.CreateObject(xml$)
    mui.DoMethod("menu-pages","AddPage","MENU2tab")
If I use \33A within the Title attribute I end up with the above screenshot, if I instead use \27A the Page doesn't create at all. Any thoughts?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: AddPage method

Post by djrikki »

Code: Select all

    mui.CreateObject([[<vgroup id="MENU2tab" title="\33A[12] MENU2">
	<listtree id="MENU2" notify="active;doubleclick" cyclechain="1" weight="250" dragdropsort="True">
	</listtree>
	</vgroup>]])
Alternatively, if I do the above instead, the icon appears as intended. Strange.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: AddPage method

Post by airsoftsoftwair »

This behaviour is normal. Quote:
Formatting codes always start with an escape character followed by a sequence of characters that describe the formatting code. In decimal notation the escape character equals ASCII code 27, which is 33 in octal and $1B in hexadecimal notation. Care has to be taken when using formatting codes because usage is different between XML files and Hollywood source files. In XML files the octal notation is used, i.e. you start an escape sequence using a backslash and the octal number 33 ('\33'). In Hollywood source codes, however, octal numbers are not supported after a backslash. Hollywood always expects the ASCII code in decimal notation after a backslash. That is why you have to use '\27' to initiate an escape sequence from Hollywood code.
Source: http://www.hollywood-mal.com/docs/html/ ... rmat_.html
Post Reply