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 provides 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 set, a menu
474 item visualized with grayed or otherwise dimmed color palette. If a
475 sub-menu item is disabled, whole sub-menu is inaccessible.
476
477 Default: true
478
479 NAME is name of the menu item.
480
481 group NAME, INTEGER / Prima::MenuItem::group INTEGER
482 If not 0, treated as a member of radio group with that number when
483 checked. I.e. if one of the group is checked, others are
484 unchecked.
485
486 image NAME, OBJECT / Prima::MenuItem::image OBJECT
487 Manages the image, bound with a menu item. OBJECT is a non-null
488 Prima::Image object reference, with no particular color space or
489 dimensions ( because of dimensions, its usage in top-level
490 Prima::Menu items is discouraged ).
491
492 "::image" and "::text" are mutually exclusive menu item properties,
493 and can not be set together, but a menu item can change between
494 image and text representation at run time by calling these
495 properties.
496
497 NAME is name of the menu item.
498
499 items SCALAR
500 Manages the whole menu items tree. SCALAR is a multi-level
501 anonymous array structure, with syntax described in "Menu items".
502
503 "::items" is an ultimate tool for reading and writing the menu
504 items tree, but often it is too powerful, so there are elemental
505 properties "::accel", "::text", "::image", "::checked",
506 "::enabled", "::action", "::data" declared, that handle menu items
507 individually.
508
509 key NAME, KEY / Prima::MenuItem::key KEY
510 Manages the hot key combination, bound with a menu item.
511 Internally KEY is kept as an integer value, and get-mode call
512 returns integers only, but set-mode accepts the literal key format
513 - like, '^C', 'F5' strings.
514
515 NAME is name of the menu item, KEY is an integer value.
516
517 selected BOOLEAN
518 If set to 1, menu object is granted extra functionality from a
519 window or widget owner object. Different Prima::AbstractMenu
520 descendant provided with different extra functionalities. In Usage
521 section, see Prima::Menu, Prima::Popup and Prima::AccelTable.
522
523 Within each menu class, only one menu object can be selected for
524 its owner.
525
526 If set to 0, the only actions performed are implicit hot-key lookup
527 when on "KeyDown" event.
528
529 Default value: 1
530
531 submenu NAME, ARRAY / Prima::MenuItem::submeny ARRAY
532 Manages submenu, if present on the item. On reading, is equivalent
533 to "get_items(NAME, 1)". On writing, removes all items under NAME
534 and inserts new ones.
535
536 See also: is_submenu.
537
538 text NAME, STRING / Prima::MenuItem::text STRING
539 Manages the text, bound with a menu item. STRING is an arbitrary
540 string, with '~' ( tilde ) quotation of a hot key character. The
541 hot key character is only used when keyboard navigation of a pop-up
542 or a pull-down menu is performed; it has no influence outside menu
543 sessions.
544
545 "::text" and "::image" are mutually exclusive menu item properties,
546 and can not be set together, but a menu item can change between
547 image and text representation at run time by calling these
548 properties.
549
550 Methods
551 check NAME / Prima::MenuItem::check
552 Alias for checked(1). Sets menu item in checked state.
553
554 disable NAME / Prima::MenuItem::disable
555 Alias for enabled(0). Sets menu item in disabled state.
556
557 enabled NAME / Prima::MenuItem::enabled
558 Alias for enabled(1). Sets menu item in enabled state.
559
560 execute NAME
561 Calls the action associated with the menu item
562
563 find_item_by_key KEY
564 Finds items by the associated hot key combination
565
566 get_handle
567 Returns a system-dependent menu handle.
568
569 NB: Prima::AccelTable use no system resources, and this method
570 returns its object handle instead.
571
572 get_children NAME
573 Returns list of NAME's children
574
575 get_item NAME, FULL_TREE = 0
576 Returns items entry corresponding to NAME, with or without eventual
577 full tree of children items, depending on FULL_TREE flag.
578
579 get_item NAMES, FULL_TREE = 0
580 Returns immediate children items entries that have NAME as a
581 parent, with or without eventual full tree of children items,
582 depending on FULL_TREE flag.
583
584 has_item NAME
585 Returns boolean value, whether the menu object has a menu item with
586 name NAME.
587
588 insert ITEMS, ROOT_NAME, INDEX
589 Inserts menu item inside existing item tree. ITEMS has same syntax
590 as "::items". ROOT_NAME is the name of a menu item, where the
591 insertion must take place; if ROOT_NAME is an empty string, the
592 insertion is performed to the top level items. INDEX is an offset,
593 which the newly inserted items would possess after the insertion.
594 INDEX 0 indicates the beginning, thus.
595
596 Returns no value.
597
598 is_separator NAME
599 Returns true if the item is a separator, false otherwise
600
601 is_submenu NAME
602 Returns true if the item has submenu, false otherwise
603
604 popup X_OFFSET, Y_OFFSET, [ LEFT = 0, BOTTOM = 0, RIGHT = 0, TOP = 0 ]
605 Only in Prima::Popup
606
607 Executes the system-driven pop-up menu, in location near
608 (X_OFFSET,Y_OFFSET) pixel on the screen, with items from "::items"
609 tree. The pop-up menu is hinted to be positioned so that the
610 rectangle, defined by (LEFT,BOTTOM) - (RIGHT,TOP) coordinates is
611 not covered by the first-level menu. This is useful when a pop-up
612 menu is triggered by a button widget, for example.
613
614 If during the execution the user selects a menu item, then its
615 associated action is executed ( see "action" ).
616
617 The method returns immediately and returns no value.
618
619 remove NAME / Prima::MenuItem::remove
620 Deletes a menu item from the items tree, and its sub-menus if the
621 item is a sub-menu item.
622
623 select
624 Alias for selected(1). Sets menu object in selected state.
625
626 set_variable NAME, NEW_NAME
627 Changes the name of a menu item with NAME to NEW_NAME. NEW_NAME
628 must not be an empty string and must not be in a '#integer' form.
629
630 toggle NAME / Prima::MenuItem::toggle
631 Toggles the checked state of a menu item and returns the new state.
632
633 translate_accel TEXT
634 Locates a '~' ( tilde ) - escaped character in a TEXT string and
635 returns its index ( as ord(lc())), or 0 if no escaped characters
636 were found.
637
638 The method can be called with no object.
639
640 translate_key CODE, KEY, MOD
641 Translates three-integer key representation into the one-integer
642 format and returns the integer value. The three-integer format is
643 used in "KeyDown" and "KeyUp" notifications for Prima::Widget.
644
645 See Prima::Widget
646
647 The method can be called with no object.
648
649 translate_shortcut KEY
650 Converts literal-represented KEY string into the integer format and
651 returns the integer value.
652
653 The method can be called with no object.
654
655 uncheck NAME / Prima::MenuItem::uncheck
656 Alias for checked(0). Sets menu item in unchecked state.
657
658 Events
659 Change ACTION [, NAME [, VALUE ]]
660 Triggered when structure of the menu tree is changed. ACTION is the
661 method call that triggered that action, and NAME is the menu item
662 namem, when applicable. If empty string, means root. VALUE is the
663 new value, if applicable.
664
665 ItemMeasure ITEMID, REF
666 Called when system needs to query dimensions of a menu item that
667 has custom painting bit set. "REF" is a 2-item arrayref that needs
668 to be set with pixel dimension.
669
670 See also: Options
671
672 ItemPaint CANVAS, ITEMID, SELECTED, X1, Y1, X2, Y2
673 Called whenever system needs to draw a menu item that has custom
674 painting bit set. X1 - Y2 are coordinates of the rectangle where
675 the drawing is allowed.
676
677 See also: Options
678
680 Menu colors and fonts don't work on Windows and probably never will.
681
683 Dmitry Karasik, <dmitry@karasik.eu.org>.
684
686 Prima, Prima::Object, Prima::Widget, Prima::Window
687
688
689
690perl v5.36.0 2022-07-22 pod::Prima::Menu(3)