1pod::Prima::Menu(3) User Contributed Perl Documentation pod::Prima::Menu(3)
2
3
4
6 Prima::Menu - pull-down and pop-up menu objects
7
9 use Prima;
10 use Prima::Application;
11
12 my $window = Prima::Window-> new(
13 menuItems => [
14 [ '~File' => [
15 [ '~Open', 'Ctrl+O', '^O', \&open_file ],
16 [ '-save_file', '~Save', km::Ctrl | ord('s'), sub { save_file() } ],
17 [],
18 [ '~Exit', 'Alt+X', '@X', sub { exit } ],
19 ]],
20 [ '~Options' => [
21 [ '*option1' => 'Checkable option' => sub { $_[0]-> menu-> toggle( $_[1]) }],
22 [ '*@option2' => 'Checkable option' => sub {}], # same
23 ]],
24 [],
25 [ '~Help' => [
26 [ 'Show help' => sub { $::application-> open_help("file://$0"); }],
27 ]],
28 ],
29 );
30
31 sub open_file
32 {
33 # enable 'save' menu item
34 $window-> menu-> save_file-> enable;
35 }
36
37 $window-> popupItems( $window-> menuItems);
38
40 The document describes interfaces of Prima::AbstractMenu class, and its
41 three descendants - Prima::Menu, Prima::Popup, and Prima::AccelTable,
42 all aimed at different targets. Prima::AbstractMenu is a descendant of
43 Prima::Component class, and its specialization is handling of menu
44 items, held in a tree-like structure. Descendants of
45 Prima::AbstractMenu are designed to be attached to widgets and windows,
46 to serve as hints for the system-dependent pop-up and pull-down menus.
47
49 Menu items
50 The central point of functionality in Prima::AbstractMenu-derived
51 classes and their object instances ( further referred as 'menu classes'
52 and 'menu objects'), is handling of a complex structure, contained in
53 "::items" property. This property is special in that its structure is a
54 tree-like array of scalars, each of whose is either a description of a
55 menu item or a reference to an array.
56
57 Parameters of an array must follow a special syntax, so the property
58 input can be parsed and assigned correctly. In general, the syntax is
59
60 $menu-> items( [
61 [ menu item description ],
62 [ menu item description ],
63 ...
64 ]);
65
66 where 'menu item description' is an array of scalars, that can hold
67 from 0 up to 6 elements. Each menu item has six fields, that qualify a
68 full description of a menu item; the shorter arrays are shortcuts, that
69 imply default or special cases. These base six fields are:
70
71 Menu item name
72 A string identifier. Menu items can be accessed individually by
73 their names, and the following fields can be managed by calling
74 elemental properties, that require an item name. If not given, or
75 empty, item name is assigned a string in a form '#ID' where ID is
76 the unique integer value within the menu object.
77
78 IDs are set for each menu item, disregarding whether they have
79 names or not. Any menu item can be uniquely identifed by its ID
80 value, by supplying the '#ID' string, in the same fashion as named
81 menu items. When creating or copying menu items, names in format
82 '#ID' are not accepted, and treated as if an empty string is
83 passed. When copying menu items to another menu object, all menu
84 items to be copied change their IDs, but explicitly set names are
85 preserved. Since the anonymous menu items do not have name, their
86 auto-generated names change also.
87
88 If the name is prepended by special characters ( see below ), these
89 characters are not treated as part of the name but as an item
90 modifier. This syntax is valid only for "::items" and "insert()"
91 functions, not for "set_variable()" method.
92
93 "-" - item is disabled
94 "*" - item is checked
95 "@" - item is using auto-toggling
96 "?" - item is customly drawn
97 Expects "onMeasure" and "onPaint" callbacks in "options"
98
99 "(" and ")" - radio group
100 Items marked with parentheses are treated as a part of a group,
101 where only a single item can be checked. Checking and
102 unchecking happens automatically.
103
104 A group is only valid for the same level where it was opened on
105 (i.e. submenus don't inherit it). A group is automatically
106 terminated on a separator item. If that is not desired, mark it
107 as "(" too (consequent "(" are allowed):
108
109 [ '(one' ... ]
110 [ 'two' ... ]
111 [ '(' ],
112 [ ')last' ... ]
113
114 When user hits an already checked item, nothing happens.
115 However, when combined with auto-toggling (i.e. marked with
116 "(@"), a checked item becomes unchecked, thus the group can
117 present a state where no items are checked, too.
118
119 See also: "group"
120
121 Menu text / menu image
122 A non-separator menu item can be visualized either as a text string
123 or an image. These options are exclusive to each other, and
124 therefore occupy same field. Menu text is an arbitrary string, with
125 with ~ ( tilde ) quoting for a shortcut character, that the system
126 uses as a hot key during menu navigation. Menu image is a
127 Prima::Image object of no particular color space and dimensions.
128
129 Note: tilde-marked character is also used in navigation for custom
130 drawn menu items, even though they not necessarily draw the text
131 itself.
132
133 Menu text in menu item is accessible via the "::text" property, and
134 menu image via the "::image" property. These can not accept or
135 return sensible arguments simultaneously.
136
137 Accelerator text
138 An alternate text string, appearing together with a menu item or a
139 menu image, usually serving as a description to the hot key,
140 associated with a menu item. For example, if a hot key to a menu
141 item is combination of 'enter' and 'control' keys, then usually
142 accelerator text is 'Ctrl+Enter' string.
143
144 Accelerator text in menu item is accessible via "::accel" property.
145
146 NB: There is "Prima::KeySelector::describe" function, that converts
147 a key value to a string in human-readable format.
148
149 Hot key
150 An integer value, combined from either "kb::XXX" constant or a
151 character index with modificator key values ( "km::XXX" constant ).
152 This representation format is not that informative as three-integer
153 key event format (CODE,KEY,MOD), described in Prima::Widget.
154 However, these formats are easily converted to each other:
155 CODE,KEY,MOD is translated to INTEGER format by "translate_key()"
156 method. The reverse operation is not needed for
157 "Prima::AbstractMenu" functionality and is performed by
158 "Prima::KeySelector::translate_codes" method.
159
160 The integer value can be given in a some more readable format when
161 submitting to "::items". Character and F-keys (from F1 to F16) can
162 be used literally, without "kb::" prepending, and the modificator
163 keys can be hinted as prefix characters: km::Shift as '#', km::Ctrl
164 as '^' and km::Alt as '@'. This way, combination of 'control' and
165 'G' keys can be expressed as '^G' literal, and
166 'control'+'shift'+'F10' - as '^#F10'.
167
168 Hot key in menu item is accessible via "::key" property. The
169 property does accept literal key format, described above.
170
171 A literal key string can be converted to an integer value by
172 "translate_shortcut" method.
173
174 When the user presses the key combination, that matches to hot key
175 entry in a menu item, its action is triggered.
176
177 Action
178 Every non-separator and non-submenu item is destined to perform an
179 action. The action can be set either as an anonymous sub, or as
180 string with name of a method on the owner of a menu object. Both
181 have their niche of usage, and both are supplied with three
182 parameters, when called - the owner of a menu object, the name of a
183 menu item, that triggered the action, and the menu checked status:
184
185 Prima::MainWindow-> new(
186 menuItems => [
187 ['@item', 'Test',
188 sub {
189 my (
190 $window, # MainWindow
191 $item, # 'item'
192 $checked # MainWindow->men('item')->checked
193 ) = @_;
194 }],
195 ]
196 );
197
198 Action scalar in menu item is accessible via "::action" property.
199
200 A special built-in action can automatically toggle a menu item,
201 instead of an explicit call
202
203 $window->menu->toggle($item)
204
205 To achieve this, add '@' character to the menu item name (see "Menu
206 item name").
207
208 Options
209 At last, non-separator menu items can hold an extra hash in
210 "options" property. The toolkit reserves the following keys for
211 internal use:
212
213 group INTEGER
214 Same as "group" property.
215
216 icon HANDLE
217 Uses to replace default check mark bitmap on a menu item
218
219 onMeasure MENUITEM, REF
220 Required when custom painting is set. It is called when system
221 needs to query menu item dimensions. "REF" is a 2-item arrayref
222 that needs to be set with pixel dimension.
223
224 onPaint MENUITEM, CANVAS, SELECTED, X1, Y1, X2, Y2
225 Required when custom painting is set. It is called whenever
226 system needs to draw a menu item. X1 - Y2 are coordinates of
227 the rectangle where the drawing is allowed.
228
229 Syntax of "::items" does not provide 'disabled' and 'checked' states
230 for a menu item as separate fields. These states can be set by using
231 '-' and '*' prefix characters, as described above, in "Menu item name".
232 They also can be assigned on per-item basis via "::enabled" and
233 "::checked" properties.
234
235 All these fields qualify a most common menu item, that has text,
236 shortcut key and an action - a 'text item'. However, there are also
237 two other types of menu items - a sub-menu and separator. The type of a
238 menu items can not be changed except by full menu item tree change
239 functions ( "::items", "remove()", "insert()".
240
241 Sub-menu item can hold same references as text menu item does, except
242 the action field. Instead, the action field is used for a sub-menu
243 reference scalar, pointing to another set of menu item description
244 arrays. From that point of view, syntax of "::items" can be more
245 elaborated and shown as
246
247 $menu-> items( [
248 [ text menu item description ],
249 [ sub-menu item description [
250
251 [ text menu item description ],
252 [ sub-menu item description [
253 [ text menu item description ],
254 ...
255 ]
256 [ text menu item description ],
257 ...
258 ] ],
259 ...
260 ]);
261
262 Separator items do not hold any fields, except name. Their purpose is
263 to hint a logical division of menu items by the system, which
264 visualizes them usually as non-selectable horizontal lines.
265
266 In menu bars, the first separator item met by parser is treated
267 differently. It serves as a hint, that the following items must be
268 shown in the right corner of a menu bar, contrary to the left-adjacent
269 default layout. Subsequent separator items in a menu bar declaration
270 can be either shown as a vertical division bars, or ignored.
271
272 With these menu items types and fields, it is possible to construct the
273 described above menu description arrays. An item description array can
274 hold from 0 to 6 scalars, and each combination is treated differently.
275
276 six - [ NAME, TEXT/IMAGE, ACCEL, KEY, ACTION/SUBMENU, DATA ]
277 Six-scalar array is a fully qualified text-item description. All
278 fields correspond to the described above scalars.
279
280 five [ NAME, TEXT/IMAGE, ACCEL, KEY, ACTION/SUBMENU ]
281 Same as six-scalar syntax, but without DATA field. If DATA is
282 skipped it is "undef" by default.
283
284 four [ TEXT/IMAGE, ACCEL, KEY, ACTION/SUBMENU ] or [ NAME, TEXT/IMAGE,
285 ACTION/SUBMENU, DATA ]
286 One of two, depending whether last item is a hashref or not.
287
288 If not, same as five-scalar syntax, but without NAME field. When
289 NAME is skipped it is assigned to an unique string within menu
290 object.
291
292 Otherwise same as three-scalar plus DATA hashref.
293
294 three [ NAME, TEXT/IMAGE, ACTION/SUBMENU ] or [ TEXT/IMAGE,
295 ACTION/SUBMENU, DATA ]
296 One of two, depending whether last item is a hashref or not.
297
298 In not, same as five-scalar syntax, but without ACCEL and KEY
299 fields. KEY is "kb::NoKey" by default, so no keyboard combination
300 is bound to the item. Default ACCEL value is an empty string.
301
302 Otherwise same as two-scalar plus DATA hashref.
303
304 two [ TEXT/IMAGE, ACTION/SUBMENU ] or [ NAME, DATA ]
305 One of two, depending whether last item is a hashref or not.
306
307 If not, same as three-scalar syntax, but without NAME field.
308
309 Otherwise name with data reference. Useful for custom menu items
310 that need at least the '?' flag in the NAME.
311
312 one and zero [ ]
313 Both empty and 1-scalar arrays indicate a separator menu item. In
314 case of 1-scalar syntax, the scalar value is ignored.
315
316 As an example of all above said, a real-life piece of code is
317 exemplified:
318
319 $img = Prima::Image-> create( ... );
320 ...
321 $menu-> items( [
322 [ "~File" => [
323 [ "Anonymous" => "Ctrl+D" => '^d' => sub { print "sub\n";}], # anonymous sub
324 [ $img => sub {
325 my $img = $_[0]-> menu-> image( $_[1]);
326 my @r = @{$img-> palette};
327 $img-> palette( [reverse @r]);
328 $_[0]->menu->image( $_[1], $img);
329 }], # image
330 [], # division line
331 [ "E~xit" => "Exit" ] # calling named function of menu owner
332 ]],
333 [ ef => "~Edit" => [ # example of system commands usage
334 ...
335 [ "Pa~ste" => sub { $_[0]->foc_action('paste')} ],
336 ...
337 ["~Duplicate menu"=>sub{ TestWindow->create( menu=>$_[0]->menu)}],
338 ]],
339 ...
340 [], # divisor in main menu opens
341 [ "~Clusters" => [ # right-adjacent part
342 [ "*".checker => "Checking Item" => "Check" ],
343 [],
344 [ "-".slave => "Disabled state" => "PrintText"],
345 ...
346 ]]
347 ] );
348
349 The code is stripped from 'menu.pl' from 'examples' directory in the
350 toolkit installation. The reader is advised to run the example and
351 learn the menu mechanics.
352
353 Prima::MenuItem
354 As described above, text and sub-menu items can be managed by elemental
355 properties - "::accel", "::text", "::image", "::checked", "::enabled",
356 "::action", "::data". All these, plus some other methods can be called
357 in an alternative way, resembling name-based component calls of
358 Prima::Object. A code
359
360 $menu-> checked('CheckerMenuItem', 1);
361
362 can be re-written as
363
364 $menu-> CheckerMenuItem-> checked(1);
365
366 Name-based call substitutes Prima::MenuItem object, created on the fly.
367 Prima::MenuItem class shares same functions of Prima::AbstractMenu,
368 that handle individual menu items.
369
370 Prima::Menu
371 Objects, derived from Prima::Menu class are used to tandem
372 Prima::Window objects, and their items to be shown as menu bar on top
373 of the window.
374
375 Prima::Menu is special in that its top-level items visualized
376 horizontally, and in behavior of the top-level separator items ( see
377 above, "Menu items" ).
378
379 If "::selected" is set to 1, then a menu object is visualized in a
380 window, otherwise it is not. This behavior allows window to host
381 multiple menu objects without clashing. When a Prima::Menu object gets
382 'selected', it displaces the previous 'selected' menu Prima::Menu
383 object, and its items are installed into the visible menu bar.
384 Prima::Window property "::menu" then points to the menu object, and
385 "::menuItems" is an alias for "::items" menu class property.
386 Prima::Window's properties "::menuFont" and "::menuColorIndex" are used
387 as visualization hints.
388
389 Prima::Menu provide no new methods or properties.
390
391 Prima::Popup
392 Objects, derived from Prima::Popup class are used together with
393 Prima::Widget objects. Menu items are visualized when the user pressed
394 the pop-up key or mouse buttons combination, in response to
395 Prima::Widget's "Popup" notification.
396
397 If "::selected" is set to 1, then a menu object is visualized in the
398 system pop-up menu, otherwise it is not. This behavior allows widget
399 to host multiple menu objects without clashing. When a Prima::Popup
400 object gets 'selected', it displaces the previous 'selected' menu
401 Prima::Popup object. Prima::Widget property "::popup" then points to
402 the menu object, and "::popupItems" is an alias for "::items" menu
403 class property. Prima::Widget's properties "::popupFont" and
404 "::popupColorIndex" are used as visualization hints.
405
406 A Prima::Popup object can be visualized explicitly, by means of "popup"
407 method. The implicit visualization by the user is happened only if the
408 "::autoPopup" property is set to 1.
409
410 Prima::Popup provides new "popup" method and new "::autoPopup"
411 property.
412
413 Prima::AccelTable
414 This class is destined for a more limited functionality than
415 Prima::Menu and Prima::Popup, primarily for mapping key strokes to
416 predefined actions. Prima::AccelTable objects are never visualized,
417 and consume no system resources, although full menu item management
418 syntax is supported.
419
420 If "::selected" is set to 1, then it displaces the previous 'selected'
421 menu Prima::AccelTable object. Prima::Widget property "::accelTable"
422 then points to the menu object, and "::accelItems" is an alias for
423 "::items" menu class property.
424
425 Prima::AccelTable provide no new methods or properties.
426
428 Properties
429 accel NAME, STRING / Prima::MenuItem::accel STRING
430 Manages accelerator text for a menu item. NAME is name of the menu
431 item.
432
433 action NAME, SCALAR / Prima::MenuItem::action SCALAR.
434 Manages action for a menu item. NAME is name of the menu item.
435 SCALAR can be either an anonymous sub or a method name, defined in
436 the menu object owner's name space. Both called with three
437 parameters - the owner of a menu object, the menu object itself and
438 the name of the menu item.
439
440 autoPopup BOOLEAN
441 Only in Prima::Popup
442
443 If set to 1 in selected state, calls "popup()" action in response
444 to "Popup" notification, when the user presses the default key or
445 mouse button combination.
446
447 If 0, the pop-up menu can not be executed implicitly.
448
449 Default value: 1
450
451 autoToggle NAME, SCALAR / Prima::MenuItem::autoToggle SCALAR.
452 Manages autoToggle flag for a menu item. When set, "checked" option
453 is flipped when user selects the item. Also, un the unchecked state
454 the system displays an empty check box icon where normally a check
455 icon would appear, to hint the user that an item is a toggle,
456 despite being unchecked.
457
458 checked NAME, BOOLEAN / Prima::MenuItem::checked BOOLEAN
459 Manages 'checked' state of a menu item. If 'checked', a menu item
460 visualized with a distinct check-mark near the menu item text or
461 image. Its usage with sub-menu items is possible, although
462 discouraged.
463
464 NAME is name of the menu item.
465
466 data NAME, SCALAR / Prima::MenuItem::data SCALAR
467 Manages the user data scalar.
468
469 NAME is name of the menu item. SCALAR can be any scalar value, the
470 toolkit does not use this property internally.
471
472 enabled NAME, BOOLEAN / Prima::MenuItem::enabled BOOLEAN
473 Manages 'enabled' state of a menu item. If 'enabled' is
474 "me::Grayed", a menu item visualized with grayed or otherwise
475 dimmed color palette. If "me::Passive", then the item is still
476 disabled, but not grayed. If a sub-menu item is disabled, whole
477 sub-menu is inaccessible.
478
479 Default: "me::Enabled"
480
481 NAME is name of the menu item.
482
483 group NAME, INTEGER / Prima::MenuItem::group INTEGER
484 If not 0, treated as a member of radio group with that number when
485 checked. I.e. if one of the group is checked, others are
486 unchecked.
487
488 image NAME, OBJECT / Prima::MenuItem::image OBJECT
489 Manages the image, bound with a menu item. OBJECT is a non-null
490 Prima::Image object reference, with no particular color space or
491 dimensions ( because of dimensions, its usage in top-level
492 Prima::Menu items is discouraged ).
493
494 "::image" and "::text" are mutually exclusive menu item properties,
495 and can not be set together, but a menu item can change between
496 image and text representation at run time by calling these
497 properties.
498
499 NAME is name of the menu item.
500
501 items SCALAR
502 Manages the whole menu items tree. SCALAR is a multi-level
503 anonymous array structure, with syntax described in "Menu items".
504
505 "::items" is an ultimate tool for reading and writing the menu
506 items tree, but often it is too powerful, so there are elemental
507 properties "::accel", "::text", "::image", "::checked",
508 "::enabled", "::action", "::data" declared, that handle menu items
509 individually.
510
511 key NAME, KEY / Prima::MenuItem::key KEY
512 Manages the hot key combination, bound with a menu item.
513 Internally KEY is kept as an integer value, and get-mode call
514 returns integers only, but set-mode accepts the literal key format
515 - like, '^C', 'F5' strings.
516
517 NAME is name of the menu item, KEY is an integer value.
518
519 selected BOOLEAN
520 If set to 1, menu object is granted extra functionality from a
521 window or widget owner object. Different Prima::AbstractMenu
522 descendant provided with different extra functionalities. In Usage
523 section, see Prima::Menu, Prima::Popup and Prima::AccelTable.
524
525 Within each menu class, only one menu object can be selected for
526 its owner.
527
528 If set to 0, the only actions performed are implicit hot-key lookup
529 when on "KeyDown" event.
530
531 Default value: 1
532
533 submenu NAME, ARRAY / Prima::MenuItem::submeny ARRAY
534 Manages submenu, if present on the item. On reading, is equivalent
535 to "get_items(NAME, 1)". On writing, removes all items under NAME
536 and inserts new ones.
537
538 See also: is_submenu.
539
540 text NAME, STRING / Prima::MenuItem::text STRING
541 Manages the text, bound with a menu item. STRING is an arbitrary
542 string, with '~' ( tilde ) quotation of a hot key character. The
543 hot key character is only used when keyboard navigation of a pop-up
544 or a pull-down menu is performed; it has no influence outside menu
545 sessions.
546
547 "::text" and "::image" are mutually exclusive menu item properties,
548 and can not be set together, but a menu item can change between
549 image and text representation at run time by calling these
550 properties.
551
552 Methods
553 check NAME / Prima::MenuItem::check
554 Alias for checked(1). Sets menu item in checked state.
555
556 disable NAME / Prima::MenuItem::disable
557 Alias for "enabled(me::Grayed)". Sets menu item in disabled state.
558
559 enabled NAME / Prima::MenuItem::enabled
560 Alias for "enabled(me::Enabled)". Sets menu item in enabled state.
561
562 execute NAME
563 Calls the action associated with the menu item
564
565 find_item_by_key KEY
566 Finds items by the associated hot key combination
567
568 get_handle
569 Returns a system-dependent menu handle.
570
571 NB: Prima::AccelTable use no system resources, and this method
572 returns its object handle instead.
573
574 get_children NAME
575 Returns list of NAME's children
576
577 get_item NAME, FULL_TREE = 0
578 Returns items entry corresponding to NAME, with or without eventual
579 full tree of children items, depending on FULL_TREE flag.
580
581 get_item NAMES, FULL_TREE = 0
582 Returns immediate children items entries that have NAME as a
583 parent, with or without eventual full tree of children items,
584 depending on FULL_TREE flag.
585
586 has_item NAME
587 Returns boolean value, whether the menu object has a menu item with
588 name NAME.
589
590 insert ITEMS, ROOT_NAME, INDEX
591 Inserts menu item inside existing item tree. ITEMS has same syntax
592 as "::items". ROOT_NAME is the name of a menu item, where the
593 insertion must take place; if ROOT_NAME is an empty string, the
594 insertion is performed to the top level items. INDEX is an offset,
595 which the newly inserted items would possess after the insertion.
596 INDEX 0 indicates the beginning, thus.
597
598 Returns no value.
599
600 is_separator NAME
601 Returns true if the item is a separator, false otherwise
602
603 is_submenu NAME
604 Returns true if the item has submenu, false otherwise
605
606 popup X_OFFSET, Y_OFFSET, [ LEFT = 0, BOTTOM = 0, RIGHT = 0, TOP = 0 ]
607 Only in Prima::Popup
608
609 Executes the system-driven pop-up menu, in location near
610 (X_OFFSET,Y_OFFSET) pixel on the screen, with items from "::items"
611 tree. The pop-up menu is hinted to be positioned so that the
612 rectangle, defined by (LEFT,BOTTOM) - (RIGHT,TOP) coordinates is
613 not covered by the first-level menu. This is useful when a pop-up
614 menu is triggered by a button widget, for example.
615
616 If during the execution the user selects a menu item, then its
617 associated action is executed ( see "action" ).
618
619 The method returns immediately and returns no value.
620
621 remove NAME / Prima::MenuItem::remove
622 Deletes a menu item from the items tree, and its sub-menus if the
623 item is a sub-menu item.
624
625 select
626 Alias for selected(1). Sets menu object in selected state.
627
628 set_variable NAME, NEW_NAME
629 Changes the name of a menu item with NAME to NEW_NAME. NEW_NAME
630 must not be an empty string and must not be in a '#integer' form.
631
632 toggle NAME / Prima::MenuItem::toggle
633 Toggles the checked state of a menu item and returns the new state.
634
635 translate_accel TEXT
636 Locates a '~' ( tilde ) - escaped character in a TEXT string and
637 returns its index ( as ord(lc())), or 0 if no escaped characters
638 were found.
639
640 The method can be called with no object.
641
642 translate_key CODE, KEY, MOD
643 Translates three-integer key representation into the one-integer
644 format and returns the integer value. The three-integer format is
645 used in "KeyDown" and "KeyUp" notifications for Prima::Widget.
646
647 See Prima::Widget
648
649 The method can be called with no object.
650
651 translate_shortcut KEY
652 Converts literal-represented KEY string into the integer format and
653 returns the integer value.
654
655 The method can be called with no object.
656
657 uncheck NAME / Prima::MenuItem::uncheck
658 Alias for checked(0). Sets menu item in unchecked state.
659
660 Events
661 Change ACTION [, NAME [, VALUE ]]
662 Triggered when structure of the menu tree is changed. ACTION is the
663 method call that triggered that action, and NAME is the menu item
664 namem, when applicable. If empty string, means root. VALUE is the
665 new value, if applicable.
666
667 ItemMeasure ITEMID, REF
668 Called when system needs to query dimensions of a menu item that
669 has custom painting bit set. "REF" is a 2-item arrayref that needs
670 to be set with pixel dimension.
671
672 See also: Options
673
674 ItemPaint CANVAS, ITEMID, SELECTED, X1, Y1, X2, Y2
675 Called whenever system needs to draw a menu item that has custom
676 painting bit set. X1 - Y2 are coordinates of the rectangle where
677 the drawing is allowed.
678
679 See also: Options
680
682 Menu colors and fonts don't work on Windows and probably never will.
683
685 Dmitry Karasik, <dmitry@karasik.eu.org>.
686
688 Prima, Prima::Object, Prima::Widget, Prima::Window
689
690
691
692perl v5.32.0 2020-07-28 pod::Prima::Menu(3)