GUI structure¶
- 
structure 
GUI¶ This object is created with the
GUI(width,height)function.A GUI object is a kind of
Boxthat is the outermost window that holds all the other widgets. In order to work at all, all widgets must be put inside of aGUIbox, or in inside of anotherBoxwhich in turn is inside aGUIbox, etc.(To get rid of all GUIs that you created from this CPU, you can use the
CLEARGUISbuilt-in-function, which is a shorthand for callingWidget:HIDEandWidget:DISPOSEon each of them.)Suffix Type Description Every suffix of BOX. Note, to add widgets to this window, see the BOX suffixes.Xscalar(pixels)X-position of the window. Negative values measure from the right. Yscalar(pixels)Y-position of the window. Negative values measure from the bottom. DRAGGABLEBooleanTrue = user can move window. EXTRADELAYscalar(seconds)Add artificial delay to all communication with this GUI (good for testing before you get into deep space) SKINSkinThe skin defining the default style of widgets in this GUI. SHOWnone Call to make the gui appear HIDEnone Call to make the gui disappear - 
GUI:
X¶ Type: scalarAccess: Get/Set This is the X position of upper-left corner of window, in pixels.
You can alter this value to move the window.
If you use a negative value for the coordinate, then the coordiante will be measured in the reverse direction, from the right edge of the screen. (i.e. setting it to -200 means 200 pixels away from the right edge of the screen.)
- 
GUI:
Y¶ Type: scalarAccess: Get/Set This is the Y position of upper-left corner of window, in pixels.
You can alter this value to move the window.
If you use a negative value for the coordinate, then the coordiante will be measured in the reverse direction, from the bottom edge of the screen. (i.e. setting it to -200 means 200 pixels away from the bottom edge of the screen.)
- 
GUI:
DRAGGABLE¶ Type: BooleanAccess: Get/Set Set to true to allow the window to be moved by the user dragging it. If set to false, it can still be moved by the script setting
GUI:XandGUI:Y, but can’t be moved by the user.
- 
GUI:
EXTRADELAY¶ Type: scalarAccess: Get/Set This is the number of extra seconds of delay to add to the GUI for testing purposes.
If Remote Tech is installed, the GUI system obeys the signal delay of the Remote Tech mod such that when you click a widget it can take time before the script notices you did so. If you want to test how your GUI will work under a signal delay you can use this suffix to force a simulated additional signal delay even if you are not using RemoteTech. (Or when you are using RemoteTech but are testing your GUI in situations where there isn’t a noticable signal delay, like in Kerbin low orbit).
- 
GUI:
SKIN¶ Type: SkinAccess: Get/Set A
Skinis a collection ofStyleobjects to be used by different types of widgets within the GUI window. With this suffix you can assign a different Skin to the window, which will then be used by default by all the widgets of the appropriate type inside the window.
- 
GUI:
SHOW()¶ Synopsis:
set g to gui(200). // .. call G:addbutton, G:addslider, etc etc here g:show().
Call this suffix to make the GUI appear. (Note this is really just
Widget:Showbut it’s mentioned again here because it’s vital when making a GUI to know that it won’t show up if you don’t call this.)
- 
GUI:
HIDE()¶ Synopsis:
set g to gui(200). // .. call G:addbutton, G:addslider, etc etc here g:show(). wait until done. // whatever you decide "done" is. g:hide().
Call this suffix to make the GUI disappear. (Note this is really just
Widget:Showbut it’s mentioned again here.)
- 
GUI: