CreateDisplay With NIL in MUIROYAL

Discuss GUI programming with the MUI Royale plugin here
Post Reply
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

CreateDisplay With NIL in MUIROYAL

Post by sinisrus »

Hello,

I have problem if i use CreateDisplay with NIL

Code: Select all

Test=CreateDisplay(NIL,{HIDDEN=True}) => MuiRoyal no work

Code: Select all

CreateDisplay(1,{HIDDEN=True}) => MuiRoyal Work
MuiRoyal work only if i use ID number

Is there a solution for that?

Thank you
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CreateDisplay With NIL in MUIROYAL

Post by airsoftsoftwair »

Works here. Please post a full test script, but make it as short as possible.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: CreateDisplay With NIL in MUIROYAL

Post by sinisrus »

Code: Select all

@DISPLAY 1, {Hidden=True,color=#WHITE}

test=CreateDisplay(NIL,{Hidden=True,color=#BLACK}) ; <==== I make display named "test"

/*************************************************************************/

Function  p_EventFunc(msg)
    Switch msg.action
    Case "MUIRoyale":
        Switch msg.attribute
        Case "CloseRequest":
            End
        EndSwitch

    Case "HideWindow":
        mui.Set("app", "iconified", True)

    Case "ShowWindow":
        mui.Set("app", "iconified", False)
    EndSwitch
EndFunction

/*************************************************************************/

; dynamically create MUI GUI from an external *.xml file definition
mui.CreateGUI([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app" base="NOUVEAU">
  <window id="win1" width="400" height="400" title="Nouveau" notify="closerequest">
  <vgroup>

<hollywood display="test" minwidth="32" minheight="32" maxwidth="600" maxheight="600"/>

  </vgroup> 
  </window>
</application>
]])

/*************************************************************************/
InstallEventHandler({MUIRoyale = p_EventFunc})
/*************************************************************************/ 

EscapeQuit(True)
/* Boucle infinie */
Repeat
        WaitEvent
Forever
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: CreateDisplay With NIL in MUIROYAL

Post by airsoftsoftwair »

That's a bug in your code. You cannot set Hollywood.Display to a string, but only to a numeric display identifier. The CreateDisplay() result "test" is neither a string nor a number, it is a special internal value that cannot be used from XML. Just do a

Code: Select all

DebugPrint(test)
and you will see this:

Code: Select all

UserData: .....
You have to use numeric identifier for Hollywood.Display.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: CreateDisplay With NIL in MUIROYAL

Post by sinisrus »

ok

thank you
Post Reply