FLTK logo

Re: [fltk.general] Re: Problem with redraw() / draw()

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: Problem with redraw() / draw() Albrecht Schlosser Aug 15, 2022  
 
On 8/15/22 09:56 geert karman wrote:

> I attach my modified version of ScrollB which provides the behavior I
> think you want.  I moved the invocation of move_to() outside the
> Scroll_B::draw()
> method, into a callback function for ScrollB's vertical scrollbar.
 
Excellent! Without checking the code in detail or testing it myself (I
only read your code quickly), this is generally how it should be done.
Thanks for investigating and helping!
 
Great! works fine, many thanks. I was looking for a way to intercept the scrolling of the Fl_Scroll and only thought of the draw() function. It is of course much better to provide my own version of the callback() of the scrollbar.

I'm glad this works for you.

On a further note, I was also trying to get my own scrollbars into an Fl_Scroll widget, but that looks like it cannot be done?

No, this can't be done. Fl_Scroll has two embedded Fl_Scrollbar widgets and uses these exclusively. Unfortunately Fl_Scroll exposes the embedded scrollbars in its public interface which means there's no way to change this, hence you can't replace them with your own scrollbar class.

However, this is something I've been thinking about as well, just recently again, when I was working on some internal aspects of Fl_Scroll. In the future we *might* create another Fl_Scroll_xx class (take 'xx' as a placeholder) which would not embed the scrollbars but use external Fl_Scrollbar widgets which you could then *maybe* replace with your own scrollbars as long as those provide the same interface (which means they would likely need to be a subclass of Fl_Scrollbar).

What did you want to achieve by replacing the scrollbars with your own scrollbars? Was it only for a better look, or should your scrollbars have different features? I'm curious...

Many thanks for all the help.

Welcome.

--
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/0157eb12-c67e-aeb1-1ae9-06128a5285d1%40online.de.
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'.