Creating and Destroying GUI Objects

GUI objects are created just like Gsharp graphics object, with the create command. Since GUI objects do not have any required resources, all GUI classes can be created without specifying any resources, that is, using entirely default values. For example:

create Menubar gsharp_1.menubar; 

Resources can also be set with the create command as explained in Setting GUI Object Resources.

GUI objects can only be destroyed with the destroy command. The reset command does not effect GUI objects. Normally, the application does not need to destroy the GUI since this is done automatically when Gsharp terminates. However it can be useful when you are developing an application, particularly if you are creating objects from the Gsharp command line, to destroy unwanted GUI objects created for test purposes. Here is an example of destroying a GUI object:

destroy gsharp_1.menubar.menu_1; 

Destroying a parent object causes all of its children to be destroyed.

Carry on to Setting GUI Object Resources