现在已弃用的 self.window 的替代品是什么?

问题描述

我使用 Python 3 和 GTK 3 运行 rhel8 移植使用 Python 2.7 和 Gtk 2 的脚本。

运行脚本报错:'X'对象没有属性'window',以前版本的python和gtk没有报错。

class XWindow(Gtk.Window):
     def __init__(self,wtype = Gtk.WindowType.TOPLEVEL):
          Gtk.Window.__init__(self,wtype)
class X(XWindow):
     def __init__(self,vpos,mgr):
         XWindow.__init__( self )
         ...
         ...
         ...
     def XFunction:
         if self.window:
            ...
            ...
            self.window.property_change(...)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)