Hi everyone,
Sorry if this is a silly question. I am coding up a project using fltk 1.1.9. I
am using fluid, but also just mucking around with the code itself, all in an
eclipse IDE. I have gone through all the available fltk tutorials and looked at
all of the examples in the ./test/ directories. I have learned how to hit the
ground running with all of this help. But I am running into problems trying to
create classes and functions that pass variables, and problems creating a pop
up window that the user inputs something, then clicks ok, then the window
closes, and the program keeps going using the info that was inputted.
Since this is vague, a GREAT example of what I would like to learn about is how
to create something like Fl_File_Chooser. This can be called like:
char *file = Fl_File_Chooser("list tifs...", "*.tif", ".tif",0);
and it waits for the input, then keeps running. I would like to create my own
"File Chooser" that has the same functionality, like
int *a = windowPopUpUserSelectInt();
I can't find any examples or sections in the manuals that teach about these
things.
One way that I tried to learn about creating something like
windowPopUpUserSelectInt() is to copy the Fl_File_Chooser.fl file in ./src and
start adapting it. But I don't get to far, since when I try to create a new
naming structure like change all of the Fl_File_Chooser to myFileChooser and
try to compile, there are lots of undefined references, like:
undefined reference to `myFileChooser::fileNameCB()'
undefined reference to `myFileChooser::preview(int)'
undefined reference to `myFileChooser::previewCB()'
undefined reference to `myFileChooser::favoritesCB()'
this is even more confusing, becasue I can't find where these functions are
defined ANYWHERE, even for Fl_File_Chooser. they are only declared like:
void favoritesCB(Fl_Widget *w);
but I can't find anywhere something like:
void favoritesCB(Fl_Widget *w){
..
}
so I can't even recreate these function definitions for my new test class
myFileChooser.
(big breath)... So I have a few questions:
- Am I thinking about learning fltk the right way? is there a fundamentally
smarter way to learn how to perform some of these higher level passing of
variable typed actions between classes that I am missing based on this little
story I just told?
- other than what comes with the code, is there a repository of *.fl programs
that have examples of how to pass variables from class to class, function to
function?
- What is the deal with the missing definitions of functions tied to
Fl_File_Chooser like favoritesCB(), newdir(), and update_preview()? Where are
they defined ever? are they already in some compiled library where the code is
unaccessible?
- i picked 1.1.9 since it seemed it was the most stable well working release.
Are the things I want to do (like creating classes similiar to Fl_File_Chooser)
easier in 1.3 or 2.0?
- Do I really want to try to recreate Fl_File_Chooser in order to get it's
functionality (...at some step a window pops up for the user to create a
selection, like an integer, then when they say ok, that integer is passed back
to the code that called the instance of the integer selection window...)? are
there better ways to think about it?
- From how I describe my issues, do you think it is a lack of understanding how
to learn fltk or a lack of understanding c++ that is getting me caught up here?
Thank you so much to anyone that can give some pointers and some help!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk