CreateDisplay With NIL in MUIROYAL

Discuss GUI programming with the MUI Royale plugin here

CreateDisplay With NIL in MUIROYAL

Postby sinisrus » Wed Jun 14, 2017 4:06 pm

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
sinisrus
 
Posts: 182
Joined: Tue Apr 21, 2015 5:43 pm

Re: CreateDisplay With NIL in MUIROYAL

Postby airsoftsoftwair » Fri Jun 16, 2017 11:10 am

Works here. Please post a full test script, but make it as short as possible.
User avatar
airsoftsoftwair
 
Posts: 2055
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: CreateDisplay With NIL in MUIROYAL

Postby sinisrus » Mon Jun 19, 2017 4:58 pm

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
sinisrus
 
Posts: 182
Joined: Tue Apr 21, 2015 5:43 pm

Re: CreateDisplay With NIL in MUIROYAL

Postby airsoftsoftwair » Tue Jun 20, 2017 6:39 pm

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.
User avatar
airsoftsoftwair
 
Posts: 2055
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany

Re: CreateDisplay With NIL in MUIROYAL

Postby sinisrus » Wed Jun 21, 2017 4:46 pm

ok

thank you
sinisrus
 
Posts: 182
Joined: Tue Apr 21, 2015 5:43 pm


Return to MUI Royale

Who is online

Users browsing this forum: No registered users and 1 guest