[Gtk-sharp-list] Point.custom patch

Charles Iliya Krempeaux charles@reptile.ca
05 Feb 2003 16:44:01 -0800


Hello,

I'd probably call it something other than a "Point".
Maybe instead a "Vector" (or "Vector2") or a "Tuple".

A "Point" has additional "mathematical" meanings beyond
just holding 2 numbers (and being a Ring).


Something like this would be useful though.  Consider
if you want to get the size of a Gtk.Window.  If you
had a "Vector2:, you could do a...

    Gtk.Window window = new Gtk.Window();

    // ...

    Gdk.Vector2 v = window.Size;

    System.Console.WriteLine(
        "The Window Size is: width={0} height={1}"
        , v.x1, v.x2
    );

Where x1 and x2 are like x and y in your code.

Or you could overload the "[]" operator, and get...

    Gtk.Window window = new Gtk.Window();

    // ...

    Gdk.Vector2 v = window.Size;

    System.Console.WriteLine(
        "The Window Size is: width={0} height={1}"
        , v.[1], v.[2]
    );

Or maybe the counting should start a zero.

It would be better though, if the CLI supported this
natively.  The this could be optimized in all sorts
of ways!


See ya

On Wed, 2003-02-05 at 12:05, Martin Willemoes Hansen wrote:
> Hi there!
> 
> I was needing a point today and thought the following addition to
> Gdk.Point would be nice, here is a patch of the changes I made.
> 
> Can it be included? I have not tested it since my cvs is not
> functioning.
> 
> Also I was in doubt about the Author copyright lines, are they ok?
-- 
     Charles Iliya Krempeaux, BSc
     charles@reptile.ca

________________________________________________________________________
 Reptile Consulting & Services    604-REPTILE    http://www.reptile.ca/