Ubuntu迅速警告

时间:2013-05-31 20:17:47

标签: python-2.7 gtk ubuntu-12.04 glade canonical-quickly

我刚刚使用快速创建了“jotty”教程应用程序。它工作正常,但我得到以下警告:

$ quickly run
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning:
       g_object_set_property: construct property "type" for object `Window' 
       can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning:
       g_object_set_property: construct property "type" for object `AppWindow' 
       can't be set after construction
Gtk.Window.__init__(self, type=type, **kwds)

我正在运行ubuntu 12.04。在此先感谢您的帮助

1 个答案:

答案 0 :(得分:0)

打开您的/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py并进行更改(第391行)

从:

class Window(Gtk.Window):
    def __init__(self, type=Gtk.WindowType.TOPLEVEL, **kwds):
        Gtk.Window.__init__(self, type=type, **kwds)

为:

class Window(Gtk.Window):
    def __init__(self, type=Gtk.WindowType.TOPLEVEL, **kwds):
        # type is a construct-only property; if it is already set (e. g. by
        # GtkBuilder), do not try to set it again and just ignore it
        try:
            self.get_property('type')
            Gtk.Window.__init__(self, **kwds)
        except TypeError:
            Gtk.Window.__init__(self, type=type, **kwds)