| Itcl  | Itk  | Itcl @ Wiki  | Itcl @ SF  | Tcl  | Tcl @ Wiki |
  home || iwidgets || man pages cross ref distribution docs faq  
buttonbox
calendar
canvasprintbox
canvasprintdialog
checkbox
combobox
dateentry
datefield
dialog
dialogshell
disjointlistbox
entryfield
extbutton
extfileselectionbox
extfileselectiondialog
feedback
fileselectionbox
fileselectiondialog
finddialog
hierarchy
hyperhelp
labeledframe
labeledwidget
mainwindow
menubar
messagebox
messagedialog
notebook
optionmenu
panedwindow
promptdialog
pushbutton
radiobox
regexpfield
scrolledcanvas
scrolledframe
scrolledhtml
scrolledlistbox
scrolledtext
scrolledwidget
selectionbox
selectiondialog
shell
spindate
spinint
spinner
spintime
tabnotebook
tabset
timeentry
timefield
toolbar
watch

man page | options | methods

Mainwindow

The mainwindow iwidget can be used as an interface to an application (i.e. text or drawing editor). It includes some of the most popular widgets that are found on most application interfaces. The iwidget comes with the following widgets: menubar, toolbar, mousebar (vertical toolbar), messagedialog, 2 labels, and a childsite. The chidlsite allows the programmer to customize the interface to their specific needs; such as adding a scrolledtext or a scrolledcanvas. The following public methods are used to allow the programmer to manipulate the interface: menubar, mousebar, msgd, and toolbar. The programmer can use these public methods to manipulate each of the components. However, the programmer will need to know how each of the components work in order to manipulate them affectively. For further information, see the Mainwindow manpage

Components: help hull menubar mousebar msgd status toolbar
				

wm title . "Menubar Example"

##	
##	This is the image directory in the demos directory
##
set imagedir [file join ${iwidgets::library} demos images]

##=========================================================
##	Create a mainwindow iwidget
##=========================================================
##
iwidgets::mainwindow .mw \
  -title "Mainwindow Example" \
  -helpline 1 \
  -statusline 1


##
##	Add some menu items via the menubar 
##	public method
##
foreach m {file edit view} {

  .mw menubar add menubutton $m \
    -text [string totitle $m] \
	-underline 0 
}


##
##	Add some toolbar items via the
##	toolbar public method
##
foreach t {open close clear copy cut paste} {

  .mw toolbar add button $t \
    -balloonstr "This is the balloon string for [string totitle $t]" \
    -image [image create photo -file [file join $imagedir $t.gif]] \
	-command [list puts "$t selected"] \
	-helpstr "This is the help string for [string totitle $t]"
	  
}

##
##	Add some mousebar items via the 
##	mousebar public method
##
foreach m {save find print help exit} {

  .mw mousebar add button $m \
   	-balloonstr "This is the balloon string for [string totitle $m]" \
	-image [image create photo -file [file join $imagedir $m.gif]] \
	-command [list puts "$m selected"] \
	-helpstr "This is the help string for [string totitle $m]"

}

##
##	Create a scrolledtext iwidget to place in
##	the childsite
##
set cs [.mw childsite]
iwidgets::scrolledtext $cs.st
$cs.st import [file join / usr local tcl8.3.3 README]

pack $cs.st \
  -fill both \
  -expand true

update idletasks
.mw activate

Download this sample code
man page | options | methods
 
  home || iwidgets || man pages cross ref distribution docs faq  
Copyright | Contributions | Development Team | Credits
Bugs/Comments/Suggestions about this web site