On Tue, 4 Sep 2007, D. Zimmer wrote:

>> void Fl_Image_Button::draw() {
>>      if (value()==0)
>>      {
>>              if (upimage!=NULL) {
>>                      this->image(upimage);
>>              }
>>      } else {
>>              if (this->value()==1)
>>              {
>>                      if (downimage!=NULL) {
>>                              this->image(downimage);
>>                      }
>>              }
>>      }
>>      Fl_Button::draw();
>> }

> I would recommend not setting image(), but instead copying the code for
> Fl_Button::draw() then drawing the appropriate image yourself (after
> drawing the box but before drawing the label).  This would circumvent
> the image() and align() settings for your class,
> and allow you to ensure that the image is always centered and clipped
> (assuming you want this).

I noticed things don't work properly if I set a label, and the 
Fl_Button::draw() function is small enough to use instead of 
calling the one of Fl::button, but I'm not sure I anderstand 
what you're saying. Also, I'm not sure how to draw an image- or would it 
work just call Fl_Image::draw()? Otherwise, I'd be interested to see how 
you would solve it.

Best,
Marc

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to