MacArthur, Ian (SELEX GALILEO, UK) schrieb:
>
>>> 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!

Yery much, but not entirely - initialising constant values and 
references is only possible by using initialisation list and it can 
prevent objects by beeing initialised twice.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to