mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Do not use deprecated GtkNoteBook api in testgtk
This commit is contained in:
parent
7065c566a3
commit
901105766e
@ -24,7 +24,6 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#undef GTK_DISABLE_DEPRECATED
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@ -6700,38 +6699,17 @@ page_switch (GtkWidget *widget, GtkNotebookPage *page, gint page_num)
|
||||
static void
|
||||
tab_fill (GtkToggleButton *button, GtkWidget *child)
|
||||
{
|
||||
gboolean expand;
|
||||
GtkPackType pack_type;
|
||||
|
||||
gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
&expand, NULL, &pack_type);
|
||||
gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
expand, button->active, pack_type);
|
||||
gtk_container_child_set (GTK_CONTAINER (sample_notebook), child,
|
||||
"tab-fill", gtk_toggle_button_get_active (button),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
tab_expand (GtkToggleButton *button, GtkWidget *child)
|
||||
{
|
||||
gboolean fill;
|
||||
GtkPackType pack_type;
|
||||
|
||||
gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
NULL, &fill, &pack_type);
|
||||
gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
button->active, fill, pack_type);
|
||||
}
|
||||
|
||||
static void
|
||||
tab_pack (GtkToggleButton *button, GtkWidget *child)
|
||||
|
||||
{
|
||||
gboolean expand;
|
||||
gboolean fill;
|
||||
|
||||
gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
&expand, &fill, NULL);
|
||||
gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
|
||||
expand, fill, button->active);
|
||||
gtk_container_child_set (GTK_CONTAINER (sample_notebook), child,
|
||||
"tab-expand", gtk_toggle_button_get_active (button),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -6775,11 +6753,6 @@ create_pages (GtkNotebook *notebook, gint start, gint end)
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (tab_expand), child);
|
||||
|
||||
button = gtk_check_button_new_with_label ("Pack end");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5);
|
||||
g_signal_connect (button, "toggled",
|
||||
G_CALLBACK (tab_pack), child);
|
||||
|
||||
button = gtk_button_new_with_label ("Hide Page");
|
||||
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 5);
|
||||
g_signal_connect_swapped (button, "clicked",
|
||||
@ -6894,13 +6867,6 @@ notebook_popup (GtkToggleButton *button,
|
||||
gtk_notebook_popup_disable (notebook);
|
||||
}
|
||||
|
||||
static void
|
||||
notebook_homogeneous (GtkToggleButton *button,
|
||||
GtkNotebook *notebook)
|
||||
{
|
||||
g_object_set (notebook, "homogeneous", button->active, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
create_notebook (GtkWidget *widget)
|
||||
{
|
||||
@ -6966,12 +6932,6 @@ create_notebook (GtkWidget *widget)
|
||||
G_CALLBACK (notebook_popup),
|
||||
sample_notebook);
|
||||
|
||||
button = gtk_check_button_new_with_label ("homogeneous tabs");
|
||||
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, FALSE, 0);
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (notebook_homogeneous),
|
||||
sample_notebook);
|
||||
|
||||
box2 = gtk_hbox_new (FALSE, 5);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
|
||||
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user