示例#1
0
    ## deletePrinterFromClass
    ## deleteClass
    ## setDefault
    ## enablePrinter
    ## disablePrinter
    ## acceptJobs
    ## rejectJobs
    ## adminGetServerSettings
    ## adminSetServerSettings
    ## ...

if __name__ == '__main__':
    from gi.repository import GObject
    GObject.threads_init ()
    from debug import set_debugging
    set_debugging (True)
    class UI:
        def __init__ (self):
            w = Gtk.Window ()
            v = Gtk.VBox ()
            w.add (v)
            b = Gtk.Button ("Go")
            v.pack_start (b, False, False, 0)
            b.connect ("clicked", self.button_clicked)
            b = Gtk.Button ("Fetch")
            v.pack_start (b, False, False, 0)
            b.connect ("clicked", self.fetch_clicked)
            b.set_sensitive (False)
            self.fetch_button = b
            b = Gtk.Button ("Cancel job")
            v.pack_start (b, False, False, 0)
    ## deletePrinterFromClass
    ## deleteClass
    ## setDefault
    ## enablePrinter
    ## disablePrinter
    ## acceptJobs
    ## rejectJobs
    ## adminGetServerSettings
    ## adminSetServerSettings
    ## ...


if __name__ == '__main__':
    from gi.repository import GObject
    from debug import set_debugging
    set_debugging(True)

    class UI:
        def __init__(self):
            w = Gtk.Window()
            v = Gtk.VBox()
            w.add(v)
            b = Gtk.Button.new_with_label("Go")
            v.pack_start(b, False, False, 0)
            b.connect("clicked", self.button_clicked)
            b = Gtk.Button.new_with_label("Fetch")
            v.pack_start(b, False, False, 0)
            b.connect("clicked", self.fetch_clicked)
            b.set_sensitive(False)
            self.fetch_button = b
            b = Gtk.Button.new_with_label("Cancel job")