mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 16:46:52 +08:00
More doco updates.
All of the core widgets now consistently set changed() before calling the callback function for a change in value; this allows programs to check the changed() state in a callback to see why they are being called (STR #475) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+27
-13
@@ -127,16 +127,28 @@ char* shortcut, Fl_Callback*, void *user_data=0, int flags=0)</a><br>
|
||||
int Fl_Menu_::add(const char* label, int shortcut, Fl_Callback*,
|
||||
void *user_data=0, int flags=0)</h4>
|
||||
|
||||
Adds a new menu item, with a <TT>title</TT> string, <TT> shortcut</TT>
|
||||
string, <TT>callback</TT>, argument to the callback, and flags. If
|
||||
the menu array was directly set with menu(x) then copy() is done to
|
||||
make a private array.
|
||||
<p>Adds a new menu item, with a <TT>title</TT> string, <TT>
|
||||
shortcut</TT> string, <TT>callback</TT>, argument to the
|
||||
callback, and flags. If the menu array was directly set with
|
||||
<tt>menu(x)</tt> then <tt>copy()</tt> is done to make a private
|
||||
array.
|
||||
|
||||
<P>Text is a string of the form "foo/bar/baz", this example
|
||||
will result in a submenu called "foo" and one in that called
|
||||
"bar" and and entry called "baz". The text is
|
||||
copied to new memory and can be freed. The other arguments (including
|
||||
the shortcut) are copied into the menu item unchanged. </P>
|
||||
<p>The characters "&", "/", "\", and "_" are treated as
|
||||
special characters in the label string. The "&" character
|
||||
specifies that the following character is an accelerator and
|
||||
will be underlined. The "\" character is used to escape the next
|
||||
character in the string. Labels starting with the "_" character
|
||||
cause a divider to be placed before that menu item.</p>
|
||||
|
||||
<p>A label of the form "foo/bar/baz" will create a
|
||||
submenus called "foo" and "bar" with an
|
||||
entry called "baz". The "/" character is ignored if it
|
||||
appears as the first character of the label string, e.g.
|
||||
"/foo/bar/baz".</p>
|
||||
|
||||
<p>The label string is copied to new memory and can be freed.
|
||||
The other arguments (including the shortcut) are copied into the
|
||||
menu item unchanged. </P>
|
||||
|
||||
<P>If an item exists already with that name then it is replaced with
|
||||
this new one. Otherwise this new one is added to the end of the
|
||||
@@ -166,10 +178,12 @@ Text shortcuts are converted to integer shortcut by calling
|
||||
|
||||
<h4>int Fl_Menu_::add(const char *)</H4>
|
||||
|
||||
<P>The passed string is split at any '|' characters and then <TT>
|
||||
add(s,0,0,0,0)</TT> is done with each section. This is often useful
|
||||
if you are just using the value, and is compatable with Forms
|
||||
and other GL programs. </P>
|
||||
<P>The passed string is split at any '|' characters and then
|
||||
<TT>add(s,0,0,0,0)</TT> is done with each section. This is
|
||||
often useful if you are just using the value, and is compatible
|
||||
with Forms and other GL programs. The section strings use the
|
||||
same special characters as described for the long version of <a
|
||||
href='#Fl_Menu_.add'><tt>add()</tt></a></p>
|
||||
|
||||
<H4><A name=Fl_Menu_.replace>void Fl_Menu_::replace(int n, const char *)</A>
|
||||
</H4>
|
||||
|
||||
Reference in New Issue
Block a user