Hi everyone!

I've changed the look of all the buttons in my application by setting an image 
that covers the whole button surface.

To get a switch between images when the user hovers or pushes a button I use 
MultiImage. Everything works fins until I add a state for fltk::INACTIVE_R or 
fltk::INACTIVE. When the button is turned inactive (by calling 
"activated(false);" the application crashes and Visual Studio Debug points to 
the Window's draw function.

This is my code for creating the MultiImage:

fltk::MultiImage* GetButton(const char *str)
{
  string first = ".\\Resource\\Images\\button";
  string end = ".png";
  string variable = str;

  string str0 = first+variable+end;
  string str1 = first+variable+"_hover"+end;
  string str2 = first+variable+"_push"+end;
  string str3 = first+variable+"_inactive"+end;

  return new fltk::MultiImage(*(fltk::SharedImage::get(str0.c_str())),
        fltk::HIGHLIGHT, *(fltk::SharedImage::get(str1.c_str())),
        fltk::PUSHED, *(fltk::SharedImage::get(str2.c_str())),
        fltk::INACTIVE_R, *(fltk::SharedImage::get(str3.c_str())));
}

I set it to the button like this:

o->image(TvsVideoEditorApplication::GetButton("file_postfix"));


Any help is appreciated!

PS.
I've made sure the image actually exist where it is supposed to.
DS.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to