next up previous contents
Next: Queuing events Up: Hush classes Previous: The widget class

The toplevel widget

A widget can be packed to the display (successive packs result in a layer of widgets then), it can be embedded inside the screen widget or it can be made toplevel, which results in a stand-alone window for the widget. The histogram of the Dining Philosophers Problem could be made toplevel by giving a toplevel widget to its constructor.

 
  toplevel* t = new toplevel(".histogram");
  thinking = new histogram(t,".h","-title thinkingtime");
  thinking->pack();

The interface of the toplevel class :

 
  interface toplevel : public widget
  {
    toplevel(char* p,char* options = "");
    toplevel(widget* w,char* p,char* options = "");
  };



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