Eliminate deprecated GtkAlignment stuff.

master
Kim Woelders 6 years ago
parent e1435dab2e
commit c0f536108a
  1. 9
      ipc.c
  2. 50
      viewer.c

@ -161,16 +161,13 @@ CommsFilter(GdkXEvent * gdk_xevent, GdkEvent * event __UNUSED__,
}
if (!comms_win)
{
GtkWidget *win, *label, *align, *frame, *button,
*vbox;
GtkWidget *win, *frame, *vbox, *label, *button;
win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_resizable(GTK_WINDOW(win), FALSE);
gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
gtk_container_set_border_width(GTK_CONTAINER(align), 32);
vbox = gtk_vbox_new(FALSE, 5);
button = gtk_button_new_with_label("Bye bye!");
g_signal_connect(G_OBJECT(button), "clicked",
@ -185,8 +182,8 @@ CommsFilter(GdkXEvent * gdk_xevent, GdkEvent * event __UNUSED__,
"idea of losing Enlightenment. I'm going to jump and\n"
"don't try and stop me.\n" "\n");
gtk_container_add(GTK_CONTAINER(win), frame);
gtk_container_add(GTK_CONTAINER(frame), align);
gtk_container_add(GTK_CONTAINER(align), vbox);
gtk_container_add(GTK_CONTAINER(vbox), vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 32);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_widget_show_all(win);

@ -279,20 +279,20 @@ clist_row_moveto(GtkWidget * widget, int row)
static void
e_cb_key_change(GtkWidget * widget __UNUSED__, gpointer data __UNUSED__)
{
GtkWidget *win, *label, *frame, *align;
GtkWidget *win, *frame, *vbox, *label;
win = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_MOUSE);
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
gtk_container_set_border_width(GTK_CONTAINER(align), 32);
vbox = gtk_vbox_new(FALSE, 5);
label = gtk_label_new("Please press the key on the keyboard\n"
"you wish to modify this keyboard-shortcut\n"
"to use from now on.");
gtk_container_add(GTK_CONTAINER(win), frame);
gtk_container_add(GTK_CONTAINER(frame), align);
gtk_container_add(GTK_CONTAINER(align), label);
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_container_add(GTK_CONTAINER(vbox), label);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 32);
gtk_widget_show_all(win);
while (gtk_events_pending())
gtk_main_iteration();
@ -701,7 +701,6 @@ create_list_window(void)
GtkWidget *scrollybit;
GtkWidget *vbox;
GtkWidget *frames;
GtkWidget *alignment;
GtkWidget *frame_vbox;
GtkWidget *table;
GtkWidget *label;
@ -897,46 +896,39 @@ create_list_window(void)
#endif
gtk_box_pack_start(GTK_BOX(frame_vbox), table, FALSE, FALSE, 2);
alignment = gtk_alignment_new(1.0, 0.5, 0, 0);
label = gtk_label_new("Key:");
gtk_container_add(GTK_CONTAINER(alignment), label);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
#if USE_GTK == 3
gtk_widget_set_hexpand(alignment, GTK_FILL);
gtk_grid_attach(GTK_GRID(table), alignment, 0, 0, 1, 1);
gtk_widget_set_halign(label, GTK_ALIGN_END);
gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
#else
gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 0, 1,
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
GTK_FILL, (GtkAttachOptions) (0), 0, 0);
#endif
alignment = gtk_alignment_new(1.0, 0.5, 0, 0);
label = gtk_label_new("Modifier:");
gtk_container_add(GTK_CONTAINER(alignment), label);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
#if USE_GTK == 3
gtk_widget_set_hexpand(alignment, GTK_FILL);
gtk_grid_attach(GTK_GRID(table), alignment, 0, 1, 1, 1);
gtk_widget_set_halign(label, GTK_ALIGN_END);
gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
#else
gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 1, 2,
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
GTK_FILL, (GtkAttachOptions) (0), 0, 0);
#endif
alignment = gtk_alignment_new(1.0, 0.5, 0, 0);
label = gtk_label_new("Command:");
gtk_container_add(GTK_CONTAINER(alignment), label);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
#if USE_GTK == 3
gtk_widget_set_hexpand(alignment, GTK_FILL);
gtk_grid_attach(GTK_GRID(table), alignment, 0, 2, 1, 1);
gtk_widget_set_halign(label, GTK_ALIGN_END);
gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
#else
gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 2, 3,
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
GTK_FILL, (GtkAttachOptions) (0), 0, 0);
#endif
act_key = entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(entry), 4096);
gtk_widget_set_sensitive(entry, FALSE);
/* gtk_widget_set_usize(entry, 24, -1); */
#if USE_GTK == 3
gtk_widget_set_hexpand(entry, GTK_EXPAND | GTK_FILL);
gtk_grid_attach(GTK_GRID(table), entry, 1, 0, 1, 1);
@ -1200,14 +1192,12 @@ main(int argc, char *argv[])
if (CommsInit(receive_ipc_msg))
{
GtkWidget *win, *label, *align, *frame, *button, *vbox;
GtkWidget *win, *frame, *vbox, *label, *button;
win = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
frame = gtk_frame_new(NULL);
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
align = gtk_alignment_new(0.0, 0.0, 0.0, 0.0);
gtk_container_set_border_width(GTK_CONTAINER(align), 32);
vbox = gtk_vbox_new(FALSE, 5);
button = gtk_button_new_with_label("Quit");
g_signal_connect(G_OBJECT(button), "clicked",
@ -1217,8 +1207,8 @@ main(int argc, char *argv[])
"This window manager has to be running in order\n"
"to configure it.\n" "\n");
gtk_container_add(GTK_CONTAINER(win), frame);
gtk_container_add(GTK_CONTAINER(frame), align);
gtk_container_add(GTK_CONTAINER(align), vbox);
gtk_container_add(GTK_CONTAINER(frame), vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 32);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
gtk_widget_show_all(win);

Loading…
Cancel
Save