On 21.08.2011 18:06, schrieb asif saeed wrote: > Is there any code example illustrating constructing an FLTK based GUI > dynamically? Particularly, the menu bar/menus/menu items? Can you provide > any guidelines as to how to proceed in this direction?
Matt answered already how to construct menus and how to add widgets to groups as you may have seen. I can tell you that I have a program that constructs *all* FLTK widgets dynamically. This is a client-server application (the FLTK code is the client side), and all widgets are generated on behalf of the server's widget design. I can't give you code examples, but it's all in the docs. Just create the widgets with "new Fl_Some_Widget(...)" and add them to their parent Fl_Window or Fl_Group (or use the automatic adding feature). In my application there are a few groups that are created in the client by its own static code (e.g. an image display and an editor widget with some buttons and icons), but most of it is generated by descriptions that are sent by the server to the client. There is absolutely no fluid generated code involved. So, if the question was if it can be done: the answer is absolutely YES. Unfortunately I can't give you sample code, though. But as I wrote before: it's all in the docs, and you can do everything you like in your own code. Albrecht _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

