FLTK logo

[fltk/fltk] Setting callback of Fl_Scroll's scrollbar freezes the scrollbar (#198)

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.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] Setting callback of Fl_Scroll's scrollbar freezes the scrollbar (#198) Mohammed Alyousef Mar 04, 2021  
 

Hello
I noticed that setting the callback for Fl_Scroll's scrollbar causes the scrollbar to freeze (even though the callback is triggered). A minimal reproducible example:

#include <FL/Fl_Window.H>
#include <FL/Fl_Scrollbar.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Box.H>
#include <FL/Fl.H>

void cb(Fl_Widget *, void *) {
    puts("works");
}

int main() {
    Fl_Window w(400, 300);
    Fl_Scroll s(50, 10, 340, 280);
    Fl_Box b(100, 500, 80, 40, "whatever");
    s.end();
    w.end();
    w.show();
    s.scrollbar.callback(cb, 0);
    return Fl::run();
}

While the behaviour with a regular Fl_Scrollbar just works:

int main() {
    Fl_Window w(400, 300);
    Fl_Scrollbar s(10, 10, 20, 280);
    w.end();
    w.show();
    s.callback(cb, 0);
    return Fl::run();
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

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'.