/[xforms]/xforms/demos/thumb.c
ViewVC logotype

Diff of /xforms/demos/thumb.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by leeming, Thu Apr 24 09:35:33 2003 UTC revision 1.4 by leeming, Tue Sep 9 00:28:25 2003 UTC
# Line 75  void menu_callback(FL_OBJECT *ob, long d Line 75  void menu_callback(FL_OBJECT *ob, long d
75      FD_pupform *fdui = ob->form->fdui;      FD_pupform *fdui = ob->form->fdui;
76      char buf[128];      char buf[128];
77    
78      sprintf(buf,"item %d (%s) selected",      sprintf(buf,"item %d (%s) selected",
79         fl_get_menu(ob), fl_get_menu_text(ob));         fl_get_menu(ob), fl_get_menu_text(ob));
80    
81      fl_set_object_label(fdui->status, buf);      fl_set_object_label(fdui->status, buf);
82  }  }
83    
84  /** menu initialization entries. No callbacks for the item */  /** menu initialization entries. No callbacks for the item */
85  FL_PUP_ENTRY menu_entries[] =  FL_PUP_ENTRY menu_entries[] =
86  {  {
87       {"Menu Item1"},       {"Menu Item1"},
88       {"Menu Item2"},       {"Menu Item2"},
# Line 98  FL_PUP_ENTRY menu_entries[] = Line 98  FL_PUP_ENTRY menu_entries[] =
98       {0}       {0}
99  };  };
100    
101  static void  static void
102  menuitem_entercb(int n, void *data)  menuitem_entercb(int n, void *data)
103  {  {
104        char buf[128];        char buf[128];
# Line 131  init_menu(FL_OBJECT *menu) Line 131  init_menu(FL_OBJECT *menu)
131    
132  static int pupID = -1;  static int pupID = -1;
133    
134  static int  static int
135  pupitem_cb(int selected)  pupitem_cb(int selected)
136  {  {
137       char buf[128];       char buf[128];
# Line 143  pupitem_cb(int selected) Line 143  pupitem_cb(int selected)
143       return selected;       return selected;
144  }  }
145    
146  FL_PUP_ENTRY pup_entries[] =  FL_PUP_ENTRY pup_entries[] =
147  {  {
148       {"Popup Item1", pupitem_cb, "1", FL_PUP_RADIO},       {"Popup Item1", pupitem_cb, "1", FL_PUP_RADIO},
149       {"Popup Item2", pupitem_cb, "2", FL_PUP_RADIO},       {"Popup Item2", pupitem_cb, "2", FL_PUP_RADIO},
# Line 160  FL_PUP_ENTRY pup_entries[] = Line 160  FL_PUP_ENTRY pup_entries[] =
160  };  };
161    
162  static void pup_entercb(int n, void *data)  static void pup_entercb(int n, void *data)
163  {  {
164        FD_pupform *fdui = data;        FD_pupform *fdui = data;
165        char buf[128];        char buf[128];
166       fprintf(stderr,"pupId=%d\n",fl_current_pup());       fprintf(stderr,"pupId=%d\n",fl_current_pup());
# Line 168  static void pup_entercb(int n, void *dat Line 168  static void pup_entercb(int n, void *dat
168        fl_set_object_label(fdui->status, buf);        fl_set_object_label(fdui->status, buf);
169  }  }
170    
171  void  void
172  dopup_callback(FL_OBJECT *ob, long data)  dopup_callback(FL_OBJECT *ob, long data)
173  {  {
174      if(pupID < 0)      if(pupID < 0)
# Line 182  dopup_callback(FL_OBJECT *ob, long data) Line 182  dopup_callback(FL_OBJECT *ob, long data)
182      fl_dopup(pupID);      fl_dopup(pupID);
183  }  }
184    
185  /********* End of pup *****************/  /********* End of pup *****************/
186    
187  static void  static void
188  init_choice(FL_OBJECT *ob)  init_choice(FL_OBJECT *ob)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26