::GetCurrentSelection

This command gets the text that is currently displayed in the mdlOption widget.

Syntax

::model::mdlOption::GetCurrentSelection path

Application

MotionView Tcl GUI

Description

This command gets the text that is currently displayed in the mdlOption widget.

Inputs

path
The full path of the mdlOption widget that this procedure is being called for.

Context

Example

To create a dialog that will contain an mdlOption widget and a button that will get the current displayed value of that mdlOption widget:
hwi GetSessionHandle sess1
sess1 GetProjectHandle pro1
sess1 ReleaseHandle
pro1 GetPageHandle pa1 [pro1 GetActivePage]
pro1 ReleaseHandle
pa1 GetWindowHandle win1 [pa1 GetActiveWindow]
pa1 ReleaseHandle
win1 GetClientHandle mcl
win1 ReleaseHandle
mcl GetRootObjectHandle mo
mcl ReleaseHandle

set tl [toplevel .top]
wm geometry $tl 500x100
wm title $tl "::model::mdlOption::GetCurrentSelection Example"
grid rowconfigure $tl 1 -weight 1
grid columnconfigure $tl 1 -weight 1

set opt [::model::mdlOption $tl.opt mo Op_Compliant]
grid $opt -row 0 -column 0 -sticky new

mo ReleaseHandle

set frm [frame $tl.frm]
grid rowconfigure $frm 0 -weight 1
grid columnconfigure $frm 1 -weight 1
grid $frm -row 1 -column 0 -sticky nesw -pady 5 -columnspan 2

set btn [button $frm.btn -text "Get Selection" -command ::getSelection]
grid $btn -row 0 -column 0

set lbl [label $frm.lbl -relief sunken]
grid $lbl -row 0 -column 1 -sticky nesw -padx 5

proc ::getSelection {} {
  .top.frm.lbl config -text [::model::mdlOption::GetCurrentSelection .top.opt]
}

Errors

None.