[Gtk-sharp-list] Idea: ToString() methods
Miguel de Icaza
19 Aug 2002 15:10:20 -0400
> How about trying to stay "compatible" with the output of the classes in
> the System.Drawing namespace?
> On MS.NET:
> Console.WriteLine(new System.Drawing.Point(1,2).ToString());
> Console.WriteLine(new System.Drawing.Rectangle(1,2,3,4).ToString());
> Prints out this:
> Color [Blue]
> Color [A=255, R=100, G=100, B=100]
Well, there is a problem here. ToString() is officially documented in
the Object base class as being just a debugging tool, and not intended
to be used for real use. A few classes though, use ToString() as their
officially supported method of stringifying themselves (like
So in the above scenario, ToString() looks like debugging, but in the
Gtk# case, we could make it a bit more useful. For instance, the rgb:
notation from X11 can be copy/pasted in source code or program command
lines, or input fields to specify a color.
I do not feel strongly about this though.