> > public:
> > tag(char *tobeshown, int x, int y, int w, int h):
> Fl_Widget(x,y,w,h) {
> > strcpy_s(text,tobeshown);
> > posx=x;
> > posy=y;
> > // Default font, font size, color
> > tcolor=FL_BLACK;
> > tfont=FL_HELVETICA;
> > if (h<18) tfontsize=h;
> > else tfontsize=18;
> > }
>
> Just a tip, I like it more to use initialisation list:
>
> public:
> tag(char *tobeshown, int x, int y, int w, int h):
> Fl_Widget(x,y,w,h),
> tcolor(FL_BLACK), tfont(FL_HELVETICA), tfontsize(18),
> posx(x), posy(y)
> {
> strcpy_s(text,tobeshown);
> if (h<18) tfontsize=h;
> }
Though that's very much a stylistic thing - for my part, I like the OP's
way better than Edzard's way!
>
> > Fl_Window *win_v;
> >
> > win_v = new Fl_Window(400, 300);
> > win_v->modal();
> > win_v->label("Verify");
> > win_v->begin();
> > tag l1("Verify",0,0,80,50);
> > l1.font(FL_HELVETICA_BOLD,50);
>
> This is a local object and will vanish, when constructor is left. You
> need to create it dynamically:
Yup - that's the kicker; tag l1 is being created stack automatic, so
will disappear when the constructor ends.
As Edzard says, you need to "new" the instance of tag in the
constructor, so that it persists after the constructor exits.
>
> (new tag("Verify",0,0,80,50))->font(FL_HELVETICA_BOLD,50);
>
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