The searchentry widget
In Brief
The scopebutton provides functionality as described in Apple's Human Interface Guidelines: "The scope button is used in a scope bar to specify the scope of an operation, such as search."
The button can be used to filter or sort values in a data display such as a listbox.
Commands
::tclmacbag::scopebutton pathName ?Options?
Required options:
-
-text Text
The string to display in the button.
- -value Value_String
The value to store in the associated -variable when the widget is selected.
This option sets the value of the button's corresponding variable.
-
-variable Global_Variable
The name of a global variable whose value is linked to the widget.
This option sets the variable that will be updated when a specific radiobutton is picked.
-
-command Command_Name
The name of a Tcl script or procedure that fires when the button is clicked. Developers can define commands to sort or filter data, such as in a listbox.
Example
grid [::tclmacbag::scopebuttonbutton .b1 -text "Test1" -value 1 \
-variable scopetext -command [list puts $scopetext]]
grid [::tclmacbag::scopebuttonbutton .b2 -text "Test2" -value 2 \
-variable scopetext -command [list puts $scopetext]]
Further Information
Per Apple's guidelines, this button should not appear in a toolbar at the top of the window or in a status bar/frame at the bottom of the window. It should appear in an interior frame/widget in the window adjacent to a data display that it will manipulate.
This widget cannot/should not be set to disabled and does not allow a programmer selectable image.
As is standard, this widget returns with value of pathName, for ease of use with geometry managers like grid and pack.
This widget was contributed by Kevin Walzer and was first introduced in TclMacBag v0.17.