As with the other builtins in this module, this builtin is only useful on
Apple systems.
On non-Apple systems, this function always returns
NULL
except when no argruments are provided, then it always returns a zero
int
value.
The following describes the behavior of this builtin on Apple systems and
references menuitems on the Apple system menubar.
With no arguments, it always return a non-zero
int
value.
With a single argument, the return value depends on the case-insensitive value of
name.
When
name
is either
about
or
preferences,
an
int
is returned that is either zero (FALSE) or non-zero (TRUE) and indicates
whether the referenced menuitem is present.
When
name
is
mouselocation,
then a
Point
is returned that gives the current mouse location on the
screen in terms of 72 dots per inch.
When two arguments are present and the second is a
String,
then
name
can have one of the two case-insensitve values
about
or
preferences
and
cmd
can have one of the two case-insensitve values
enabled
or
remove.
When
cmd
is
enabled,
an
int
is returned that is either zero (FALSE) or non-zero (TRUE) and indicates
whether the referenced menuitem is enabled.
When
cmd
is
enabled,
NULL
is returned and the referenced menuitem, if present, is removed.
When two arguments are present and the second is an
int,
then
name
can have one of the two case-insensitve values
about
or
preferences
and
state
indicate whether the referenced menuitem should be enabled (non-zero) or
disabled (zero).
A
NULL
is always returned in this case.
When two arguments are present and the second is a
Callable,
then
name
can have one of the seven case-insensitve values
about,
openapplication,
openfile,
preferences,
printfile,
quit,
or
reopenapplication.
A
NULL
is always returned in this case.
The
handler
will be called whenever the named request needs to be handled.
It should only take one argument, which will be an
InvocationEvent.
The
InvocationEvent
contains a field called
handled
that should be set to a non-zero value by the handler when it wants to indicate
to the system that the default
system handler for the action should not also be invoked.
|