Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python & GTK3: How to create a Liststore

In PyGtk I always used this to create a ListStore with an Image (using it with an IconView for displaying files):

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

But I can't figure out how to do this with Python 3 and PyGObject.

like image 442
jgillich Avatar asked Sep 13 '11 04:09

jgillich


People also ask

What is Python used for?

Python is commonly used for developing websites and software, task automation, data analysis, and data visualization. Since it's relatively easy to learn, Python has been adopted by many non-programmers such as accountants and scientists, for a variety of everyday tasks, like organizing finances.

What are basics of Python?

Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.

How much does Python cost?

Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use.

What is the best use of Python?

Python is often used as a support language for software developers, for build control and management, testing, and in many other ways. SCons for build control. Buildbot and Apache Gump for automated continuous compilation and testing. Roundup or Trac for bug tracking and project management.


1 Answers

Here's how:

from gi.repository import Gtk, GdkPixbuf
store = Gtk.ListStore(str, GdkPixbuf.Pixbuf, bool)
like image 100
ptomato Avatar answered Oct 25 '22 06:10

ptomato