If you're still not sure, show us a simple two file example
that doesn't work but should,
where one file has the main() and sets the variables, and
calls functions in the other
file that tries to use the variables. There may be something
about what you're doing
in the actual code.
Thank you for your response and comment. I had declared the Window pointers Globally such as Fl_Window *w1, Fl_Window *w2 etc BUT defined them in the main() program in FILE 1 as Fl_Window w1(5,198,600,275,"Tester"), etc
int main(..) {
// Create window w1, saving pointer to
created window in w1
w1 = new
Fl_Window(5,198,600,275,"Tester");
// define widgets that go inside w1..
w1->end();
// From here, you can call your functions in your other
file
// that use w1 and it should work
return Fl::run(); // application loop
}
That should work correctly.
Any further comments??
https://www.youtube.com/watch?v=U83xH1KZ_is
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/ca5666eb-c141-4048-8742-9b91d3e137fcn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/uDe3loc7qBY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAL-8oAjD%2BNPNzsHzUrYJFdwdnXPevsgtqKKXhEytn5LZCe%2BGrQ%40mail.gmail.com.
From: John E. Kaye P.Eng.
Sent: 27 February 2021 01:44
To: fltkg...@googlegroups.com
Subject: Re: [fltk.general] FLTK usage in passing pointers from file to file
Regarding passing window "pointers" from one file to another, I must thank you for assisting me in this endeavour. It works well now that I understand the use of "new", begin() and end(). I do note that the text expression in each instance of my declared windows only appears for the first window....or I may be missing something. Is there a way to easily have a text at the top of each window which would describe the data that will be displayed? I did look at Fl_Text_Display but it seemed rather to be an overkill.
It would be good to hear your thoughts. Take care.
Hi John,
You can set the label of the window. This will put the text into the top bar. If the text is a constant use Fl_Window::label() otherwise use Fl_Window::copy_label().
Phil.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAAmyU3bXP7tbHnqi%3DJVLw3Dr_MxssADiNX98FmrusauFOFmm8A%40mail.gmail.com.
Regarding passing window "pointers" from one file to another, I must thank you for assisting me in this endeavour. It works well now that I understand the use of "new", begin() and end(). I do note that the text expression in each instance of my declared windows only appears for the first window....or I may be missing something. Is there a way to easily have a text at the top of each window which would describe the data that will be displayed? I did look at Fl_Text_Display but it seemed rather to be an overkill.It would be good to hear your thoughts. Take care.