Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
I see gtk_cell_renderer_render() in the documentation and it has a cairo_t to draw with. I haven't tried to subclass from a treeview and override the rendering. Something I should probably figure out. Do you know of an example of doing something like this in C? Maybe I can put together a

Re: TreeView - set border on individual cells

2019-04-06 Thread Emmanuele Bassi via gtk-app-devel-list
On Sat, 6 Apr 2019 at 20:15, wrote: > The second cairo_t is used so that the rectangle can be lined up to the > cell. If I use the cairo_t in the "draw" callback then the rectangle > doesn't line up. > You're still using: 1. the wrong window to draw on 2. deprecated API 3. a slow rendering

Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
Hi Emmanuele, The second cairo_t is used so that the rectangle can be lined up to the cell. If I use the cairo_t in the "draw" callback then the rectangle doesn't line up. Eric ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: TreeView - set border on individual cells

2019-04-06 Thread Emmanuele Bassi via gtk-app-devel-list
On Sat, 6 Apr 2019 at 19:05, Eric Cashon via gtk-app-devel-list < gtk-app-devel-list@gnome.org> wrote: > static gboolean draw_rectangle(GtkWidget *tree_view, cairo_t *cr, gpointer > data) > { > GtkTreePath *path=gtk_tree_path_new_from_indices(row_g, -1); > > g_print("Draw Rectangle %i

GtkTreeView. How to hide or show an individual cell in a row

2019-04-06 Thread Osmo Antero via gtk-app-devel-list
Hello, I am making a GTK3 application with GtkTreeView listing. The simple listing will show country flags + names and number of radio-channels (to later choose from). I want to show a button or icon in a column (in the cell) when the row has been selected. Otherwise the cell should be empty

Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, I gave what you said a try and it looks to work well enough. Then, how do you get a box around a selected cell. It seems to me if you let the built in renderer do it's thing and then get a cairo_t to just draw a rectangle after, it should work, right? OK, a bit of a hack but it