gtktreeview

Change selected row in gtk_tree_selection from C function

て烟熏妆下的殇ゞ 提交于 2021-02-11 11:44:46
问题 I have some efficiency concerns in my application using GTK3 and hope you can provide some help. I have a gtk_list_store that is shown within a gtk_tree_view. The tree view allows selecting multiple rows. I have connected a callback function to the "changed" event of the tree_selection. This callback is called whenever the user selects or unselects any row. Then some calculations are done and some images and contents of other gtk widgets are updated accordingly. This is fine so far. I also

Change selected row in gtk_tree_selection from C function

徘徊边缘 提交于 2021-02-11 11:44:31
问题 I have some efficiency concerns in my application using GTK3 and hope you can provide some help. I have a gtk_list_store that is shown within a gtk_tree_view. The tree view allows selecting multiple rows. I have connected a callback function to the "changed" event of the tree_selection. This callback is called whenever the user selects or unselects any row. Then some calculations are done and some images and contents of other gtk widgets are updated accordingly. This is fine so far. I also

How to make a column with a string and pixbuf in GtkTreeview?

眉间皱痕 提交于 2021-01-27 07:45:33
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

让人想犯罪 __ 提交于 2021-01-27 07:44:57
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

我是研究僧i 提交于 2021-01-27 07:44:53
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

Row Background Color GtkTreeView Widget

血红的双手。 提交于 2020-06-27 16:54:14
问题 I'm attempting to color disabled rows in a gtk tree view widget a light gray color. From what I've read, I'm supposed to set the background-gdk property of the corresponding cellrenderer and bind it to a model column. This sort of works. Gtk::CellRendererText* textRenderer = manage(new Gtk::CellRendererText()); textRenderer->property_editable() = false; Gtk::TreeViewColumn *col = manage(new Gtk::TreeViewColumn("Column1", *textRenderer)); col->add_attribute(*textRenderer, "background-gdk", m

How to manually draw the GtkTreeView expander

三世轮回 提交于 2020-01-17 14:03:48
问题 I'm using a GtkTreeView widget and I want to change the appearance of the "expander" icon that opens and closes child rows: I want the icons to be the triangels that we're all familiar with, but they're appearing as boxed "+" and "-" symbols instead. At first I thought there must be a style enumeration that I can set, but I cannot find one. Then, I thought maybe there's a style property I can set in my theme's gtkrc file, but I don't think there is one. Finally, I resorted to trying to

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

笑着哭i 提交于 2019-12-30 20:00:53
问题 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

How do I capture the selected row and column in a TreeView in PyGTK?

随声附和 提交于 2019-12-24 12:35:20
问题 I have a table created using gtk.TreeView . I want to know which row and column is selected by the user. How is this possible? 回答1: The methods for the rows you want are gtk.TreeSelection.get_selected or gtk.TreeSelection.get_selected_rows, depending on the selection method you have chosen (SELECTION_SINGLE, SELECTION_MULTIPLE OR SELECTION_BROWSE). http://www.pygtk.org/docs/pygtk/class-gtktreeselection.html#method-gtktreeselection--get-selected For columns you would work with gtk.TreeView.get

Python PyGOobject treeview: confirm edit after move between cells with Tab key

时光怂恿深爱的人放手 提交于 2019-12-23 02:19:25
问题 After searching for a long time I found a solution (pretty simple) to move between cells of a treeview grid using Tab key and mantaining cells in edit mode. Now I've got a problem: cell edit confirmation happens only after pressing Enter key. If I press Tab key a editing_canceled event appears to be triggered. How to solve it? How to permit the data confirmation also on tab key press? This is my event handler for treeview key-press-event: def key_tree_Tab(self, treeview, event,namewidget):