FLTK logo

Re: [fltk.general] Re: Fl_Tabs

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: Fl_Tabs Greg Ercolano Sep 02, 2021  
 

On 9/2/21 6:38 PM, Bill Spitzak wrote:

It does seem like a bug, calling value() should not have any side-effects. Especially because the tabs widget works even if nobody calls value().

    Ah, it is weird that just testing with Fl_Tabs::value(void) can apparently
    end up calling hide() and show().. yikes.

    That code goes back to 1999 though, so looks like you'd know for sure:

49a0693962 (Matthias Melcher   2006-08-17 13:43:07 +0000 308) Fl_Widget* Fl_Tabs::value() {
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 309)   Fl_Widget* v = 0;
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 310)   Fl_Widget*const* a = array();
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 311)   for (int i=children(); i--;) {
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 312)     Fl_Widget* o = *a++;
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 313)     if (v) o->hide();
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 314)     else if (o->visible()) v = o;
a7904da09a (Bill Spitzak       1999-10-15 09:01:48 +0000 315)     else if (!i) {o->show(); v = o;}
f9039b2ae2 (Michael R Sweet    1998-10-06 18:21:25 +0000 316)   }
f9039b2ae2 (Michael R Sweet    1998-10-06 18:21:25 +0000 317)   return v;
f9039b2ae2 (Michael R Sweet    1998-10-06 18:21:25 +0000 318) }

    Perhaps that's the cause, because that last line in the loop that
    calls o->show() on the last item seems to be maybe what's forcing
    the last child to be visible if no other one 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/43ea8ff1-4109-ab54-44c5-2c2a44ea717b%40seriss.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'.