Hiba wrote:
> Thank you Greg Ercolano for your help.
> Now, i want to know how to show the file chooser by selecting a menu item (i
> have in my interface a menu item "open", the file chooser should appear when
> i select it).
> How to do? and what code should i add (using fluid)?
You'd have to make a separate window for the chooser, and put
your chooser and OK/Cancel buttons in that, eg:
Fl_Window your_chooser_window
|-- Fl_Browser your_chooser
|-- Fl_Button ok_button
|-- Fl_Button cancel_button
You would create a callback for the 'open' item that invokes
your_chooser_window->show() to make the window with the browser
and buttons appear.
Assuming the above layout for your browser window,
just open the properties window for the 'open' item,
and set a callback for it, eg:
1) In "Properties" window for your 'Open' menu item,
click on the "C++" tab
2) At the "Callback:" prompt, type
your_chooser_window->show();
..where 'your_chooser_window' is the global name
for the Fl_Window containing your chooser and the OK/Cancel
buttons. (Or whatever other widgets you want in that dialog)
With that configured, when the user clicks the 'open' item in your
menu bar, the chooser window will open. And similarly, you can create
callbacks for the OK and Cancel buttons to hide() the window.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk