Page 1 of 1
AddPage method
Posted: Sun Dec 28, 2014 12:44 pm
by djrikki
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?
Re: AddPage method
Posted: Sun Dec 28, 2014 12:49 pm
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.
Re: AddPage method
Posted: Mon Dec 29, 2014 11:21 pm
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