Python 和 GTK3:如何创建 Liststore

5 投票
1 回答
1093 浏览
提问于 2025-04-17 02:10

在PyGtk中,我总是用这个方法来创建一个带有图片的列表存储(我用它和IconView一起显示文件):

store = gtk.ListStore(str, gtk.gdk.Pixbuf, bool)

但是我现在不知道如何在Python 3和PyGObject中做到这一点。

1 个回答

8

下面是操作方法:

from gi.repository import Gtk, GdkPixbuf
store = Gtk.ListStore(str, GdkPixbuf.Pixbuf, bool)

撰写回答