logo       


Re: GdkRectangle, again: msg#00188

Subject: Re: GdkRectangle, again
it's nice to be able to set the members without having to call a function.you
would like to be able to $update_rect->{x} = 5; granted it's just as easy to
say $update_rect->x(5); but that's not what you'd first assume would be the
case. these are c structures that in a c app you directly manipulate. when in
perl that equates to a hash. and that would probably be people's first
assumption to what a GtkRectangle would/should be.

there's nothing keeping you from making it functions that operate on a hash so
that you could choose which way. use it as hash ($rect->{x}) or as a function
($rect->x)

-rm

> On 29 Apr 2003, Guillaume Cottenceau wrote:
>
>> "muppet" <scott@xxxxxxxxxxx> writes:
>>
>> > old gtk-perl treated GdkRectangle as a 4-element list in perl.  this
>> made it very easy to manipulate the contents of the rectangle in perl,
>> and i switched to this because dealing with a boxed type from perl via
>> member accessor functions is clumsy.
>>
>> I personally favored the orthogonality of methods in gtk2-perl,
>> and that's why we are (were?) using GdkRectangle like all other
>> Boxed types, with methods to access members. E.g.:
>>
>>   $pixmap->draw_rectangle ($gc, TRUE,
>>                            $update_rect->x,
>>                            $update_rect->y,
>>                            $update_rect->width,
>>                            $update_rect->height);
>>
>> E.g. even more readable than hash ref thing. There's also
>> ->values so that you can do things like:
>>
>> my (undef, undef, $w, $h) = $update_rect->values;
>>
>>
>> Just my personal point of view, of course.
>>
>> --
>> Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/
>
> I think I have to vote this way as well.  Besides it will look really silly
> in Perl 6 to say
>
> $pixmap->draw_rectangle (
>       $gc,
>       TRUE,
>       $update_rect.{x},
>       $update_rect.{y},
>       $update_rect.{width},
>       $update_rect.{height}
> );
>
> instead of
>
> $pixmap->draw_rectangle (
>       $gc,
>       TRUE,
>       $update_rect.x,
>       $update_rect.y,
>       $update_rect.width,
>       $update_rect.height
> );
>
> _______________________________________________
> gtk-perl-list mailing list
> gtk-perl-list@xxxxxxxxx
> http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe