Example #1
0
    def __init__(self, args):
        settings = Settings()
        builder  = settings.returnBuilder()

        # Gets the methods from the classes and sets to handler.
        # Then, builder connects to any signals it needs.
        classes  = [Signals(settings)]

        handlers = {}
        for c in classes:
            methods = None
            try:
                methods = inspect.getmembers(c, predicate=inspect.ismethod)
                handlers.update(methods)
            except Exception as e:
                pass

        builder.connect_signals(handlers)
        window = settings.createWindow()
        window.show()
Example #2
0
    def __init__(self):
        setproctitle('GWinWrap')
        GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT,
                             gtk.main_quit)
        faulthandler.enable()  # For better debug info

        settings = Settings()
        builder = settings.returnBuilder()

        # Gets the methods from the classes and sets to handler.
        # Then, builder connects to any signals it needs.
        classes = [CrossClassSignals(settings)]

        handlers = {}
        for c in classes:
            methods = inspect.getmembers(c, predicate=inspect.ismethod)
            handlers.update(methods)

        builder.connect_signals(handlers)
        window = settings.createWindow()
        window.show()