> ste wrote:
> > thank you every one... i had try it, and it works.. now i try to show not
> > just 1 text, but 3 or 4 text, i try with add new label.. but it not works..
> > the 2nd, 3rd, 4th text not show.. how is it?? thank you very much every
> > one... :) ~~i love FLTK~~
>
> In the program I posted, it just uses whatever the label() is,
> which is a single string.
>
> If you want to print multiple strings in different positions,
> find this line:
>
> fl_draw(label(), x(),y(),w(),h(), align());
>
> ..and change it to these instead instead:
>
> fl_draw("Your Message #1", x1, y1, w1, h1, align());
> fl_draw("Your Message #2", x2, y2, w2, h2, align());
> fl_draw("Your Message #3", x3, y3, w3, h3, align());
>
> Where the x1,y1,w1,h1 are X/Y positions, and Width/Height.
>
> If you want to change colors, just put fl_color(0xRRGGBB00)
> commands above each fl_draw() command, where RR=red, GG=green, BB=blue,
> and the last two digits are zeroes.
>
> The RRGGBB values are 16 bit hex values, just like in html.
thank you very much greg.. its so helpfull.. thanks.. i found the other way to
show some texts on image, here is the code..
#include <FL/Fl.H>
#include <FL/Fl_Text_Display.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
Fl_Window *win = 0;
Fl_Button *but = 0;
Fl_Box *box = 0;
Fl_Box *name1 = 0;
Fl_Box *name2 = 0;
Fl_Box *name3 = 0;
Fl_JPEG_Image *jpg = 0;
void ButtonCallback(Fl_Widget*,void*) {
name1->show();
name2->show();
name3->show();
}
int main(int argc, char **argv) {
win = new Fl_Window(700, 600);
jpg = new Fl_JPEG_Image("/tmp/foo.jpg");
box = new Fl_Box(10,10,675,585);
box->image(jpg);
box->box(FL_BORDER_FRAME);
but = new Fl_Button(300,500,120,25,"Push");
name1 = new Fl_Box(150, 250, 120, 25, "Name 1");
name1->box(FL_FLAT_BOX);
name1->color((Fl_Color)55); name1->hide();
name2 = new Fl_Box(300, 250, 120, 25, "Name 2");
name2->box(FL_FLAT_BOX);
name2->color((Fl_Color)55); name2->hide();
name3 = new Fl_Box(450, 250, 120, 25, "Name 3");
name3->box(FL_FLAT_BOX);
name3->color((Fl_Color)55); name3->hide();
but->callback(ButtonCallback);
win->end();
win->show(argc,argv);
return(Fl::run());
}
thank you verymuch everyone.. i love FLTK... ;)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk