在Windows下的python2.3中安裝 pyGTK

來源:互聯網
上載者:User
在Windows下的python2.3中安裝 pyGTK,裝的時候版本老是出問題,試了幾次才實驗成功,

python2.3.3
pygtk-2.2.0.win32-py2.3.exe(或pygtk-2.2.0-1.win32-py2.3.exe)
GTK-Runtime-Environment-2.2.4.exe(或GTK-Runtime-Environment-2.2.4.2.exe)

就安裝上面的就可以,如果機器上還裝有其他GTK的東西,
很難保證版本了,
GTK-Runtime-Environment-2.2.4.exe 安裝好了後,
把C:/Program Files/Common Files/GTK/2.0/lib(具體安裝路徑)加到path中,
這個是它的動態串連庫全在這裡面。

pygtk-2.2.0.win32-py2.3.exe 這裡有: http://www.pcpm.ucl.ac.be/~gusti n/win32_ports/binaries/pygtk-2.2.0.win32-py2.3.exe

pygtk-2.2.0-1.win32-py2.3.exe 這裡有: http://www.pcpm.ucl.ac.be/~gus tin/win32_ports/binaries/pygtk-2.2.0-1.win32-py2.3.exe

GTK-Runtime-Environment-2.2.4.exe 這裡有: http://www.org.lcs.mit.edu/6.893/files/GTK -Runtime-Environment-2.2.4.exe
在sourceforge.net上也是有的:http://sourceforge.net/projects/gtk-win/

工具推薦:glade2 http://gladewin32.sourceforge.net/

測試代碼

code:


import gtk

def hello_cb(button):
print "Hello World"
window.destroy()

window = gtk.Window(gtk.WINDOW_TOPLEVEL) # create a top level window
window.connect("destroy", gtk.mainquit) # quit the event loop on destruction
window.set_border_width(10) # set padding round child widget

button = gtk.Button("Hello World")
button.connect("clicked", hello_cb) # call hello_cb when clicked
window.add(button) # add button to window
button.show() # show button

window.show()
gtk.main()

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.