Albrecht Schlosser wrote:
> Michael Schmid wrote:
>> Hello!
>>
>> I'm using FLTK 1.1.9
>>
>> It sounds stupid but I don't find a appropriate method to show text on
>> an image. It should be possible to position the text wehereever I want.
>> I also want to determine the size, the color and the font of the text. I
>> show the image in a box.
>
> fl_draw() [1] is your friend. [..]
Also, for a simple example of subclassing and using fl_draw(), see:
http://seriss.com/people/erco/fltk/#TextOverImage
In that case it's subclassed from Fl_Widget, because the image and text
comprise the entire widget.
In cases where you want the widget to 'show through', eg. an Fl_Button,
then you'd subclass from Fl_Button, and in your fl_draw() function
first call Fl_Button::draw() to draw the widget, followed by your own
drawing calls to put the image over the part of the button you want,
followed by the text drawing code using fl_font()/fl_color()/fl_draw().
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk