20,741
edits
m (→GUI Widgets) |
|||
Line 22: | Line 22: | ||
Ideally, people would be able to create custom widgets in Nasal. For example a button, then put it in $FG_ROOT/Nasal/widgets/button.nas - so that such custom widgets would be available to the GUI subsystem by specifying: | Ideally, people would be able to create custom widgets in Nasal. For example a button, then put it in $FG_ROOT/Nasal/widgets/button.nas - so that such custom widgets would be available to the GUI subsystem by specifying: | ||
* type=canvas | |||
* widget-type=button (i.e. button.nas - button namespace, for which the method new() is invoked) | |||
The GUI subsystem would then check if a PUI widget is a canvas, and if it is, it would call the corresponding Nasal constructor - i.e. globals["widgets"].button.new() | The GUI subsystem would then check if a PUI widget is a canvas, and if it is, it would call the corresponding Nasal constructor - i.e. globals["widgets"].button.new() |