Contents | Index | < Browse | Browse >
CHANGEARG GuiFile GadID ArgumentNumber NewValue
This command enables you to dynamically change a GUI, by
changing the values of a gadget, while the program is running.
If you just want to change the size position or title, use
CHANGEGAD instead.
The gadget you want to change is specified with :
GuiFile - which is the GUI program file the gadget resides in.
GadID - which is the ID you have given to the gadget.
If you give a GadID of "0", it means the window itself.
All gadgets (and the window itself ie the WinBig command) have a
number of arguments, which are counted from left to right, starting
from 0.
A xBUTTON, for example, has the following arguments :
- xBUTTON Left Top Width Height Title Argument
- Number 0 1 2 3 4
So, if you wanted to change the width of a button :
> ChangeArg MyGui.gc 5 2 100
This would set the width of a button which has an ID of 5 and
resides in file "MyGui.gc", to 100 pixels wide.
This command has no immediate effect, unless and until the ReDraw
command is used. Then the window will be redrawn with this (and
any other gadgets you may have changed) redrawn to their new
dimensions and/or values.
Example : Run Gui Source
***** IMPORTANT ****
- Be very careful with changing string arguments, such as the
Title. Gui4Cli (for reasons best left untold), will only store
a string which is less than or equal to the length of the
existing string. So if you want to replace the title "My Button"
with "My Other Button" declare the title as "My Button ",
so the new title fits.
NOTE that if you want changing titles you should use the TITLE
Attribute which fits all gadgets and has no such restrictions.
- Fonts & Font sizes can not be changed (yet)
- Menus can NOT be changed.
- Icons must be changed with the ChangeIcon command.
- If the GuiFile or the GadID are not found, NOTHING will happen
and the user will NOT be told (unless in DEBUG mode).