Hi.

Main window class, among other stuff, contains one integer public
variable, one static function, and one Browser variable:

class MainWindow : public Window {
        public:
                unsigned long intVar;
                Browser browser;
                static void someFunc(void *);
        // ...
};

In some way "intVar" gets modified, for example when some Input is changed
and its callback functions then sets "intVar" variable to "Input->size()",
and "browser" variable is passed to static "someFunc()" function as "void *".

Now, if I try to access "intVar" from within class, for example from some
non-static member function, it's value is of course correct, but if I
try to access that same variable from within static "someFunc()" function,
through "void *" parameter conversion like this: 

void MainWindow::someFunc(void *b) { // "b" is "browser"
        Window *group = ((Browser *)storage)->window();
        usinged long tmp = ((MainWindow *) group)->intVar;
        // ...
}

then value of "intVar" is always "561" no matter what actual value is in
it!!?

I think that I've made some conversion error, that is I should convert passed
"void *" pointer somehow differently, maybe even in some other type, but I
don't know how/which. Can someone please tell me the correct way to do this?

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to