Re: TreeView - set border on individual cells



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 %i\n", row_g, column_g);
    GdkWindow *win=gtk_tree_view_get_bin_window(GTK_TREE_VIEW(tree_view));
    cairo_t *cr2=gdk_cairo_create(win);


Don't ever do this.

There's a reason why you're getting a deprecation warning: you're already
getting a Cairo context from the "draw" signal; use that to draw. There's
no reason whatsoever to create a new Cairo context for a GdkWindow in GTK3.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]