FLTK logo

[fltk.general] Re: Run code when Fl_Scroll stops scrolling?

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: Run code when Fl_Scroll stops scrolling? geert karman Sep 09, 2022  
 


Thank you very much for the code, Karman! It looks neat though I have yet to fully understand it :) And I wonder what is the purpose of the boxes you draw in the constructor?

The boxes were part of my test program, see the post that I referred to in my previous answer ("Problem with redraw() / draw()" from mid august, I already moved on and don't have it on my computer anymore). You can plug in the code for the modified scroll_B class to see what it does. The crux is that you provide your own callback function for the scrollbar. It should of course perform the task of the original callback which is just positioning the scroll:

  Fl_Scroll* s = (Fl_Scroll*)(o->parent());
  s->scroll_to(int(((Fl_Scrollbar*)o)->value()), s->yposition());

(This is the only thing it does) and then you can have it perform the tasks specific for your application. 

On a general note: I find the Fl_Scroll class not very adaptable to my needs, very un-FLTK-like. I hope the development team can come up with an "improved" version. I do greatly appreciate all the work that is going into FLTK, it is quite a feat! A great thanks to everyone!



 

--
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/c71eed83-d895-4cb7-a628-7e7b3ad47381n%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'.