MUI open full resolution screen
Posted: Wed May 27, 2015 11:49 am
Hi,
Just another snippet I use sometimes.
It opens a window at the same size as the resolution of the screen.
and here is the XML file,
This only works if you load in an XML file, you can not put the xml in your HWS program.
Cheers
Leo
Just another snippet I use sometimes.
It opens a window at the same size as the resolution of the screen.
Code: Select all
@VERSION 5,2
@REQUIRE "MUIRoyale"
@APPTITLE "Max screen"
@APPVERSION "$VER: 1.0 (01.03.15)"
@APPCOPYRIGHT "©2015, George Leo den Hollander"
@APPAUTHOR "Leo den Hollander"
@APPDESCRIPTION "Open big window"
@DISPLAY {Hidden = True}
Function p_MUIEvent(id) ; * Joint event handler for MUI buttons and menus ***********************************
Switch id
Case "Quit":
End
EndSwitch
EndFunction
Function p_EventFunc(msg)
Switch msg.action
Case "MUIRoyale":
Switch msg.attribute
Case "CloseRequest":
End
Case "Pressed":
p_MUIEvent(msg.id)
Endswitch
Case "HideWindow":
MUI.Set("app", "iconified", True)
Case "ShowWindow":
MUI.Set("app", "iconified", False)
EndSwitch
EndFunction
DTW = getattribute(#Display,0,#AttrMaxWidth)
DTH = getattribute(#Display,0,#AttrMaxHeight)
xml$ = ReplaceStr(FileToString("blank.xml"), "%DTW", DTW)
xml$ = ReplaceStr(xml$, "%DTH", DTH)
mui.CreateGui([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app" base="Blank">
]] .. xml$ .. "</application>")
; listen to these events!
InstallEventHandler({MUIRoyale = p_EventFunc, HideWindow = p_EventFunc, ShowWindow = p_EventFunc})
; main loop!
Repeat
WaitEvent
Forever
Code: Select all
<window title=" Program Name Here" id="window" width="%DTW" height="%DTH" notify="closerequest" >
<vgroup background="pre_ShadowFill">
<vgroup>
<Button id="Quit" notify="pressed" >Quit</Button>
<rectangle/>
</vgroup>
</vgroup>
</window>
Cheers
Leo