⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example-1.py

📁 Developing with Gnome一书examples例子代码
💻 PY
字号:
#!/usr/bin/env python# This program displays a simple window and has a simple callback for# when the OK button is clicked.import gtkimport gtk.glade# libglade needs some way to lookup the handler functions; defining# them in a class provides an easy way to do thatclass GladeHandlers:  def ok_button_clicked(ok_button):    print "Thanks for trying out my program."    gtk.main_quit()  # No predefined helper functions exist--all must be manually declared.  def gtk_main_quit(window, event):    gtk.main_quit()# load the interfacemain_window = gtk.glade.XML('../example-1.glade')# connect the signals in the interfacemain_window.signal_autoconnect(GladeHandlers.__dict__)# start the event loopgtk.main()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -