glade2.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:wahcade 作者: sairuk 项目源码 文件源码
def __init__(self, glade_filename, window_name, app_name=None):
        #load glade file
        if app_name:
            self.xml = gtk.glade.XML(glade_filename, window_name, app_name)
        else:
            self.xml = gtk.glade.XML(glade_filename, window_name)
        #find and store methods as bound callbacks
        callbacks = {}
        class_methods = self.__class__.__dict__
        for method_name in class_methods.keys():
            method = class_methods[method_name]
            if type(method) == types.FunctionType:
                callbacks[method_name] = new.instancemethod(method, self, self.__class__)
        #autoconnect signals
        self.xml.signal_autoconnect(callbacks)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号