コード例 #1
0
ファイル: dialog.py プロジェクト: RaumZeit/gdesklets-core
def error(primary, secondary):

    dialog = HIGDialog((gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE),
                       _ERROR, primary, secondary)
    gtk.threads_enter()
    dialog.run()
    gtk.threads_leave()
    sys.exit(1337)
コード例 #2
0
ファイル: dialog.py プロジェクト: RaumZeit/gdesklets-core
def _configurable(icon, primary, secondary, *buttons):

    def responder(src, response):
        callback = buttons[response][1]
        # Before calling back, check to see if it's callable
        if (callback and hasattr(callback, '__call__')): callback()

    response = 0
    btns = []
    for label, callback in buttons:
        btns.append(label)
        btns.append(response)
        response += 1

    dialog = HIGDialog(tuple(btns), icon, primary, secondary)
    dialog.connect("response", responder)
    return dialog