summaryrefslogtreecommitdiff
path: root/FL/Fl_Tree.H
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
commitb4995f979d127cea667b4e2b71c91e9db4ab52ef (patch)
treefbebc775e10932bace8d6a7c3481b1ba200c64db /FL/Fl_Tree.H
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'FL/Fl_Tree.H')
-rw-r--r--FL/Fl_Tree.H11
1 files changed, 7 insertions, 4 deletions
diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H
index 3d85066e8..338fd4e5c 100644
--- a/FL/Fl_Tree.H
+++ b/FL/Fl_Tree.H
@@ -179,7 +179,8 @@
To find all the selected items:
\par
\code
- for ( Fl_Tree_Item *i=first_selected_item(); i; i=next_selected_item(i) )
+ Fl_Tree_Item *i;
+ for (i =first_selected_item(); i; i=next_selected_item(i) )
printf("Item %s is selected\n", i->label());
\endcode
\par
@@ -196,7 +197,8 @@
\par
\code
// Walk all the items in the tree, and print their labels
- for ( Fl_Tree_Item *item = tree->first(); item; item = tree->next(item) ) {
+ Fl_Tree_Item *item;
+ for (item = tree->first(); item; item = tree->next(item) ) {
printf("Item: %s\n", item->label());
}
\endcode
@@ -207,7 +209,8 @@
\code
// Find all of the item's children and print an indented report of their labels
void my_print_all_children(Fl_Tree_Item *item, int indent=0) {
- for ( int t=0; t<item->children(); t++ ) {
+ int t;
+ for (t =0; t<item->children(); t++ ) {
printf("%*s Item: %s\n", indent, "", item->child(t)->label());
my_print_all_children(item->child(t), indent+4); // recurse
}
@@ -230,7 +233,7 @@
\par
\code
// Change the font and color of all items currently in the tree
- for ( Fl_Tree_Item *item = tree->first(); item; item = tree->next(item) ) {
+ for (item = tree->first(); item; item = tree->next(item) ) {
item->labelfont(FL_COURIER);
item->labelcolor(FL_RED);
}