> On 07.05.2012 12:36, Albrecht Schlosser wrote: > > On 07.05.2012 09:22, leowang wrote: > > > >> The Fl_Shared_Image::get() can only add one picture on the widget, but > >> now I want to implement this feature: when the focus is not on the > >> widget, the picture is icon.bmp, when the focus is on the widget, the > >> picture can change to icon_focus.bmp. Like MulitImage widget in fltk2.0. > >> > >> Does fltk1.3 has the similar widget? > > > > No, but Fl_Shared_Image::get() does not "add one picture on the > > widget". It loads and holds an image. However you can add two > > images to a widget, see image() and deimage() methods. The latter > > is used if the widget is inactive, and both can use an image that > > you loaded with Fl_Shared_Image::get(). > > Oh, well, the above doesn't answer your question, i.e. how to change > the image when the focus changes. This can only be done by deriving > your own class and using either the handle() method to change the > image() in the class, or use the draw() method to draw the image > you want, depending on whether (Fl::focus == this) or whatever. > > Albrecht
Thanks, so if fltk1.3 has no such widget, then seems write my own class is the only way. Best regards, Leo _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk