IUP
view release on metacpan or search on metacpan
lib/IUP/Menu.pod view on Meta::CPAN
B<child:> (named parameter) List of the references to elements (or just a single element) that
will be grouped by the menu.
B<Returns:> the identifier of the created element, or C<undef> if an error occurs.
NOTE: You can pass to C<new()> other C<ATTRIBUTE=E<gt>'value'> or C<CALLBACKNAME=E<gt>\&func> pairs relevant
to this element - see L<IUP::Manual::02_Elements|IUP::Manual::02_Elements/"new()">.
=head2 ATTRIBUTES
For more info about concept of attributes (setting/getting values etc.)
see L<IUP::Manual::03_Attributes|IUP::Manual::03_Attributes>. Attributes specific to this element:
=over
=item L<BGCOLOR|IUP::Manual::03_Attributes/BGCOLOR>
The background color of the menu, affects all items in the menu.
=item B<RADIO>
I<(non inheritable)> Enables the automatic toggle of one
child item. When a child item is selected the other item is
automatically deselected. The menu acts like a L<IUP::Radio|IUP::Radio> for its
children. Submenus and their children are not affected.
=item L<WID|IUP::Manual::03_Attributes/WID>
I<(non inheritable)> In Windows, returns the HMENU of the menu.
=back
=head2 CALLBACKS
For more info about concept of callbacks (setting callback handlers etc.)
see L<IUP::Manual::04_Callbacks|IUP::Manual::04_Callbacks>. Callbacks specific to this element:
=over
=item L<OPEN_CB|IUP::Manual::04_Callbacks/OPEN_CB>
Called just before the menu is opened.
=item L<MENUCLOSE_CB|IUP::Manual::04_Callbacks/MENUCLOSE_CB>
Called just after the menu is closed.
=back
The following L<common callbacks|IUP::Manual::04_Callbacks/Common Callbacks> are also accepted:
=over
=item L<MAP_CB|IUP::Manual::04_Callbacks/MAP_CB>, L<UNMAP_CB|IUP::Manual::04_Callbacks/UNMAP_CB>
=back
=head1 NOTES
A menu can be a menu bar of a dialog, defined by the dialog's MENU
attribute, or a popup menu.
A popup menu is displayed for the user using the L<Popup|IUP::Manual::02_Elements/"Popup()"> function
(usually on the mouse position) and disappears when an item is
selected.
L<Destroy|IUP::Manual::02_Elements/"Destroy()"> should be called only for popup menus. Menu bars
associated with dialogs are automatically destroyed when the dialog is
destroyed. But if you change the menu of a dialog for another menu, the
previous one should be destroyed using L<Destroy|IUP::Manual::02_Elements/"Destroy()">. If you replace a
menu bar of a dialog, the previous menu is unmapped.
Any item inside a menu bar can retrieve attributes from the dialog
using L<GetAttribute|IUP::Manual::02_Elements/"GetAttribute()">. It is not necessary to call L<GetDialog|IUP::Manual::02_Elements/"GetDialog()">.
The menu can be created with no elements and be dynamic filled using
L<Append|IUP::Manual::02_Elements/"Append()"> or L<Insert|IUP::Manual::02_Elements/"Insert()">.
=head1 EXAMPLES
The element B<IUP::Menu> is used in the following sample scripts:
=over
=item * L<0-basic/dialog2.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/dialog2.pl> - IUP::Dialog example
=item * L<0-basic/item.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/item.pl> - IUP::Item Example
=item * L<0-basic/layoutdialog.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/layoutdialog.pl> - IUP::LayoutDialog example
=item * L<0-basic/menu.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/menu.pl> - IUP::Menu example
=item * L<0-basic/separator.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/separator.pl> - IUP::Separator example
=item * L<0-basic/submenu.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/submenu.pl> - IUP::Submenu example
=item * L<0-basic/tray.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/0-basic/tray.pl> - IUP::Dialog + TRAY / TRAYTIP / TRAYIMAGE example
=item * L<1-apps/app-mdi.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/1-apps/app-mdi.pl> - IUP app example
=item * L<1-apps/app-sample1.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/1-apps/app-sample1.pl> - example used for screenshot - IUP.pod
=item * L<1-apps/app-sample2.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/1-apps/app-sample2.pl> - example based on the original sample.c
=item * L<1-apps/app-simple-demo.pl|https://metacpan.org/source/KMX/IUP-0.305/examples/1-apps/app-simple-demo.pl> - example used for screenshot - IUP.pod
=back
=head1 SEE ALSO
L<IUP::Dialog|IUP::Dialog>, L<IUP::Item|IUP::Item>,
L<IUP::Separator|IUP::Separator>, L<IUP::Submenu|IUP::Submenu>,
L<Popup|IUP::Manual::02_Elements/"Popup()">,
L<Destroy|IUP::Manual::02_Elements/"Destroy()">
The original doc: L<iupmenu.html|http://www.tecgraf.puc-rio.br/iup/en/elem/iupmenu.html>
=cut
( run in 0.836 second using v1.01-cache-2.11-cpan-364913b4093 )