subclassing GtkMenuItem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

subclassing GtkMenuItem

Der Starchaser
hello @ all,

when subclassing GtkMenuItem I receive an error : Fatal error: Call to
undefined method GtkMenuItem::GtkMenuItem() in MenuItem.class on line 128.

Is there any workaround possible ?



class MyAltMenuItem extends GtkMenuItem
{
        function MyAltMenuItem($label, $underscore, $accelgroup)
        {
                GtkMenuItem::GtkMenuItem ( $label ); <------ line 128
                if (strlen($label)!=(strlen($underscore)-1))
                        $label = new GtkLabel;
                else
                        $label = $this->child;

                $Subitem_key = $label->parse_uline($underscore);
                GtkMenuItem::add_accelerator("activate_item", $accelgroup, $Subitem_key,
GDK_MOD1_MASK, 0);
        }
}

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply | Threaded
Open this post in threaded view
|

Re: subclassing GtkMenuItem

Der Starchaser

use

        GtkMenuItem::__construct ( $label );


Am Saturday 22 August 2009 16:34:21 schrieb Der Starchaser:

> hello @ all,
>
> when subclassing GtkMenuItem I receive an error : Fatal error: Call to
> undefined method GtkMenuItem::GtkMenuItem() in MenuItem.class on line 128.
>
> Is there any workaround possible ?
>
>
>
> class MyAltMenuItem extends GtkMenuItem
> {
> function MyAltMenuItem($label, $underscore, $accelgroup)
> {
> GtkMenuItem::GtkMenuItem ( $label ); <------ line 128
> if (strlen($label)!=(strlen($underscore)-1))
> $label = new GtkLabel;
> else
> $label = $this->child;
>
> $Subitem_key = $label->parse_uline($underscore);
> GtkMenuItem::add_accelerator("activate_item", $accelgroup, $Subitem_key,
> GDK_MOD1_MASK, 0);
> }
> }

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php