Solo: GUI SoloParamHandles

From Bcontrol
Revision as of 00:41, 18 March 2009 by CarlosBrody (talk | contribs) (Menus)

The main motivation for writing the Solo system was to assist in user interfaces; so in this section we now we finally get to the source of it all, the user interface!

Interactive graphics objects often have “callback” functions attached to them: when the user interacts in some way with the graphics object, the callback corresponding to it gets called. This allows for great flexibility (and we will talk much more about callbacks below), but quite often all one wants from the callback is to make the internal variable, corresponding to the GUI, have a value that matches whatever the user sets in the GUI. SoloParamHandles (following the functionality of Exper) do this automatically, so users don’t have to write callback functions for this.

There are a number of predefined graphics objects types in Solo, all of which share some optional parameters and settings. We’ll go through one of them in detail – the Menu type – and use it to illustrate some of the common parameters. After that we’ll go a little faster through the other types (Edit, Numedit, Toggle, Pushbutton, Header, and Subheader).


Ok, let’s start with the Menu example. We’ll open a new figure, and put a pop-up menu on it. There will be three possible items on the menu, which we’ll give the strings ‘blank’, ‘10’, and ‘20’.

  >> figure;
  >> SoloParamHandle(‘base’, ‘menuvar’, ‘type’, ‘menu’, ‘string’, …
     {‘blank’, ‘10’, ‘20’}, ‘value’, ‘10’, ‘label’, ‘menuvar’);

This will bring up the following picture in your figure:

Basic menu param.jpg