::AddCheckButtonToActionFrame
This command adds a button to the specified frame. The button is a “sticky” button, that is it stays pressed when it is first pressed remains that way until it is pressed again. Normally it is used to add “Back” and “Next” buttons to the buttons frame of the wizard dialog, but can be used to add any button which can perform any task to any frame.
Syntax
::model::mdlWizardDlg::AddCheckButtonToActionFrame frame button position text callback
Application
MotionView Tcl GUI
Description
This command adds a button to the specified frame. The button is a “sticky” button, that is it stays pressed when it is first pressed remains that way until it is pressed again. Normally it is used to add “Back” and “Next” buttons to the buttons frame of the wizard dialog, but can be used to add any button which can perform any task to any frame.
Inputs
- frame
- The full path to the action frame of the wizard dialog. This path is usually returned by the ::model::mdlWizardDlg::GetButtonFrame procedure.
- button
- The name that will be used for the button widget being added.
- position
- This position is the “column” that the button is to be added in the specified frame.
- text
- The text that is to be displayed by the check button in the specified frame.
- callback
- The procedure that is to be executed when this check button is clicked.
- variable
- A variable that is used to hold the value of the check button that is being added to the specified frame.
Example
namespace eval ::my_wizard {
variable p_dlg ""
variable demo_val 0
}
proc ::my_wizard::Run {} {
set mangle [::model::GetMangle my_wizard_Run]
variable p_dlg
set p_dlg [::model::mdlWizardDlg wiz$mangle -width 700 -height 300 \
-title "My Wizard" -showExport false -callback "::my_wizard::OnClose"]
set frm [::model::mdlWizardDlg::GetButtonFrame $p_dlg]
::model::mdlWizardDlg::AddCheckButtonToActionFrame $frm btnDemo 5 "Demo" ::my_wizard::OnDemo ::my_wizard::demo_val
::model::mdlWizardDlg::SetCloseButtonText "Finish"
::model::mdlWizardDlg::ShowDialog
}
proc ::my_wizard::OnDemo { args } {
if { $::my_wizard::demo_val } {
tk_messageBox -message "Demo mode is ON"
} else {
tk_messageBox -message "Demo mode is OFF"
}
}
proc ::my_wizard::OnClose { args } {
variable p_dlg
hwt::UnpostWindow $p_dlg
return 1
}
::my_wizard::Run
Errors
None.