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
}
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
}