DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2208
Version: 1.3-current


The textcolor() method should take the same parameter type (probably
Fl_Color I guess) in all widgets, but in practice most widgets have it
defined to take unsigned.
I'm not at all sure why - is there some reason for this that I just don't
get? Or is settign them all to be Fl_Color going to be OK?

Also, fluid should be adjusted to add an explicit cast to the correct
type, once we decide what the correct type is!

In fltk-1.3.x, that's around line 2129 of the file Fl_Widget_Type.cxx,
where we have:

  if (color_name) {
    write_c("%s%s->%s(%s);\n", indent(), var, field, color_name);
  } else {
    write_c("%s%s->%s((Fl_Color)%d);\n", indent(), var, field, color);
  }

Where the first write_c line possibly ought to be:

    write_c("%s%s->%s((Fl_Color)%s);\n", indent(), var, field,
color_name);

Note that the "else" condition already does the explicit cast anyway...


Many widgets define the textcolor() method, if they define it at all, as:

Fl_Browser_.H: void textcolor(unsigned col) 
Fl_Chart.H: void textcolor(unsigned n) 
Fl_Counter.H: void textcolor(unsigned s)
Fl_Input_.H: void textcolor(unsigned n)
Fl_Text_Display.H: void textcolor(unsigned n)
Fl_Tooltip.H: static void textcolor(unsigned c)
Fl_Value_Input.H: void textcolor(unsigned n)
Fl_Value_Output.H: void textcolor(unsigned s)
Fl_Value_Slider.H: void textcolor(unsigned s)


However, a few define it as:

Fl_File_Chooser.H: void textcolor(Fl_Color c)
Fl_Input_Choice.H: void textcolor(Fl_Color c)
Fl_Spinner.H: void textcolor(Fl_Color c)


Thoughts?
This one is raising it's head now because there are reports of recent
compilers (e.g. gcc 4.4 etc.) complaining about this...

-- 
Ian


Link: http://www.fltk.org/str.php?L2208
Version: 1.3-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to