>
> what I try to do is to change the labeltype of a button by an
> "icon". I like to have an icon in stead of having an ordinary button.
> In fact it is said in the FLTK 1.1.10 Programming Manual
> (Revision 10) that this class manages icon images that can be
> used as labels in other widgets.
OK - yes you can do that, but that class will not help you.
You can attach an image to any button - the attached fluid example file
shows how that might work.
You will need to provide two small PNG files to use for this, both 40x40
pixels, one called "up.png" and the other called "dn.png", then use
fluid to generate the C++ source files from this example.
Fluid will convert the PNG data into XPM data embedded in the source
files, and the example should then show the image in place of the
button.
For the best effect, try PNG images with a transparent background.
Hopefully that will be what you are wanting.
###############################################################
# fluid example file
# data file for the Fltk User Interface Designer (fluid)
version 1.0110
header_name {.h}
code_name {.cxx}
decl {\#include <stdio.h>} {}
Function {} {open
} {
Fl_Window main_win {
label {Button Image Test} open
xywh {668 327 279 184} type Double visible
} {
Fl_Button {} {
label Quit
callback {main_win->hide();}
xywh {205 142 64 28} box THIN_UP_BOX
}
Fl_Button {} {
label Deactivate
callback {if(o->value() != 0){
icon_bt->deactivate();
}
else {
icon_bt->activate();
}} selected
xywh {95 10 90 45} type Toggle
}
Fl_Button icon_bt {
callback {puts("Hello");
fflush(stdout);}
image {up.png} deimage {dn.png} xywh {18 10 46 45} box FLAT_BOX
}
}
}
# end of fluid file
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