![]() |
|
#1
|
||||
|
||||
Using the FL_File_Chooser widgetHi all, this widget its wonderfull but hard to use. This is how i use it and what problems i havent fixed.
CPP / C++ / C Code:
Problem 1: Fl_File_Chooser dosn't implement end() or parent() methods so you can't call the parent from the static callback. This restringes a lot the use of the widget. Solution: making the parent singleton. Problem 2: the callback event gets up when you select a file in the browser. This is a little weird. The normal use its to do something when the user push the OK button. Solution 2: i dont know yet. I dont know how to do it. The FLTK documentation gives some guidelines to create the Fl_File_Chooser object because the constructor its different from the rest. Take a look at it. Can anyone give a response to the problem two? Greetings. |
|
#2
|
||||
|
||||
|
In adition to problem 1: i have read in another http://www.gidforums.com/t-4743.html that the void *v param in the callback can convert to the class containing the widget (this is valid for all the widgets not only the Fl_File_Chooser):
CPP / C++ / C Code:
Now I dont need the singleton pattern to make it works. |
|
#3
|
|||
|
|||
About problem 2Quote:
I had the same problem, I mean, I wanted to do something only when OK button was pressed! What I did: CPP / C++ / C Code:
Hope it works for your problem. |
|
#4
|
||||
|
||||
|
it works really good, thx
|
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| widget coordinate relative to parent ? | Marius Giurgi | FLTK Forum | 10 | 10-Mar-2005 07:21 |
| How to refresh a widget immediately | dsmith | FLTK Forum | 8 | 11-Dec-2004 01:54 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The