[HOME][CONTENTS][DOWNLOAD][PREV][NEXT]


COMB WIDGET EXAMPLES

Frame Container. A frame container (frm) is a comb-widget that is used as a container. It provides a labeled frame to host various widgets of a graphic user interface. A significant difference between a container widget and regular widget is that a special procedure should be used in deleting an item from a container. 

EXAMPLE: The following example creates a text widget within a frm widget. 

catch "destroy .frm
toplevel .frm
wm title .frm "frm widget"
set frm .frm.f
set frm [frm.create $frm -label {-text Frame} -pad {-bd 10}]
set text [frm.add $frm -text text {-wrap word}]
pack $text -expand 1 -fill both
pack $frm -expand 1 -fill both
$text insert insert {\
This is a text widget within a frm widget. 
It is created with the following scripts:

      set frm [frm.create .frm -label {-text Frame} -pad {-bd 10}]
      set text [frm.add $frm -text text {-wrap word}]
      pack $text -expand 1 -fill both
      pack $frm -exapnd 1 -fill both} 

A frm containing a text widget. 

CLASS NAME: frm

COMB-WIDGET OPTIONS

-label options It specifies options for a sub-widget of Label to display a text label at the top of the frame. 
-frm options It specifies options for a sub-widget of Frame to display a decorate frame. 
-pad options It specifies optionsfor a sub-widget of Frame to display an internal frame for additional internal padding. An option -bd is usually used to define the internal pad size. The default is 4. 
User-defined options: an option may be defined by a user after a widget is added into a frame widget. 
WIDGET API
frm.create pathname ?options? This command creates a frm widget with specified options. It returns the pathname of the frm widget. 
frm.add pathname -varName creator ?options? This command adds a sub-widget into a frm widget. The -varName specifies an ID of the sub-widget. The creator specifies a widget creation command such as canvas, text, etc. The ?options? specifies a list of options for the sub-widget. 
frm.delete pathname -varName This command deletes a sub-widget refered to by an ID -varName from a frm widget refered to by pathname. An item in a frm container should be deleted with this procedure. 
frm.cget pathname -varName This command is a wrap up of comb.cget for the frm widget. 
frm.config pathname ?options? This command is a wrap up of comb.config for the frm widget. 
RELATED PROCEDURES

The followings are procedures used in frm widget implementation and test. A user may access to these procedures through the frm widget API, and should never use these procedures directly in an application program. 

frm.free pathname.
frm.test pathname

[HOME][CONTENTS][DOWNLOAD] 1