gtktreeview

How to set multiple items into a GtkSelection for Treeview drag and drop

别说谁变了你拦得住时间么 提交于 2019-12-04 20:59:37
My current project uses a Gtk.TreeView to display the contents of a ListView with four fields per row, two strings, an int and a boolean . I'm trying to implement drag and drop rearrangement of rows in the TreeView. I don't want simply to use TreeView.set_reorderable(True) for the built-in drag and drop because I want to have some control over the insertion and deletion of data from the model as well as to be able to implement undo/redo of drag and drop operations. I'm using Python 3.2 and PyGObject 3. The problem I'm now having is figuring out how in my drag_data_get method to set the

GTK+ 3.0: How to use a Gtk.TreeStore with custom model items?

♀尐吖头ヾ 提交于 2019-12-03 13:34:22
问题 I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a gtk.TreeStore. My main problem: I've already parsed some JSON and I have my own data structure which ist basically a Python list and two kinds of objects: One represents a collection of items (collections can't be nested) and one for representing items (which might appear in the list as well as in a collection). I'm already familiar with the basic usage of a TreeStore and managed to get items

How do you change alternating background row colors of a gtk.TreeView in pygtk?

醉酒当歌 提交于 2019-12-01 18:33:22
I'm trying to change the alternating background color of a treeview. I know that this should normally be left up to the theme, but I'd like to override to test the gtk Style functionality. According to the treeview documentation here , I learned that the TreeView has several style options that are Read-only, including "even-row-color", "odd-row-color" and "allow-rules"(which according to the documentation, allows drawing of even and odd row colors). And I know that in order to override those Read-only settings I've got to change the style in a gtkrc-style file or string. So my string for a

Changing the selected item colour in a GtkTreeview using python

纵饮孤独 提交于 2019-12-01 17:32:36
I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background. The row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, "#C4C4C4") , but no colours work well with the colours used to enhance the concept of priority. I had the idea to change the selection colour to be a slightly darker version of the colour used as the normal row background, so in the example above, that would be a darker red. I tried

Changing the selected item colour in a GtkTreeview using python

本小妞迷上赌 提交于 2019-12-01 17:11:48
问题 I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background. The row selection color is not so easy to change. I can set it using treeview.modify_base(gtk.STATE_SELECTED, "#C4C4C4") , but no colours work well with the colours used to enhance the concept of priority. I had the idea to change the selection colour to be a slightly darker version of the

How to list directory hierarchy in GtkTreeView widget?

半世苍凉 提交于 2019-11-30 16:33:00
I am trying to generate a hierarchical directory listing in pyGTK. Currently, I have this following directory tree: /root folderA - subdirA - subA.py - a.py folderB - b.py I have written a function that -almost- seem to work: def go(root, piter=None): for filename in os.listdir(root): isdir = os.path.isdir(os.path.join(root, filename)) piter = self.treestore.append(piter, [filename]) if isdir == True: go(os.path.join(root, filename), piter) This is what i get when i run the app: I also think my function is inefficient and that i should be using os.walk(), since it already exists for such

Is this possible to draw GtkTreeView listed like GtkIconView?

余生长醉 提交于 2019-11-29 11:59:33
I am working on a GTK+ application written in python. I obviously use PyGtk. My application is about collections of videos. It's a kind of F-spot or Picasa, but for video. As you can see in these two apps, you have a central area where you can see all of your photos with tag thumbnails under. In my app, I want to implement the same kinf of view. For now I simply use this: A gtk.Table containing a VBox , inside the VBox a Pixbuf (my video thumbnail) and a HBox , and inside the HBox , as many Pixbuf as tags. It's working but it's ugly and It seems like It's not the better solution. Looking

gtk treeview: place image buttons on rows

亡梦爱人 提交于 2019-11-29 10:36:37
For each row in my treeview, I want 4 image buttons next to each other. They will act like radio buttons, with only one being activateable at a time. Each button has an 'on' and 'off' image. How do I do this? I figured out how to put images there, and how to put togglebuttons, but this seems to require some more effort as there is no pre-built cellrenderer that does what I want. Basically what'd solve my problem is figuring out how to make an image in a gtk.treeview clickable. any ideas? Have a look at this ' http://www.daa.com.au/pipermail/pygtk/2010-March/018355.html '. It shows you how to

Is this possible to draw GtkTreeView listed like GtkIconView?

試著忘記壹切 提交于 2019-11-28 06:04:34
问题 I am working on a GTK+ application written in python. I obviously use PyGtk. My application is about collections of videos. It's a kind of F-spot or Picasa, but for video. As you can see in these two apps, you have a central area where you can see all of your photos with tag thumbnails under. In my app, I want to implement the same kinf of view. For now I simply use this: A gtk.Table containing a VBox , inside the VBox a Pixbuf (my video thumbnail) and a HBox , and inside the HBox , as many

gtk treeview: place image buttons on rows

≡放荡痞女 提交于 2019-11-28 03:59:54
问题 For each row in my treeview, I want 4 image buttons next to each other. They will act like radio buttons, with only one being activateable at a time. Each button has an 'on' and 'off' image. How do I do this? I figured out how to put images there, and how to put togglebuttons, but this seems to require some more effort as there is no pre-built cellrenderer that does what I want. Basically what'd solve my problem is figuring out how to make an image in a gtk.treeview clickable. any ideas? 回答1: