X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/9e9fc4ae6614f09033c6a409dc9f70519884d1c7..e4ba53fd52e3731b61b0959722be44d86794206c:/disobedience/choose.c diff --git a/disobedience/choose.c b/disobedience/choose.c index 565902d..24aa9f6 100644 --- a/disobedience/choose.c +++ b/disobedience/choose.c @@ -596,7 +596,9 @@ static void redisplay_tree(void) { files_selected = 0; files_visible = 0; /* Correct the layout and find out how much space it uses */ + MTAG_PUSH("display_tree"); d = display_tree(root, 0, 0); + MTAG_POP(); /* We must set the total size or scrolling will not work (it wouldn't be hard * for GtkLayout to figure it out for itself but presumably you're supposed * to be able to have widgets off the edge of the layuot.) @@ -630,6 +632,7 @@ static struct displaydata display_tree(struct choosenode *cn, int x, int y) { * A non-expandable item has just a text label and no arrow. */ if(!cn->container) { + MTAG_PUSH("make_widgets_1"); /* Widgets need to be created */ NW(hbox); cn->hbox = gtk_hbox_new(FALSE, 1); @@ -646,6 +649,8 @@ static struct displaydata display_tree(struct choosenode *cn, int x, int y) { cn->marker = gtk_image_new_from_pixbuf(pb); } } + MTAG_POP(); + MTAG_PUSH("make_widgets_2"); NW(label); cn->label = gtk_label_new(cn->display); if(cn->arrow) @@ -653,6 +658,8 @@ static struct displaydata display_tree(struct choosenode *cn, int x, int y) { gtk_container_add(GTK_CONTAINER(cn->hbox), cn->label); if(cn->marker) gtk_container_add(GTK_CONTAINER(cn->hbox), cn->marker); + MTAG_POP(); + MTAG_PUSH("make_widgets_3"); NW(event_box); cn->container = gtk_event_box_new(); gtk_container_add(GTK_CONTAINER(cn->container), cn->hbox); @@ -665,6 +672,7 @@ static struct displaydata display_tree(struct choosenode *cn, int x, int y) { gtk_widget_set_name(cn->container, "choose"); /* Show everything by default */ gtk_widget_show_all(cn->container); + MTAG_POP(); } assert(cn->container); /* Make sure the icon is right */ @@ -682,6 +690,8 @@ static struct displaydata display_tree(struct choosenode *cn, int x, int y) { else { gtk_layout_put(GTK_LAYOUT(chooselayout), cn->container, x, y); cn->flags |= CN_DISPLAYED; + /* Now chooselayout has a ref to the container */ + g_object_unref(cn->container); } /* Set the widget's selection status */ if(!(cn->flags & CN_EXPANDABLE))