{"size": 2119, "ext": "scrbl", "max_stars_repo_path": "gui-doc/scribblings/gui/menu-item-container-intf.scrbl", "max_stars_repo_name": "jjsimpso/gui", "max_stars_repo_stars_event_min_datetime": "2015-03-17T22:11:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-12T15:09:34.000Z", "max_issues_repo_path": "gui-doc/scribblings/gui/menu-item-container-intf.scrbl", "max_issues_repo_name": "jjsimpso/gui", "max_issues_repo_issues_event_min_datetime": "2015-01-09T15:53:25.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T16:21:29.000Z", "max_forks_repo_path": "gui-doc/scribblings/gui/menu-item-container-intf.scrbl", "max_forks_repo_name": "jjsimpso/gui", "max_forks_repo_forks_event_min_datetime": "2015-01-08T13:03:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T21:49:09.000Z"}
{"max_stars_count": 65, "max_issues_count": 231, "max_forks_count": 89, "avg_line_length": 37.1754385965, "max_line_length": 80, "alphanum_fraction": 0.7413874469}
#lang scribble/doc
@(require "common.rkt")

@definterface/title[menu-item-container<%> ()]{

A @racket[menu-item-container<%>] object is a @racket[menu%],
 @racket[popup-menu%], or @racket[menu-bar%].


@defmethod[(get-items)
           (listof (is-a?/c menu-item<%>))]{
Returns a list of the items in the menu, popup menu, or menu bar. The
 order of the items in the returned list corresponds to the order as
 the user sees them in the menu or menu bar.

}


@defmethod[(on-demand)
           void?]{
@methspec{

Called when the user clicks on the container as a menu bar (before the
 user sees any menu items, except with Unity's global menu bar as
 noted below), just before the container as a popup menu
 is popped up, or just before inspecting the menu bar containing the
 item for a shortcut key binding.

If the container is not a @tech{menu bar} or a @tech{popup menu}, this method is
 normally called via the @method[menu-item-container<%> on-demand]
 method of the container's owning menu bar or popup menu, because the
 default implementation of the method chains to the
 @method[labelled-menu-item<%> on-demand] method of its
 items. However, the method can be overridden in a container such that
 it does not call the @method[labelled-menu-item<%> on-demand] method
 of its items.

On Unix with the Unity window manager using the global menu bar (which
 is the default on Ubuntu), @racket[racket/gui/base] receives no
 notification when the user clicks the menu bar. To approximate
 @method[menu-item-container<%> on-demand] triggered by user clicks of
 the menu bar, @method[menu-item-container<%> on-demand] is called for
 a @tech{menu bar} whenever its @racket[frame%] object loses the
 keyboard focus. Beware that if keyboard focus was lost because a menu
 was clicked, then items added to the clicked menu during an
 @method[menu-item-container<%> on-demand] invocation may not appear
 for the user.

}
@methimpl{

Calls the @racket[demand-callback] procedure that was provided when
 the object was created, then calls the @method[labelled-menu-item<%>
 on-demand] method of the contained items.

}}}
