> http://www.soft-switch.org/fltk-bug/slider_bug.fl is a simple
> demonstration of a small bug I found, which affects FLTK
> 1.1.10 and 1.3.0. It displays a vertical slider with a knob
> and a box, and a similar slider without the box. It also
> displays two similar horizontal sliders. If you adjust the
> sliders with boxes everything is fine. If you adjust the ones
> without boxes the knob smears across the slider, rather than
> being erased and redrawn.
Yup - that's not a bug, that's a feature.
Basically, what it comes down to is if you do not set a boxtype for a
widget, it is your responsibility to ensure its background is
consistently updated.
Once upon a time, this was a performance issue (though that time may be
past now...)
You can see a similar effect in the test/minimum demo, for example,
where it is the documented behaviour...
Basically, you need to ensure the widget background is redrawn. The
"easy" way to do that is to ensure the widget always has a boxtype, even
if only a "flat" box. Using "No Box" is very much a special case and to
be avoided unless you want to do the extra work of fixing the background
yourself.
Atatched is a revised version of your demo that "works" by using a flat
box, at least for the very simple case the demo shows. Wether or not
this is appropriate for your actual use-case I can't say...!
Cheers,
--
Ian
----------------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0300
header_name {.h}
code_name {.cxx}
decl {\#include <math.h>} {private local
}
Function {main(int ac,char **av)} {open return_type int
} {
code {class AmpInterface amp[2];
amp[0].make_window();
Fl::run();} {}
}
class AmpInterface {open
} {
Function {make_window()} {open
} {
Fl_Window {} {
label Amp open
xywh {674 114 300 225} type Double labelsize 10
code0 {o->show();} visible
} {
Fl_Group {} {open
xywh {5 10 290 210} box ROUNDED_BOX color 58
} {
Fl_Slider {} {
label {slider:}
xywh {25 23 25 167} type {Vert Knob} labelcolor 7
}
Fl_Slider {} {
label {slider:} selected
xywh {110 73 165 27} type {Horz Knob} box FLAT_BOX color 58
labelcolor 7
}
Fl_Slider {} {
label {slider:}
xywh {65 23 25 167} type {Vert Knob} box FLAT_BOX color 58
labelcolor 7
}
Fl_Slider {} {
label {slider:}
xywh {110 23 165 27} type {Horz Knob} labelcolor 7
}
}
}
}
}
---------------
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk