FLTK logo

[fltk.general] FLTK usage in passing pointers from file to file

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

FLTK usage in passing pointers from file to file "John E. Kaye P.Eng." Feb 23, 2021  
  I am a newbie here and have a simple problem that I don't seem to be able to resolve.
Given two(2) separate files that will be compiled and linked together.
In file 1 several windows are opened in the main().  All the windows are defined globally. Example 
Fl_Window *win;
Fl_Window *w1;
Fl_Window *w2;
I define and show() main window "win" and also define and show() "w1" in the main() program in File 1.  I define but hide() "w2" in File 1.
In File 2 I declare the following globally
extern Fl_Window *win;
extern Fl_Window *w1;
extern Fl_Window *w2;. 
Now in File 2 I wish to hide() "w1"[w1,hide()] and show() "w2"[w2.show()]
After a successful compile and link it gives a segmentation fault(core dumped) response?
Can anyone comment on how to globally pass defined windows from file to file?

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/45b3257e-5f03-47b0-80a3-209e30ede338n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.