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

📄 comboboxentrybasic.py

📁 pygtk的教程
💻 PY
字号:
#!/usr/bin/env pythonimport pygtkpygtk.require('2.0')import gtkclass ComboBoxEntryExample:    def __init__(self):        window = gtk.Window()        window.connect('destroy', lambda w: gtk.main_quit())        comboboxentry = gtk.combo_box_entry_new_text()        window.add(comboboxentry)        comboboxentry.append_text('Apple')        comboboxentry.append_text('Cherry')        comboboxentry.append_text('Blueberry')        comboboxentry.append_text('Grape')        comboboxentry.append_text('Peach')        comboboxentry.append_text('Raisin')        comboboxentry.child.connect('changed', self.changed_cb)        comboboxentry.set_active(0)        window.show_all()        return    def changed_cb(self, entry):        print 'I like', entry.get_text(), 'pie'        returndef main():    gtk.main()    returnif __name__ == "__main__":    bcb = ComboBoxEntryExample()    main()

⌨️ 快捷键说明

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