Impossible to inherit a class from AppIndicator*.Indicator in Python (gir)

Bug #730528 reported by Artem Popov
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libappindicator
Confirmed
Low
Unassigned
libappindicator (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

In Python it's currently impossible to inherit a class from AppIndicator*.Indicator. The following sample code leads to segfault:

from gi.repository import AppIndicator3

class MyIndicator(AppIndicator3.Indicator):
    def __init__(self):
        AppIndicator3.Indicator.__init__(self)
        #also happens with self.__gobject_init__()

i = MyIndicator()

Artem Popov (artfwo)
summary: Impossible to inherit a class from AppIndicator*.Indicator in Python
+ (gir)
Revision history for this message
Martin Pitt (pitti) wrote :

I don't think that has got anything to do with the subclassing; you cannot currently instantiate an appindicator object:

$ python -c 'from gi.repository import AppIndicator3; i = AppIndicator3.Indicator(); print i'

(process:29515): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed
-c:1: Warning: invalid (NULL) pointer instance
-c:1: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
Speicherzugriffsfehler (Speicherabzug geschrieben)

Revision history for this message
Artem Popov (artfwo) wrote :

Martin, this code works for me on a fully updated Natty system:

from gi.repository import AppIndicator3, Gtk

i = AppIndicator3.Indicator.new("testindicator", "indicator-messages", AppIndicator3.IndicatorCategory.HARDWARE)
i.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
i.set_menu(Gtk.Menu())

Gtk.main()

Revision history for this message
Artem Popov (artfwo) wrote :

Oh yes, constructor does not work, you have to use Indicator.new()

Changed in libappindicator (Ubuntu):
assignee: nobody → Ken VanDine (ken-vandine)
importance: Undecided → Low
Changed in libappindicator:
importance: Undecided → Low
Ted Gould (ted)
Changed in libappindicator:
status: New → Confirmed
Changed in libappindicator (Ubuntu):
status: New → Confirmed
Changed in libappindicator (Ubuntu):
milestone: none → ubuntu-11.04
Changed in libappindicator (Ubuntu):
milestone: ubuntu-11.04 → natty-updates
Changed in libappindicator (Ubuntu):
milestone: natty-updates → none
Changed in libappindicator (Ubuntu):
assignee: Ken VanDine (ken-vandine) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.