1tixPopupMenu(n) Tix Built-In Commands tixPopupMenu(n)
2
3
4
6 tixPopupMenu - Create and manipulate tixPopupMenu widgets
7
9 tixPopupMenu pathName ?options?
10
12 The tixPopupMenu class is derived from the TixShell class and inherits
13 all the commands, options and subwidgets of its super-class.
14
16 The PopupMenu widget supports all the standard options of a frame wid‐
17 get. See the options(n) manual entry for details on the standard
18 options.
19
21 [-buttons buttons] A Tcl list that specifies the mouse button(s) and
22 key modifier(s) that bring up the popup menu. Each element of this list
23 is in turn a list that contains two elements: the first element is an
24 integer that indicates the mouse button that brings up the popup menu;
25 the second element specifies the key modifiers that should be used in
26 conjunction with the mouse button. For example, the value {{1 {Control
27 Meta}} {3 {Any}}} specifies that the popup menu can be popped up by (a)
28 pressing mouse button 1 with either the Control or the Meta key or (b)
29 pressing mouse button 3 with any key modifier. The default value is {{3
30 {Any}}}: only mouse button 3 brings up the popup menu.
31 [-postcmd postCmd] Specifies a command to be evaluated just before the
32 menu is about to pop-up. This command is called with two default argu‐
33 ments: the root x-y coordinates where the user has pressed the mouse
34 button. This command must return a boolean value: a false indicates
35 that the menu shouldn't be popped up at this point; a true indicates
36 that the menu should be popped up. This option can be used to find out
37 where the user has pressed the mouse-button and optionally disable the
38 popup menu over certain screen areas. [-spring spring] When set to
39 true, the menu will be automatically popped down if the user releases
40 the mouse button outside of the menu and no menu commands will be
41 invoked. This makes it easy for the user to cancel the popup menu with‐
42 out pressing the Escape key. The default value is true. [-state state]
43 Must be either disabled or normal. The PopupMenu widget will not pop up
44 unless its -state is set to normal. [-title title] Specifies a text
45 string to display inside the menubutton subwidget, as the title of this
46 PopupMenu.
47
49 Name: menu
50 Class: Menu
51
52 The menu subwidget.
53
54 Name: menubutton
55 Class: Menubutton
56
57 The menubutton subwidget.
58
60 The tixPopupMenu command creates a new window (given by the pathName
61 argument) and makes it into a PopupMenu widget. Additional options,
62 described above, may be specified on the command line or in the option
63 database to configure aspects of the PopupMenu widget such as its cur‐
64 sor and relief.
65
66 The Tix PopupMenu widget can be used as a replacement of the tk_popup
67 command. The advantage of the Tix PopupMenu widget is it requires less
68 application code to manipulate. Also, it provides a title for the popup
69 menu, which is not available from tk_popup.
70
72 The tixPopupMenu command creates a new Tcl command whose name is the
73 same as the path name of the PopupMenu widget's window. This command
74 may be used to invoke various operations on the widget. It has the fol‐
75 lowing general form:
76 pathName option ?arg arg ...?
77 PathName is the name of the command, which is the same as the PopupMenu
78 widget's path name. Option and the args determine the exact behavior of
79 the command. The following commands are possible for PopupMenu widgets:
80
81 pathName bind widget ?widget ...?
82 Binds this PopupMenu to one or more widgets. The PopupMenu will
83 be activated when the user presses the right mouse button over
84 these widgets.
85
86 pathName cget option
87 Returns the current value of the configuration option given by
88 option. Option may have any of the values accepted by the tix‐
89 PopupMenu command.
90
91 pathName configure ?option? ?value option value ...?
92 Query or modify the configuration options of the widget. If no
93 option is specified, returns a list describing all of the avail‐
94 able options for pathName (see Tk_ConfigureInfo for information
95 on the format of this list). If option is specified with no
96 value, then the command returns a list describing the one named
97 option (this list will be identical to the corresponding sublist
98 of the value returned if no option is specified). If one or
99 more option-value pairs are specified, then the command modifies
100 the given widget option(s) to have the given value(s); in this
101 case the command returns an empty string. Option may have any
102 of the values accepted by the tixPopupMenu command.
103
104 pathName post widget x y
105 Posts the PopupMenu inside the widget at the coordinate x,y.
106
107 pathName unbind widget ?widget ...?
108 Cancels the PopupMenu's binding with the widget(s).
109
110 pathName subwidget name ?args?
111 When no options are given, this command returns the pathname of
112 the subwidget of the specified name.
113
114 When options are given, the widget command of the specified sub‐
115 widget will be called with these options.
116
118 Tix(n)
119
120
121
122
123
124
125Tix 4.0 tixPopupMenu(n)