|
|
I would like to subclass a plastic Fl_Button and change it to a flat
drawing before getting pressed. I would like to set it up in the
constructor. However, the following does not work:
Button::Button( int X, int Y, int W, int H, const char* L ) :
Fl_Button( X, Y, W, H, L )
{
box( FL_FLAT_BOX ); // here it does not work
}
void Button::draw()
{
if (type() == FL_HIDDEN_BUTTON) return;
Fl_Color col = value() ? selection_color() : color();
box( FL_FLAT_BOX ); // here it works
draw_box(value() ? (down_box()?down_box():fl_down(box())) :
box(), col);
draw_backdrop();
if (labeltype() == FL_NORMAL_LABEL && value()) {
Fl_Color c = labelcolor();
labelcolor(fl_contrast(c, col));
draw_label();
labelcolor(c);
} else draw_label();
if (Fl::focus() == this) draw_focus();
}
Can someone explain me why and how do I go around it?
--
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/7480598b-6813-fa46-75f0-e3ab05b7b3c9%40gmail.com.
[ Direct Link to Message ] | |
|
| |