next up previous contents
Next: Conclusions Up: Graphical widgets Previous: The simulationclock widget

The query widget

The query widget can be used when user-input is required. Its interface :

   interface query : public screen
     query(char* p,char* options = "");
     query(widget* w,char* p,char* options = "");
     virtual ~query();
     char* get();         // returns NULL or value
fig 6.5. The interface of the query widget

The following options can be handled :

The query consists of a string that appears at the head of the query and which can be set by specifying the -text option. The additional input entry can be activated by clicking on it. You can then enter a value which is set when clicking on the ok button. This value is then returned by the get method. The general use of the query widget is create and pack the widget and stay in a while-loop until the get method returns a value not equal to NULL (i.e. when a value was entered and the ok button was pressed).

A Eliens
Tue Oct 31 09:27:21 MET 1995