0
出於某種原因,嘗試使用PyGTK的時候獲取或設置網格線,當我得到「沒有屬性」的錯誤:PyGTK - grid_lines缺失?
import gtk
t = gtk.TreeView()
print t.get_grid_lines()
給出:
'AttributeError: 'gtk.TreeView' object has no attribute 'get_grid_lines'
下面是相關文件條目:http://www.pygtk.org/docs/pygtk/class-gtktreeview.html#method-gtktreeview--get-grid-lines
而我的pyGTK版本是2.4.1,我的gtk版本是2.4.9,這讓我不知道爲什麼當其他所有工作都無法使用這個函數。
哈,愚蠢的我,我在做2.10 = 2.1這是不到2.4 ... – Jazcash
是的,你必須在比較版本號時忘記數學規則。 –