Re: Re[PHP-GTK] defining base class functions?
[email protected] (kksou) Thu, 19 Jun 2008 23:24:29 -0700 (PDT)
| Newsgroups | php.gtk.general |
|---|---|
| Message-ID | <[email protected]> |
Benjamin Smith wrote:
>
> Is there a way (PHP-GTK1) to redefine a base class method? Specifically, I
> need to change set_usize() so that the values for X and Y can be
> recalculated.
>
Hi Ben,
Don't think PHP-GTK1 or PHP-GTK2 allows you to redefine a base class or
override an existing class method.
If you really need something like this now, maybe you could try this.
1) Do a global find and replace to change all set_usize($x, $y) to
my_set_usize($x, $y)
2) Then define my_set_usize($x, $y) as what you've wanted
function my_set_usize($x, $y) {
set_usize(round($x * SIZEMULTIPLIER), round($y * SIZEMULTIPLIER));
}
I know the solution is primitive and not your ideal solution. But at least
you have something working till they allow you to override existing methods.
Regards,
/kksou
--
View this message in context: http://www.nabble.com/Redefining-base-class-functions--tp17832602p18023768.html
Sent from the Php - GTK - General mailing list archive at Nabble.com.