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

Diff of /xforms/demos/popup.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 78  void menu_callback(FL_OBJECT *ob, long d Line 78  void menu_callback(FL_OBJECT *ob, long d
78      FD_pupform *fdui = (FD_pupform *)ob->form->fdui;      FD_pupform *fdui = (FD_pupform *)ob->form->fdui;
79      char buf[128];      char buf[128];
80    
81      sprintf(buf,"item %d (%s) selected",      sprintf(buf,"item %d (%s) selected",
82         fl_get_menu(ob), fl_get_menu_text(ob));         fl_get_menu(ob), fl_get_menu_text(ob));
83    
84      fl_set_object_label(fdui->status, buf);      fl_set_object_label(fdui->status, buf);
85  }  }
86    
87  /** menu initialization entries. No callbacks for the item */  /** menu initialization entries. No callbacks for the item */
88  FL_PUP_ENTRY menu_entries[] =  FL_PUP_ENTRY menu_entries[] =
89  {  {
90       {"Menu Item1"},       {"Menu Item1"},
91       {"Menu Item2"},       {"Menu Item2"},
# Line 143  static int pupitem_cb(int selected) Line 143  static int 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 = (FD_pupform *)data;        FD_pupform *fdui = (FD_pupform *)data;
165        char buf[128];        char buf[128];
166        sprintf(buf,"Entered %d (%s)", n, pup_entries[n-1].text);        sprintf(buf,"Entered %d (%s)", n, pup_entries[n-1].text);
167        fl_set_object_label(fdui->status, buf);        fl_set_object_label(fdui->status, buf);
168  }  }
169    
170  void  void
171  dopup_callback(FL_OBJECT *ob, long data)  dopup_callback(FL_OBJECT *ob, long data)
172  {  {
173      if(pupID < 0)      if(pupID < 0)
# Line 181  dopup_callback(FL_OBJECT *ob, long data) Line 181  dopup_callback(FL_OBJECT *ob, long data)
181      fl_dopup(pupID);      fl_dopup(pupID);
182  }  }
183    
184  /********* End of pup *****************/  /********* End of pup *****************/
185    
186  static void  static void
187  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