Beispiel #1
0
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