diff options
badwolf.c: Use position property
Thanks to Chris for the help: https://social.libre.fi/objects/2a8d7707-97ca-4139-84e5-025a3502662b
1 files changed, 4 insertions, 5 deletions
| -rw-r--r-- | badwolf.c | 9 |
@@ -433,13 +433,12 @@ void closeCb_clicked(GtkButton *close, gpointer user_data) (void)close; struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - GValue *position; + GValue position = G_VALUE_INIT; + g_value_init (&position, G_TYPE_INT); - gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", position); + gtk_container_child_get_property(GTK_CONTAINER(notebook), browser->box, "position", &position); - gint *page_pos = (gint *)g_value_peek_pointer(position); - - gtk_notebook_remove_page(notebook, *page_pos); + gtk_notebook_remove_page(notebook, g_value_get_int(&position)); free(browser); } |