當前位置: 首頁>>代碼示例>>Python>>正文


Python gtk.main_quit方法代碼示例

本文整理匯總了Python中gtk.main_quit方法的典型用法代碼示例。如果您正苦於以下問題:Python gtk.main_quit方法的具體用法?Python gtk.main_quit怎麽用?Python gtk.main_quit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gtk的用法示例。


在下文中一共展示了gtk.main_quit方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def __init__(self):
        super(TestForm, self).__init__()

        self.set_title("Key test")
        self.set_size_request(200, 200)
        self.set_position(gtk.WIN_POS_CENTER)

        fixed = gtk.Fixed()

        entry = gtk.Entry()
        fixed.put(entry, 10, 10)

        entry.connect("key_press_event", self.on_key_press_event)

        self.connect("destroy", gtk.main_quit)
        self.add(fixed)
        self.show_all()

        # Clean the text file:
        input_file = open("/tmp/autotest-rv_input", "w")
        input_file.close() 
開發者ID:avocado-framework,項目名稱:avocado-vt,代碼行數:23,代碼來源:key_event_form.py

示例2: quit

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def quit(self, widget, event=None):
		"""Asks if user would like to save file before quitting, then quits the program."""
		if self.toSave:
			if self.oneConfigFile:
				response = gtk.RESPONSE_YES
			else:
				dialog = gtk.Dialog("Save config?", self, gtk.DIALOG_MODAL, (gtk.STOCK_YES, gtk.RESPONSE_YES, gtk.STOCK_NO, gtk.RESPONSE_NO, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
				dialog.get_content_area().add(gtk.Label("Save config before quitting?"))
				dialog.get_content_area().set_size_request(300, 100)
				dialog.show_all()
				response = dialog.run()
				dialog.destroy()

			if response == gtk.RESPONSE_CANCEL:
				return True							# Return True to stop it quitting when we hit "Cancel"
			elif response == gtk.RESPONSE_NO:
				gtk.main_quit()
			elif response == gtk.RESPONSE_YES:
				self.save()
				gtk.main_quit()
		else:
			gtk.main_quit() 
開發者ID:milisarge,項目名稱:malfs-milis,代碼行數:24,代碼來源:tintwizard.py

示例3: run

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def run(self, graphic):
        window = gtk.Window()
        self.__window = window
        window.set_default_size(200, 200)
        vbox = gtk.VBox()
        window.add(vbox)
        render = GtkGraphicRenderer(graphic)
        self.__render = render
        vbox.pack_end(render, True, True, 0)
        hbox = gtk.HBox()
        vbox.pack_start(hbox, False, False, 0)
        smaller_zoom = gtk.Button("Zoom Out")
        smaller_zoom.connect("clicked", self.__set_smaller_cb)
        hbox.pack_start(smaller_zoom)
        bigger_zoom = gtk.Button("Zoom In")
        bigger_zoom.connect("clicked", self.__set_bigger_cb)
        hbox.pack_start(bigger_zoom)
        output_png = gtk.Button("Output Png")
        output_png.connect("clicked", self.__output_png_cb)
        hbox.pack_start(output_png)
        window.connect('destroy', gtk.main_quit)
        window.show_all()
        #gtk.bindings_activate(gtk.main_quit, 'q', 0)
        gtk.main() 
開發者ID:ntu-dsi-dcn,項目名稱:ntu-dsi-dcn,代碼行數:26,代碼來源:grid.py

示例4: _hijack_gtk

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def _hijack_gtk(self):
        """Hijack a few key functions in GTK for IPython integration.

        Modifies pyGTK's main and main_quit with a dummy so user code does not
        block IPython.  This allows us to use %run to run arbitrary pygtk
        scripts from a long-lived IPython session, and when they attempt to
        start or stop

        Returns
        -------
        The original functions that have been hijacked:
        - gtk.main
        - gtk.main_quit
        """
        def dummy(*args, **kw):
            pass
        # save and trap main and main_quit from gtk
        orig_main, gtk.main = gtk.main, dummy
        orig_main_quit, gtk.main_quit = gtk.main_quit, dummy
        return orig_main, orig_main_quit 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:22,代碼來源:gtkembed.py

示例5: on_request

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def on_request(view, frame, resource, request, response, 
               resource_regexp, skip_regexp=None):
    """Check if requested resource matches the video resource_regexp regexp."""
    url = request.get_uri()
    message = request.get_property("message")
    if not message:
        return
    method = message.get_property("method")
    if skip_regexp and skip_regexp.search(url):
        # cancel the request
        request.set_uri("about:blank")
        return
    debug("request: %s %s" % (method, url))
    if resource_regexp and re.search(resource_regexp, url):
        debug("videofile match: %s" % url)
        print url
        gtk.main_quit() 
開發者ID:ActiveState,項目名稱:code,代碼行數:19,代碼來源:recipe-577167.py

示例6: inputhook

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def inputhook(context):
    """
    When the eventloop of prompt-toolkit is idle, call this inputhook.

    This will run the GTK main loop until the file descriptor
    `context.fileno()` becomes ready.

    :param context: An `InputHookContext` instance.
    """

    def _main_quit(*a, **kw):
        gtk.main_quit()
        return False

    gobject.io_add_watch(context.fileno(), gobject.IO_IN, _main_quit)
    gtk.main() 
開發者ID:prompt-toolkit,項目名稱:python-prompt-toolkit,代碼行數:18,代碼來源:inputhook.py

示例7: deregister_window

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def deregister_window(self, window):
        """de-register a window widget"""
        dbg('Terminator::deregister_window: de-registering %s:%s' %
                (id(window), type(window)))
        if window in self.windows:
            self.windows.remove(window)
        else:
            err('%s is not in registered window list' % window)

        if len(self.windows) == 0:
            # We have no windows left, we should exit
            dbg('no windows remain, quitting')
            gtk.main_quit() 
開發者ID:OWASP,項目名稱:NINJA-PingU,代碼行數:15,代碼來源:terminator.py

示例8: destroy

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def destroy(self, widget):
        gtk.main_quit() 
開發者ID:avocado-framework,項目名稱:avocado-vt,代碼行數:4,代碼來源:step_editor.py

示例9: quit

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def quit(self, action):
        # Make sure the step is saved (if the user wants it to be)
        self.verify_save()
        # Quit
        gtk.main_quit() 
開發者ID:avocado-framework,項目名稱:avocado-vt,代碼行數:7,代碼來源:step_editor.py

示例10: shutdown

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def shutdown(self, *args):
        gtk.main_quit() 
開發者ID:joxeankoret,項目名稱:nightmare,代碼行數:4,代碼來源:__init__.py

示例11: shutdown

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def shutdown():
    gtk.main_quit() 
開發者ID:joxeankoret,項目名稱:nightmare,代碼行數:4,代碼來源:main.py

示例12: _quit

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def _quit(self, *dummy_args):
        if self._update_timeout_id is not None:
            gobject.source_remove(self._update_timeout_id)
            self._update_timeout_id = None
        self.simulation.quit = True
        self.simulation.go.set()
        self.simulation.join()
        gtk.main_quit() 
開發者ID:ntu-dsi-dcn,項目名稱:ntu-dsi-dcn,代碼行數:10,代碼來源:core.py

示例13: _main_quit

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def _main_quit(*args, **kwargs):
    gtk.main_quit()
    return False 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:5,代碼來源:inputhookgtk.py

示例14: on_quit

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def on_quit(self, widget, data=None):
        gtk.main_quit() 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:4,代碼來源:gtk_tray.py

示例15: destroy

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import main_quit [as 別名]
def destroy(widget, data=None):
        gtk.main_quit() 
開發者ID:fabioz,項目名稱:PyDev.Debugger,代碼行數:4,代碼來源:gui-gtk.py


注:本文中的gtk.main_quit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。