Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tk_dialog Box

Status
Not open for further replies.

mistkhan

Technical User
May 31, 2003
14
0
0
IN
Hi All

I am new to Tcl/Tk. I am developing a GUI using TCL/TK. I am creating a File menu , on selecting a file menu , I wanted to display a dialog box. This dialog box should have an combo box and three buttons.

Actually I have developed this requirement on a toplevel window. I dont want use this , since the toplevel window , gives the option of maximize, minimize.

Below is the code developed on a toplevel window, is it possible to have the same feature in tk_dialog box.

Can anybody help me in this regard

Thanking you in advance
Regards
Aman


proc selectdevice {w} {

toplevel $w.top
iwidgets::combobox $w.top.cb -labeltext "Select Device" -selectioncommand {
puts "selected: [$w.top.cb getcurselection]"
}
$w.top.cb insert list end 0 1 2 3 4
$w.top.cb selection set 0
pack $w.top.cb -side left -padx 2 -pady 2

button $w.top.b -text {SELECT DEVICE}
button $w.top.b1 -text {OK}
button $w.top.b2 -text {CANCEL} -command [list destroy $w.top]


pack $w.top.b -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -fill x
pack $w.top.b1 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -fill x
pack $w.top.b2 -side top -padx 6 -pady 6 -ipadx 2 -ipady 2 -fill x


wm title $w.top "Select Device"
wm maxsize $w.top 325 120
positionWindow $w.top


focus $w.top
grab -global $w.top
tkwait window $w.top
}
 
The tk_dialog command is implemented in the file dialog.tcl of the lib/Tk directory.
You can duplicate it and then enhance it.

HTH

ulis
 
Hi All

I have an basic question , what is Bwidget, Iwidget, how is it different from normal Tcl/Tk coding. Can we use these Bwidgets or Iwidget in our normal tcl coding?.

Thanking you in advance
Regards
Aman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top