From: Andreas H. <and...@bl...> - 2025-03-30 14:21:17
|
Hi Dima Actaully, this should work out of the box now. To derive from Fl_Valuator, you need something like the following: class My_Valuator(Fl_Valuator): def _init__(self, x, y, w, h, label): Fl_Valuator.__init__(self, x, y, w, h, label, len(label)) def format(self): return (4, "test") In addition, you will need to override the draw() method, as this is also not provided by Fl_Valuator. Please let me know if you see some problems with your implementation. Best regards Andreas On 3/25/25 17:21, Dima Kogan wrote: > and...@bl... writes: > >> Yes, Fl_Valuator cannot be used on its own and should be derived from. >> This is, for instance, what has been done with Fl_Adjuster, which is >> derived from Fl_Valuator. > We're not understanding each other. What I ACTUALLY want to do is to > build a log-scale Fl_Slider. This is derived from Fl_Valuator. And I'd > need to create my own derived class Fl_Log_Slider(Fl_Slider) in Python, > and this Fl_Log_Slider would need to have a def format() that overrides > the virtual implementation in Fl_Valuator. And this format() would need > to return its string in the way the C++ api expects. Can we do that? > > > _______________________________________________ > Pyfltk-user mailing list > Pyf...@li... > https://lists.sourceforge.net/lists/listinfo/pyfltk-user |