FLTK logo

Re: [fltk.general] Re: HOWTO = ???->show() in a callback function

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 ]

Re: Re: HOWTO = ???->show() in a callback function roger tunnicliffe Sep 24, 2022  
  Copy and pasted your working version code and it compiled (after adding FL/Fl.H) okay but when I stepped thru the program "cards->show()" did nothing (nothing displayed) ???
 

On Sunday, September 25, 2022 at 8:47:17 AM UTC+10 roger tunnicliffe wrote:
The hack approach: declare cards globally and use it as needed.
Fl_Tabs *cards;
void but1_Callback(...) {
cards = new Fl_Tabs(40,40,300,200);

Tried this one quickly and I get a SIGSEV ("Segmentation fault")

On Sunday, September 25, 2022 at 8:22:35 AM UTC+10 roger tunnicliffe wrote:
Thx guys, I'll try that later today.
Cheers


On Sunday, September 25, 2022 at 3:18:41 AM UTC+10 Ian MacArthur wrote:
As a rider to the previous reply, I'd add that it's probably a good idea to make sure that you "end" window1 before instantiating window2 to avoid getting into weird parenting dependencies between the two windows.

Also, this code would instantiate another window2 every time the button is pressed which might not be the intended behaviour.

--
Ian
From my Fairphone FP3

--
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/7968d00f-6159-403e-ba29-46104642ad95n%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'.