Description: Port to GTK 3.
Author: Yavor Doganov <yavor@gnu.org>
Last-Update: 2019-10-18
---

--- grdesktop-0.23+d040330.orig/configure.ac
+++ grdesktop-0.23+d040330/configure.ac
@@ -45,13 +45,13 @@
 GETTEXT_PACKAGE=$PACKAGE
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext domain])
 
-dnl Searching for GTK+ 2 includes/libs and export compiler flags
-PKG_CHECK_MODULES(GTK2, [gtk+-2.0], HAVE_GTK=yes, HAVE_GTK=no)
+dnl Searching for GTK 3 includes/libs and export compiler flags
+PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.21.4], [HAVE_GTK=yes], [HAVE_GTK=no])
 if test "$HAVE_GTK" = "no"; then
-	AC_MSG_ERROR([cannot find GTK+ 2.0!])
+	AC_MSG_ERROR([cannot find GTK+ 3.0!])
 fi
-AC_SUBST(GTK2_CFLAGS)
-AC_SUBST(GTK2_LIBS)
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
 
 GLIB_GSETTINGS
 
--- grdesktop-0.23+d040330.orig/src/Makefile.am
+++ grdesktop-0.23+d040330/src/Makefile.am
@@ -23,7 +23,7 @@
 
 INCLUDES = -I$(top_srcdir) -I$(top_builddir) \
 	-I$(top_srcdir)/intl \
-	$(GTK2_CFLAGS) \
+	$(GTK_CFLAGS) \
 	-DDATADIR=\""$(datadir)"\" \
 	-DLOCALEDIR=\""$(datadir)/locale"\" \
 	-DKBPATH=\""$(kbpath)"\"
@@ -39,7 +39,7 @@
 	sshbox.c sshbox.h \
 	config.h
 
-grdesktop_LDADD = $(GTK2_LIBS)
+grdesktop_LDADD = $(GTK_LIBS)
 
 grdesktopdir = $(datadir)/applications
 grdesktop_DATA = grdesktop.desktop
--- grdesktop-0.23+d040330.orig/src/global.h
+++ grdesktop-0.23+d040330/src/global.h
@@ -88,7 +88,7 @@
 GtkWidget *input_domain;
 GtkWidget *check_savepw;
 GtkWidget *menu_rdp_proto;
-GtkObject *adj_screensize;
+GtkAdjustment *adj_screensize;
 GtkWidget *scroll_screensize;
 GtkWidget *geometry_label;
 GtkWidget *menu_colorsize;
--- grdesktop-0.23+d040330.orig/src/main.c
+++ grdesktop-0.23+d040330/src/main.c
@@ -60,8 +60,6 @@
 	GdkPixbufAnimation *animation;
 
 	window_main = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	gtk_window_set_wmclass(GTK_WINDOW(window_main),
-		"grdesktop", "grdesktop");
 	gtk_container_set_border_width(GTK_CONTAINER(window_main), 0);
 	gtk_window_set_resizable(GTK_WINDOW(window_main), FALSE);
 	gtk_window_set_title(GTK_WINDOW(window_main),
@@ -72,7 +70,7 @@
 	g_signal_connect(G_OBJECT(window_main), "destroy",
 			G_CALLBACK(destroy), NULL);
 
-	winBox = gtk_vbox_new(FALSE, 0);
+	winBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_add(GTK_CONTAINER(window_main), winBox);
 	gtk_widget_show(winBox);
 
@@ -101,13 +99,15 @@
 		}
 	}
 
-	tblBox = gtk_table_new(1, 1, TRUE);
-	gtk_container_border_width(GTK_CONTAINER(tblBox), 10);
+	tblBox = gtk_grid_new();
+	gtk_grid_set_row_homogeneous(GTK_GRID(tblBox), TRUE);
+	gtk_grid_set_column_homogeneous(GTK_GRID(tblBox), TRUE);
+	gtk_container_set_border_width(GTK_CONTAINER(tblBox), 10);
 	gtk_box_pack_start(GTK_BOX(winBox), tblBox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tblBox);
 
 	/* create the master box */
-	mainBox = gtk_vbox_new(FALSE, 15);
+	mainBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 15);
 	gtk_container_add(GTK_CONTAINER(tblBox), mainBox);
 	gtk_widget_show(mainBox);
 
--- grdesktop-0.23+d040330.orig/src/btnbox.c
+++ grdesktop-0.23+d040330/src/btnbox.c
@@ -26,35 +26,52 @@
 	GtkWidget *box;
 	GtkWidget *btnHelp;
 	GtkWidget *btnAbout;
+	GtkWidget *image;
 
-	box = gtk_hbox_new(FALSE, 10);
+	box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
 
-	btn_connect = gtk_button_new_from_stock("gtk-execute");
+	btn_connect = gtk_button_new_from_icon_name("system-run",
+	                                            GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(btn_connect), _("_Execute"));
+	gtk_button_set_use_underline(GTK_BUTTON(btn_connect), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(btn_connect), TRUE);
 	g_signal_connect(G_OBJECT(btn_connect), "clicked",
 			G_CALLBACK(sig_connect), NULL);
 	gtk_box_pack_start(GTK_BOX(box), btn_connect, FALSE, FALSE, TRUE);
 	gtk_widget_show(btn_connect);
 
-	btn_cancel = gtk_button_new_from_stock("gtk-quit");
+	btn_cancel = gtk_button_new_from_icon_name("application-exit",
+	                                           GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(btn_cancel), _("_Quit"));
+	gtk_button_set_use_underline(GTK_BUTTON(btn_cancel), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(btn_cancel), TRUE);
 	g_signal_connect(G_OBJECT(btn_cancel), "clicked",
 			G_CALLBACK(sig_cancel), NULL);
 	gtk_box_pack_start(GTK_BOX(box), btn_cancel, FALSE, FALSE, TRUE);
 	gtk_widget_show(btn_cancel);
 
-	btn_option = gtk_button_new_from_stock("gtk-go-down");
+	btn_option = gtk_button_new();
+	gtk_button_set_use_underline(GTK_BUTTON(btn_option), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(btn_option), TRUE);
 	g_signal_connect(G_OBJECT(btn_option), "clicked",
 			G_CALLBACK(sig_options), NULL);
 	gtk_box_pack_start(GTK_BOX(box), btn_option, FALSE, FALSE, FALSE);
-	gtk_button_set_use_stock(GTK_BUTTON(btn_option), TRUE);
 	gtk_widget_show(btn_option);
 
-	btnAbout = gtk_button_new_from_stock("gtk-dialog-info");
+	btnAbout = gtk_button_new_from_icon_name("dialog-information",
+	                                         GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(btnAbout), _("Information"));
+	gtk_button_set_always_show_image(GTK_BUTTON(btnAbout), TRUE);
 	g_signal_connect(G_OBJECT(btnAbout), "clicked",
 			G_CALLBACK(sig_about), NULL);
 	gtk_box_pack_end(GTK_BOX(box), btnAbout, FALSE, FALSE, FALSE);
 	gtk_widget_show(btnAbout);
 
-	btnHelp = gtk_button_new_from_stock("gtk-help");
+	btnHelp = gtk_button_new_from_icon_name("help-browser",
+	                                        GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(btnHelp), _("_Help"));
+	gtk_button_set_use_underline(GTK_BUTTON(btnHelp), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(btnHelp), TRUE);
 	g_signal_connect(G_OBJECT(btnHelp), "clicked",
 			G_CALLBACK(sig_help), NULL);
 	gtk_box_pack_end(GTK_BOX(box), btnHelp, FALSE, FALSE, FALSE);
@@ -104,15 +121,23 @@
 }
 
 void sig_options(GtkWidget *widget, gpointer data) {
+	GtkWidget *image;
+
 	if(iSHASH("showopts") == TRUE) {	/* hide options */
 		gtk_widget_hide(box_option);
 		gtk_widget_show(box_server);
-		gtk_button_set_label(GTK_BUTTON(btn_option), "gtk-go-down");
+		image = gtk_image_new_from_icon_name("go-down",
+		                                     GTK_ICON_SIZE_BUTTON);
+		gtk_button_set_label(GTK_BUTTON(btn_option), _("_Down"));
+		gtk_button_set_image(GTK_BUTTON(btn_option), image);
 		setBHASH("showopts", FALSE);
 	} else {				/* display options */
 		gtk_widget_show(box_option);
 		gtk_widget_hide(box_server);
-		gtk_button_set_label(GTK_BUTTON(btn_option), "gtk-go-up");
+		image = gtk_image_new_from_icon_name("go-up",
+		                                     GTK_ICON_SIZE_BUTTON);
+		gtk_button_set_label(GTK_BUTTON(btn_option), _("_Up"));
+		gtk_button_set_image(GTK_BUTTON(btn_option), image);
 		setBHASH("showopts", TRUE);
 	}
 }
@@ -120,7 +145,8 @@
 void sig_help(GtkWidget *widget, gpointer data) {
 	GError *err = NULL;
 
-	gtk_show_uri(NULL, "ghelp:"PACKAGE, GDK_CURRENT_TIME, &err);
+	gtk_show_uri_on_window(GTK_WINDOW(window_main), "ghelp:"PACKAGE,
+	                       GDK_CURRENT_TIME, &err);
 	if(err != NULL) {
 		GtkWidget *dlg = NULL;
 
--- grdesktop-0.23+d040330.orig/src/optbox.c
+++ grdesktop-0.23+d040330/src/optbox.c
@@ -21,6 +21,7 @@
 
 
 #include "optbox.h"
+#include "sshbox.h"
 
 GtkWidget *option_box() {
 	GtkWidget *note;
@@ -32,32 +33,32 @@
 	gtk_widget_show(note);
 
 	cpage1 = gtk_label_new(_("General"));
-	page1 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(page1), 5);
+	page1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(page1), 5);
 	gtk_notebook_insert_page(GTK_NOTEBOOK(note), page1, cpage1, -1);
 	gtk_widget_show(page1);
 	
 	cpage2 = gtk_label_new(_("Display"));
-	page2 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(page2), 5);
+	page2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(page2), 5);
 	gtk_notebook_insert_page(GTK_NOTEBOOK(note), page2, cpage2, -1);
 	gtk_widget_show(page2);
 	
 	cpage3 = gtk_label_new(_("Resources"));
-	page3 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(page3), 5);
+	page3 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(page3), 5);
 	gtk_notebook_insert_page(GTK_NOTEBOOK(note), page3, cpage3, -1);
 	gtk_widget_show(page3);
 	
 	cpage4 = gtk_label_new(_("Program"));
-	page4 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(page4), 5);
+	page4 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(page4), 5);
 	gtk_notebook_insert_page(GTK_NOTEBOOK(note), page4, cpage4, -1);
 	gtk_widget_show(page4);
 	
 	cpage5 = gtk_label_new(_("Extended"));
-	page5 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(page5), 5);
+	page5 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(page5), 5);
 	gtk_notebook_insert_page(GTK_NOTEBOOK(note), page5, cpage5, -1);
 	gtk_widget_show(page5);
 	
@@ -95,8 +96,8 @@
 	GtkWidget *image, *image2;
 	GtkWidget *tbl1, *tbl2;
 
-	box = gtk_vbox_new(FALSE, 10);
-	tbox = gtk_vbox_new(FALSE, 0);
+	box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
+	tbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_pack_start(GTK_BOX(box), tbox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbox);
 
@@ -105,16 +106,19 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame1);
 	gtk_widget_show(frame1);
 
-	uTable = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable), 0);
+	uTable = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable), 0);
 	gtk_container_add(GTK_CONTAINER(frame1), uTable);
 	gtk_widget_show(uTable);
 
 	/* create the left image container */
-	vboxLeft = gtk_vbox_new(FALSE, 0);
+	vboxLeft = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxLeft, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_vexpand(vboxLeft, TRUE);
+	gtk_widget_set_valign(vboxLeft, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_start(vboxLeft, 5);
+	gtk_widget_set_margin_end(vboxLeft, 5);
+	gtk_grid_attach(GTK_GRID(uTable), vboxLeft, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft);
 
 	image = gtk_image_new_from_file(PIXDIR"/host.png");
@@ -122,14 +126,19 @@
 	gtk_widget_show(image);
 
 	/* create the main vbox to store components */
-	vboxRight = gtk_vbox_new(FALSE, 0);
+	vboxRight = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxRight, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 10, 5);
+	gtk_widget_set_hexpand(vboxRight, TRUE);
+	gtk_widget_set_halign(vboxRight, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_start(vboxRight, 10);
+	gtk_widget_set_margin_end(vboxRight, 10);
+	gtk_widget_set_margin_top(vboxRight, 5);
+	gtk_widget_set_margin_bottom(vboxRight, 5);
+	gtk_grid_attach(GTK_GRID(uTable), vboxRight, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight);
 
 	/* create box for the top label */
-	topBox = gtk_hbox_new(FALSE, 0);
+	topBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), topBox, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox);
 
@@ -138,13 +147,15 @@
 	gtk_widget_show(topLabel);
 
 	/* create a table for the main components and fill it */
-	tbl1 = gtk_table_new(1, 2, TRUE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 0);
+	tbl1 = gtk_grid_new();
+	gtk_grid_set_row_homogeneous(GTK_GRID(tbl1), TRUE);
+	gtk_grid_set_column_homogeneous(GTK_GRID(tbl1), TRUE);
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), tbl1, FALSE, FALSE, TRUE);
 	gtk_widget_show(tbl1);
 
-	tbl1 = gtk_table_new(5, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 0);
+	tbl1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), tbl1, FALSE, FALSE, TRUE);
 	gtk_widget_show(tbl1);
 	insert_server(tbl1);
@@ -159,16 +170,19 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame2);
 	gtk_widget_show(frame2);
 
-	uTable2 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable2), 0);
+	uTable2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable2), 0);
 	gtk_container_add(GTK_CONTAINER(frame2), uTable2);
 	gtk_widget_show(uTable2);
 
 	/* create the left image container */
-	vboxLeft2 = gtk_vbox_new(FALSE, 0);
+	vboxLeft2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft2), 0);
-	gtk_table_attach(GTK_TABLE(uTable2), vboxLeft2, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_vexpand(vboxLeft2, TRUE);
+	gtk_widget_set_valign(vboxLeft2, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_start(vboxLeft2, 5);
+	gtk_widget_set_margin_end(vboxLeft2, 5);
+	gtk_grid_attach(GTK_GRID(uTable2), vboxLeft2, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft2);
 
 	image2 = gtk_image_new_from_file(PIXDIR"/folder.png");
@@ -176,14 +190,16 @@
 	gtk_widget_show(image2);
 
 	/* create the main vbox to store components */
-	vboxRight2 = gtk_vbox_new(FALSE, 0);
+	vboxRight2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight2), 0);
-	gtk_table_attach(GTK_TABLE(uTable2), vboxRight2, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight2, TRUE);
+	gtk_widget_set_halign(vboxRight2, GTK_ALIGN_FILL);
+	g_object_set(vboxRight2, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable2), vboxRight2, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight2);
 
 	/* create box for the top label */
-	topBox2 = gtk_hbox_new(FALSE, 0);
+	topBox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), topBox2, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox2);
 
@@ -192,8 +208,10 @@
 	gtk_widget_show(topLabel2);
 
 	/* create a table for the main components and fill it */
-	tbl2 = gtk_table_new(1, 2, TRUE);
-	gtk_container_border_width(GTK_CONTAINER(tbl2), 5);
+	tbl2 = gtk_grid_new();
+	gtk_grid_set_row_homogeneous(GTK_GRID(tbl2), TRUE);
+	gtk_grid_set_column_homogeneous(GTK_GRID(tbl2), TRUE);
+	gtk_container_set_border_width(GTK_CONTAINER(tbl2), 5);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), tbl2, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbl2);
 	insert_buttons(tbl2);
@@ -214,8 +232,8 @@
 	GtkWidget *tbl1;
 	GtkWidget *tbl2;
 
-	box = gtk_vbox_new(FALSE, 10);
-	tbox = gtk_vbox_new(FALSE, 0);
+	box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
+	tbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_pack_start(GTK_BOX(box), tbox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbox);
 
@@ -224,16 +242,17 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame1);
 	gtk_widget_show(frame1);
 
-	uTable = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable), 0);
+	uTable = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable), 0);
 	gtk_container_add(GTK_CONTAINER(frame1), uTable);
 	gtk_widget_show(uTable);
 
 	/* create the left image container */
-	vboxLeft = gtk_vbox_new(FALSE, 0);
+	vboxLeft = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxLeft, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_margin_start(vboxLeft, 5);
+	gtk_widget_set_margin_end(vboxLeft, 5);
+	gtk_grid_attach(GTK_GRID(uTable), vboxLeft, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft);
 
 	image = gtk_image_new_from_file(PIXDIR"/monitor.png");
@@ -241,14 +260,16 @@
 	gtk_widget_show(image);
 
 	/* create the main vbox to store components */
-	vboxRight = gtk_vbox_new(FALSE, 0);
+	vboxRight = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxRight, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight, TRUE);
+	gtk_widget_set_halign(vboxRight, GTK_ALIGN_FILL);
+	g_object_set(vboxRight, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable), vboxRight, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight);
 
 	/* create box for the top label */
-	topBox = gtk_hbox_new(FALSE, 0);
+	topBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), topBox, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox);
 
@@ -257,8 +278,8 @@
 	gtk_widget_show(topLabel);
 
 	/* create a table for the main components and fill it */
-	tbl1 = gtk_table_new(1, 2, TRUE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 10);
+	tbl1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight), tbl1, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbl1);
 	insert_screenscroll(tbl1);
@@ -268,20 +289,22 @@
 	gtk_box_pack_start(GTK_BOX(tbox), frame2, FALSE, FALSE, TRUE);
 	gtk_widget_show(frame2);
 
-	uTable2 = gtk_table_new(1, 1, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable2), 0);
+	uTable2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable2), 0);
 	gtk_container_add(GTK_CONTAINER(frame2), uTable2);
 	gtk_widget_show(uTable2);
 
 	/* create the main vbox to store components */
-	vboxRight2 = gtk_vbox_new(FALSE, 0);
+	vboxRight2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight2), 0);
-	gtk_table_attach(GTK_TABLE(uTable2), vboxRight2, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight2, TRUE);
+	gtk_widget_set_halign(vboxRight2, GTK_ALIGN_FILL);
+	g_object_set(vboxRight2, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable2), vboxRight2, 0, 0, 1, 1);
 	gtk_widget_show(vboxRight2);
 
 	/* create box for the top label */
-	topBox2 = gtk_hbox_new(FALSE, 0);
+	topBox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), topBox2, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox2);
 
@@ -289,8 +312,8 @@
 	gtk_box_pack_start(GTK_BOX(topBox2), topLabel2, FALSE, FALSE, FALSE);
 	gtk_widget_show(topLabel2);
 
-	tbl2 = gtk_table_new(2, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl2), 10);
+	tbl2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl2), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), tbl2, TRUE, TRUE, TRUE);
 	gtk_widget_show(tbl2);
 	insert_colorsel(tbl2);
@@ -310,8 +333,8 @@
 	GtkWidget *topLabel1, *topLabel2;
 	GtkWidget *tbl1, *tbl2;
 
-	box = gtk_vbox_new(FALSE, 10);
-	tbox = gtk_vbox_new(FALSE, 0);
+	box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
+	tbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_box_pack_start(GTK_BOX(box), tbox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbox);
 
@@ -320,16 +343,17 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame1);
 	gtk_widget_show(frame1);
 
-	uTable1 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable1), 0);
+	uTable1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable1), 0);
 	gtk_container_add(GTK_CONTAINER(frame1), uTable1);
 	gtk_widget_show(uTable1);
 
 	/* create the left image container */
-	vboxLeft1 = gtk_vbox_new(FALSE, 0);
+	vboxLeft1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft1), 0);
-	gtk_table_attach(GTK_TABLE(uTable1), vboxLeft1, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_margin_start(vboxLeft1, 5);
+	gtk_widget_set_margin_end(vboxLeft1, 5);
+	gtk_grid_attach(GTK_GRID(uTable1), vboxLeft1, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft1);
 
 	image1 = gtk_image_new_from_file(PIXDIR"/keyboard.png");
@@ -337,14 +361,16 @@
 	gtk_widget_show(image1);
 
 	/* create the main vbox to store components */
-	vboxRight1 = gtk_vbox_new(FALSE, 0);
+	vboxRight1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight1), 0);
-	gtk_table_attach(GTK_TABLE(uTable1), vboxRight1, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight1, TRUE);
+	gtk_widget_set_halign(vboxRight1, GTK_ALIGN_FILL);
+	g_object_set(vboxRight1, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable1), vboxRight1, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight1);
 
 	/* create box for the top label */
-	topBox1 = gtk_hbox_new(FALSE, 0);
+	topBox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight1), topBox1, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox1);
 
@@ -353,8 +379,8 @@
 	gtk_widget_show(topLabel1);
 
 	/* create a table for the main components and fill it */
-	tbl1 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 10);
+	tbl1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight1), tbl1, FALSE, FALSE, TRUE);
 	gtk_widget_show(tbl1);
 	insert_keyboard(tbl1);
@@ -364,16 +390,17 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame2);
 	gtk_widget_show(frame2);
 
-	uTable2 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable2), 0);
+	uTable2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable2), 0);
 	gtk_container_add(GTK_CONTAINER(frame2), uTable2);
 	gtk_widget_show(uTable2);
 
 	/* create the left image container */
-	vboxLeft2 = gtk_vbox_new(FALSE, 0);
+	vboxLeft2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft2), 0);
-	gtk_table_attach(GTK_TABLE(uTable2), vboxLeft2, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_margin_start(vboxLeft2, 5);
+	gtk_widget_set_margin_end(vboxLeft2, 5);
+	gtk_grid_attach(GTK_GRID(uTable2), vboxLeft2, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft2);
 
 	image2 = gtk_image_new_from_file(PIXDIR"/sound.png");
@@ -381,14 +408,16 @@
 	gtk_widget_show(image2);
 
 	/* create the main vbox to store components */
-	vboxRight2 = gtk_vbox_new(FALSE, 0);
+	vboxRight2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight2), 0);
-	gtk_table_attach(GTK_TABLE(uTable2), vboxRight2, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight2, TRUE);
+	gtk_widget_set_halign(vboxRight2, GTK_ALIGN_FILL);
+	g_object_set(vboxRight2, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable2), vboxRight2, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight2);
 
 	/* create box for the top label */
-	topBox2 = gtk_hbox_new(FALSE, 0);
+	topBox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), topBox2, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox2);
 
@@ -397,8 +426,8 @@
 	gtk_widget_show(topLabel2);
 
 	/* create a table for the main components and fill it */
-	tbl2 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl2), 10);
+	tbl2 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl2), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight2), tbl2, FALSE, FALSE, TRUE);
 	gtk_widget_show(tbl2);
 	insert_sound(tbl2);
@@ -417,8 +446,8 @@
 	GtkWidget *topLabel;
 	GtkWidget *tbl1;
 
-	box = gtk_vbox_new(FALSE, 0);
-	tbox = gtk_hbox_new(FALSE, 0);
+	box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+	tbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(box), tbox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbox);
 
@@ -427,16 +456,17 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame1);
 	gtk_widget_show(frame1);
 
-	uTable = gtk_table_new(1, 6, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable), 0);
+	uTable = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable), 0);
 	gtk_container_add(GTK_CONTAINER(frame1), uTable);
 	gtk_widget_show(uTable);
 
 	/* create the left image container */
-	vboxLeft = gtk_vbox_new(FALSE, 0);
+	vboxLeft = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxLeft, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_margin_start(vboxLeft, 5);
+	gtk_widget_set_margin_end(vboxLeft, 5);
+	gtk_grid_attach(GTK_GRID(uTable), vboxLeft, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft);
 
 	image = gtk_image_new_from_file(PIXDIR"/program.png");
@@ -444,14 +474,16 @@
 	gtk_widget_show(image);
 
 	/* create the main vbox to store components */
-	vboxRight = gtk_vbox_new(FALSE, 0);
+	vboxRight = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxRight, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight, TRUE);
+	gtk_widget_set_halign(vboxRight, GTK_ALIGN_FILL);
+	g_object_set(vboxRight, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable), vboxRight, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight);
 
 	/* create box for the top label */
-	topBox = gtk_hbox_new(FALSE, 0);
+	topBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), topBox, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox);
 
@@ -460,8 +492,8 @@
 	gtk_widget_show(topLabel);
 
 	/* create a table for the main components and fill it */
-	tbl1 = gtk_table_new(1, 6, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 10);
+	tbl1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight), tbl1, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbl1);
 	insert_program(tbl1);
@@ -480,8 +512,8 @@
 	GtkWidget *topLabel;
 	GtkWidget *tbl1;
 
-	box = gtk_vbox_new(FALSE, 0);
-	tbox = gtk_hbox_new(FALSE, 0);
+	box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+	tbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(box), tbox, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbox);
 
@@ -490,16 +522,17 @@
 	gtk_container_add(GTK_CONTAINER(tbox), frame1);
 	gtk_widget_show(frame1);
 
-	uTable = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(uTable), 0);
+	uTable = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(uTable), 0);
 	gtk_container_add(GTK_CONTAINER(frame1), uTable);
 	gtk_widget_show(uTable);
 
 	/* create the left image container */
-	vboxLeft = gtk_vbox_new(FALSE, 0);
+	vboxLeft = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxLeft), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxLeft, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_EXPAND|GTK_FILL, 5, 0);
+	gtk_widget_set_margin_start(vboxLeft, 5);
+	gtk_widget_set_margin_end(vboxLeft, 5);
+	gtk_grid_attach(GTK_GRID(uTable), vboxLeft, 0, 0, 1, 1);
 	gtk_widget_show(vboxLeft);
 
 	image = gtk_image_new_from_file(PIXDIR"/settings.png");
@@ -507,14 +540,16 @@
 	gtk_widget_show(image);
 
 	/* create the main vbox to store components */
-	vboxRight = gtk_vbox_new(FALSE, 0);
+	vboxRight = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vboxRight), 0);
-	gtk_table_attach(GTK_TABLE(uTable), vboxRight, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
+	gtk_widget_set_hexpand(vboxRight, TRUE);
+	gtk_widget_set_halign(vboxRight, GTK_ALIGN_FILL);
+	g_object_set(vboxRight, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(uTable), vboxRight, 1, 0, 1, 1);
 	gtk_widget_show(vboxRight);
 
 	/* create box for the top label */
-	topBox = gtk_hbox_new(FALSE, 0);
+	topBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_box_pack_start(GTK_BOX(vboxRight), topBox, FALSE, FALSE, FALSE);
 	gtk_widget_show(topBox);
 
@@ -523,8 +558,8 @@
 	gtk_widget_show(topLabel);
 
 	/* create a table for the main components and fill it */
-	tbl1 = gtk_table_new(1, 2, FALSE);
-	gtk_container_border_width(GTK_CONTAINER(tbl1), 10);
+	tbl1 = gtk_grid_new();
+	gtk_container_set_border_width(GTK_CONTAINER(tbl1), 10);
 	gtk_box_pack_start(GTK_BOX(vboxRight), tbl1, FALSE, FALSE, FALSE);
 	gtk_widget_show(tbl1);
 	insert_settings(tbl1);
@@ -535,27 +570,33 @@
 void insert_server(const GtkWidget *widget) {
 	GtkWidget *lBox;
 	GtkWidget *caption;
+	GList *l;
 
-	lBox = gtk_hbox_new(FALSE, 0);
+	lBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox, TRUE);
+	gtk_widget_set_halign(lBox, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox, 0, 0, 1, 1);
 	gtk_widget_show(lBox);
 
 	caption = gtk_label_new(_("Computer:"));
-	gtk_box_pack_start(GTK_BOX(lBox), caption, FALSE, FALSE, FALSE);
+	gtk_box_pack_start(GTK_BOX(lBox), caption, TRUE, FALSE, 0);
 	gtk_widget_show(caption);
 
-	combo_host2 = gtk_combo_new();
-	gtk_combo_disable_activate(GTK_COMBO(combo_host2));
-	g_signal_connect(G_OBJECT(GTK_COMBO(combo_host2)->entry), "changed",
+	combo_host2 = gtk_combo_box_new_with_entry();
+	g_signal_connect(G_OBJECT(combo_host2), "changed",
 			G_CALLBACK(sig_selchange), NULL);
-	gtk_table_attach(GTK_TABLE(widget), combo_host2, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(combo_host2, TRUE);
+	gtk_widget_set_halign(combo_host2, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(combo_host2, 5);
+	gtk_widget_set_margin_bottom(combo_host2, 5);
+	gtk_grid_attach(GTK_GRID(widget), combo_host2, 1, 0, 1, 1);
 	gtk_widget_show(combo_host2);
 
 	if(hostnames != NULL)
-		gtk_combo_set_popdown_strings(GTK_COMBO(combo_host2), hostnames);
+	        for(l = hostnames; l != NULL; l = l->next)
+	                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                               (combo_host2), l->data);
 }
 
 
@@ -563,22 +604,26 @@
 	GtkWidget *lBox;
 	GtkWidget *caption;
 
-	lBox = gtk_hbox_new(FALSE, 0);
+	lBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox, 0, 1, 1, 2,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox, TRUE);
+	gtk_widget_set_halign(lBox, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox, 0, 1, 1, 1);
 	gtk_widget_show(lBox);
 
 	caption = gtk_label_new(_("Username:"));
-	gtk_box_pack_start(GTK_BOX(lBox), caption, FALSE, FALSE, FALSE);
+	gtk_box_pack_start(GTK_BOX(lBox), caption, TRUE, FALSE, 0);
 	gtk_widget_show(caption);
 
 	input_username = gtk_entry_new();
 	gtk_entry_set_max_length(GTK_ENTRY(input_username), MAXHOSTNAMELEN);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_username)), "changed",
 		G_CALLBACK(sig_username), NULL);
-	gtk_table_attach(GTK_TABLE(widget), input_username, 1, 2, 1, 2,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(input_username, TRUE);
+	gtk_widget_set_halign(input_username, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(input_username, 2);
+	gtk_widget_set_margin_bottom(input_username, 2);
+	gtk_grid_attach(GTK_GRID(widget), input_username, 1, 1, 1, 1);
 	gtk_widget_show(input_username);
 }
 
@@ -586,14 +631,15 @@
 	GtkWidget *lBox;
 	GtkWidget *caption;
 
-	lBox = gtk_hbox_new(FALSE, 0);
+	lBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox, 0, 1, 2, 3,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox, TRUE);
+	gtk_widget_set_halign(lBox, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox, 0, 2, 1, 1);
 	gtk_widget_show(lBox);
 
 	caption = gtk_label_new(_("Password:"));
-	gtk_box_pack_start(GTK_BOX(lBox), caption, FALSE, FALSE, FALSE);
+	gtk_box_pack_start(GTK_BOX(lBox), caption, TRUE, FALSE, 0);
 	gtk_widget_show(caption);
 
 	input_password = gtk_entry_new();
@@ -601,8 +647,11 @@
 	gtk_entry_set_visibility(GTK_ENTRY(input_password), FALSE);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_password)), "changed",
 		G_CALLBACK(sig_password), NULL);
-	gtk_table_attach(GTK_TABLE(widget), input_password, 1, 2, 2, 3,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(input_password, TRUE);
+	gtk_widget_set_halign(input_password, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(input_password, 2);
+	gtk_widget_set_margin_bottom(input_password, 2);
+	gtk_grid_attach(GTK_GRID(widget), input_password, 1, 2, 1, 1);
 	gtk_widget_show(input_password);
 }
 
@@ -610,77 +659,94 @@
 	GtkWidget *lBox;
 	GtkWidget *caption;
 
-	lBox = gtk_hbox_new(FALSE, 0);
+	lBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox, 0, 1, 3, 4,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox, TRUE);
+	gtk_widget_set_halign(lBox, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox, 0, 3, 1, 1);
 	gtk_widget_show(lBox);
 
 	caption = gtk_label_new(_("Domain:"));
-	gtk_box_pack_start(GTK_BOX(lBox), caption, FALSE, FALSE, FALSE);
+	gtk_box_pack_start(GTK_BOX(lBox), caption, TRUE, FALSE, 0);
 	gtk_widget_show(caption);
 
 	input_domain = gtk_entry_new();
 	gtk_entry_set_max_length(GTK_ENTRY(input_domain), MAXHOSTNAMELEN);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_domain)), "changed",
 		G_CALLBACK(sig_domain), NULL);
-	gtk_table_attach(GTK_TABLE(widget), input_domain, 1, 2, 3, 4,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(input_domain, TRUE);
+	gtk_widget_set_halign(input_domain, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(input_domain, 2);
+	gtk_widget_set_margin_bottom(input_domain, 2);
+	gtk_grid_attach(GTK_GRID(widget), input_domain, 1, 3, 1, 1);
 	gtk_widget_show(input_domain);
 }
 
 void insert_savebox(const GtkWidget *widget) {
 	check_savepw = gtk_check_button_new_with_label(_("Save my password"));
-	gtk_table_attach(GTK_TABLE(widget), check_savepw, 1, 2, 4, 5,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_savepw, TRUE);
+	gtk_widget_set_halign(check_savepw, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_savepw, 2);
+	gtk_widget_set_margin_bottom(check_savepw, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_savepw, 1, 4, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_savepw)), "toggled",
 		G_CALLBACK(sig_savepw), NULL);
 	gtk_widget_show(check_savepw);
 }
 
 void insert_rdp_protocol(const GtkWidget *widget) {
-	GtkWidget *menu;
 	gint i, count;
 
-	menu_rdp_proto = gtk_option_menu_new();
-	gtk_table_attach(GTK_TABLE(widget), menu_rdp_proto, 1, 2, 5, 6,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	menu_rdp_proto = gtk_combo_box_text_new();
+	gtk_widget_set_hexpand(menu_rdp_proto, TRUE);
+	gtk_widget_set_halign(menu_rdp_proto, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(menu_rdp_proto, 2);
+	gtk_widget_set_margin_bottom(menu_rdp_proto, 2);
+	gtk_grid_attach(GTK_GRID(widget), menu_rdp_proto, 1, 5, 1, 1);
 	gtk_widget_show(menu_rdp_proto);
-	menu = gtk_menu_new();
 
 	count = g_list_length(rdp_protocols);
 	for(i=0; i<count; i++) {
-		GtkWidget *menuitem;
 		gchar *item;
 
 		item = g_list_nth_data(rdp_protocols, i);
 		if(item == NULL)
 			return;
 
-		menuitem = gtk_menu_item_new_with_label(item);
-		gtk_widget_show(menuitem);
-		gtk_menu_append(GTK_MENU(menu), menuitem);
-		gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
-			GTK_SIGNAL_FUNC(sig_rdp_protocol), NULL);
+	        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                       (menu_rdp_proto), item);
 	}
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(menu_rdp_proto), menu);
+	g_signal_connect(G_OBJECT(menu_rdp_proto), "changed",
+	                 G_CALLBACK(sig_rdp_protocol), NULL);
 }
 
 void insert_buttons(const GtkWidget *widget) {
 	GtkWidget *save, *load;
 
-	save = gtk_button_new_from_stock("gtk-save-as");
-	gtk_table_attach(GTK_TABLE(widget), save, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
-	gtk_signal_connect(GTK_OBJECT(save), "clicked",
-		GTK_SIGNAL_FUNC(sig_savebtn), NULL);
+	save = gtk_button_new_from_icon_name("document-save-as",
+	                                     GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(save), _("Save _As"));
+	gtk_button_set_use_underline(GTK_BUTTON(save), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(save), TRUE);
+	gtk_widget_set_hexpand(save, TRUE);
+	gtk_widget_set_halign(save, GTK_ALIGN_FILL);
+	g_object_set(save, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(widget), save, 0, 0, 1, 1);
+	g_signal_connect(G_OBJECT(save), "clicked",
+			 G_CALLBACK(sig_savebtn), NULL);
 	gtk_widget_show(save);
 
-	load = gtk_button_new_from_stock("gtk-open");
-	gtk_table_attach(GTK_TABLE(widget), load, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 5, 5);
-	gtk_signal_connect(GTK_OBJECT(load), "clicked",
-		GTK_SIGNAL_FUNC(sig_loadbtn), NULL);
+	load = gtk_button_new_from_icon_name("document-open",
+	                                     GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(load), _("_Open"));
+	gtk_button_set_use_underline(GTK_BUTTON(load), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(load), TRUE);
+	gtk_widget_set_hexpand(load, TRUE);
+	gtk_widget_set_halign(save, GTK_ALIGN_FILL);
+	g_object_set(load, "margin", 5, NULL);
+	gtk_grid_attach(GTK_GRID(widget), load, 1, 0, 1, 1);
+	g_signal_connect(G_OBJECT(load), "clicked",
+			 G_CALLBACK(sig_loadbtn), NULL);
 	gtk_widget_show(load);
 }
 
@@ -690,46 +756,53 @@
 
 	ltext = gtk_label_new(_("Less"));
 	gtk_label_set_justify(GTK_LABEL(ltext), GTK_JUSTIFY_LEFT);
-	gtk_table_attach(GTK_TABLE(widget), ltext, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_SHRINK, 10, 0);
+	gtk_widget_set_margin_start(ltext, 10);
+	gtk_widget_set_margin_end(ltext, 10);
+	gtk_grid_attach(GTK_GRID(widget), ltext, 0, 0, 1, 1);
 	gtk_widget_show(ltext);
 
 	adj_screensize = gtk_adjustment_new(0.0, 0.0,
 		(gdouble)(g_list_length(screensize)-1),
 		1.0, 1.0, 0.0);
-	scroll_screensize = gtk_hscrollbar_new(GTK_ADJUSTMENT(adj_screensize));
+	scroll_screensize = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL,
+	                                      adj_screensize);
 	g_signal_connect(G_OBJECT(GTK_RANGE(scroll_screensize)), "value-changed",
 		G_CALLBACK(sig_scroll), NULL);
-	gtk_table_attach(GTK_TABLE(widget), scroll_screensize, 1, 3, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(scroll_screensize, TRUE);
+	gtk_widget_set_halign(scroll_screensize, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(scroll_screensize, 2);
+	gtk_widget_set_margin_bottom(scroll_screensize, 2);
+	gtk_grid_attach(GTK_GRID(widget), scroll_screensize, 1, 0, 1, 1);
 	gtk_widget_show(scroll_screensize);
 
 	rtext = gtk_label_new(_("More"));
 	gtk_label_set_justify(GTK_LABEL(rtext), GTK_JUSTIFY_LEFT);
-	gtk_table_attach(GTK_TABLE(widget), rtext, 3, 4, 0, 1,
-		GTK_SHRINK, GTK_SHRINK, 10, 0);
+	gtk_widget_set_margin_start(rtext, 10);
+	gtk_widget_set_margin_end(rtext, 10);
+	gtk_grid_attach(GTK_GRID(widget), rtext, 3, 0, 1, 1);
 	gtk_widget_show(rtext);
 
 	geometry_label = gtk_label_new(_("??? pixels"));
 	gtk_label_set_justify(GTK_LABEL(geometry_label), GTK_JUSTIFY_CENTER);
-	gtk_table_attach(GTK_TABLE(widget), geometry_label, 0, 4, 1, 2,
-		GTK_SHRINK, GTK_SHRINK, 10, 0);
+	gtk_widget_set_margin_start(geometry_label, 10);
+	gtk_widget_set_margin_end(geometry_label, 10);
+	gtk_grid_attach(GTK_GRID(widget), geometry_label, 1, 1, 1, 1);
 	gtk_widget_show(geometry_label);
 }
 
 void insert_colorsel(const GtkWidget *widget) {
-	GtkWidget *menu;
 	gint i, count;
 
-	menu_colorsize = gtk_option_menu_new();
-	gtk_table_attach(GTK_TABLE(widget), menu_colorsize, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_SHRINK, 0, 5);
+	menu_colorsize = gtk_combo_box_text_new();
+	gtk_widget_set_margin_top(menu_colorsize, 5);
+	gtk_widget_set_margin_bottom(menu_colorsize, 5);
+	gtk_grid_attach(GTK_GRID(widget), menu_colorsize, 0, 0, 1, 1);
 	gtk_widget_show(menu_colorsize);
-	menu = gtk_menu_new();
 
 	image_colorsize = gtk_image_new();
-	gtk_table_attach(GTK_TABLE(widget), image_colorsize, 0, 1, 1, 2,
-		GTK_SHRINK, GTK_SHRINK, 0, 5);
+	gtk_widget_set_margin_top(image_colorsize, 5);
+	gtk_widget_set_margin_bottom(image_colorsize, 5);
+	gtk_grid_attach(GTK_GRID(widget), image_colorsize, 0, 1, 1, 1);
 	gtk_widget_show(image_colorsize);
 
 	count = g_list_length(colors);
@@ -741,13 +814,11 @@
 		if(item == NULL)
 			return;
 
-		menuitem = gtk_menu_item_new_with_label(item);
-		gtk_widget_show(menuitem);
-		gtk_menu_append(GTK_MENU(menu), menuitem);
-		gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
-			GTK_SIGNAL_FUNC(sig_colchange), NULL);
+	        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                       (menu_colorsize), item);
 	}
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(menu_colorsize), menu);
+	g_signal_connect(G_OBJECT(menu_colorsize), "changed",
+	                 G_CALLBACK(sig_colchange), NULL);
 
 	if(iSHASH("rdp_protocol") < 1) { /* disable, it's not supported by the RDP version */
 		gtk_widget_set_sensitive(menu_colorsize, FALSE);
@@ -766,8 +837,11 @@
 	scroll = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
 		GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-	gtk_table_attach(GTK_TABLE(widget), scroll, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_SHRINK, 0, 5);
+	gtk_widget_set_hexpand(scroll, TRUE);
+	gtk_widget_set_halign(scroll, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(scroll, 5);
+	gtk_widget_set_margin_bottom(scroll, 5);
+	gtk_grid_attach(GTK_GRID(widget), scroll, 0, 0, 1, 1);
 	gtk_widget_set_size_request(GTK_WIDGET(scroll), -1, 100);
 	gtk_widget_show(scroll);
 
@@ -776,8 +850,7 @@
 	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_keymap), FALSE);
 	gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree_keymap), FALSE );
 	gtk_widget_show(tree_keymap);
-	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll),
-		tree_keymap);
+	gtk_container_add(GTK_CONTAINER(scroll), tree_keymap);
 
 	model = gtk_list_store_new(1, G_TYPE_STRING);
 	gtk_tree_view_set_model(GTK_TREE_VIEW(tree_keymap), GTK_TREE_MODEL(model));
@@ -788,19 +861,18 @@
 	gtk_tree_view_append_column(GTK_TREE_VIEW(tree_keymap),
 		GTK_TREE_VIEW_COLUMN(column));
 
-	gtk_signal_connect(GTK_OBJECT(tree_keymap), "cursor-changed",
-		GTK_SIGNAL_FUNC(sig_keychange), NULL);
+	g_signal_connect(G_OBJECT(tree_keymap), "cursor-changed",
+		G_CALLBACK(sig_keychange), NULL);
 }
 
 void insert_sound(const GtkWidget *widget) {
-	GtkWidget *menu;
 	gint i, count;
 
-	menu_sound = gtk_option_menu_new();
-	gtk_table_attach(GTK_TABLE(widget), menu_sound, 0, 1, 0, 1,
-		GTK_SHRINK, GTK_SHRINK, 0, 2);
+	menu_sound = gtk_combo_box_text_new();
+	gtk_widget_set_margin_top(menu_sound, 2);
+	gtk_widget_set_margin_bottom(menu_sound, 2);
+	gtk_grid_attach(GTK_GRID(widget), menu_sound, 0, 0, 1, 1);
 	gtk_widget_show(menu_sound);
-	menu = gtk_menu_new();
 
 	count = g_list_length(sound_options);
 	for(i=0; i<count; i++) {
@@ -811,13 +883,11 @@
 		if(item == NULL)
 			return;
 
-		menuitem = gtk_menu_item_new_with_label(item);
-		gtk_widget_show(menuitem);
-		gtk_menu_append(GTK_MENU(menu), menuitem);
-		gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
-			GTK_SIGNAL_FUNC(sig_sound), NULL);
+	        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                       (menu_sound), item);
 	}
-	gtk_option_menu_set_menu(GTK_OPTION_MENU(menu_sound), menu);
+	g_signal_connect(G_OBJECT(menu_sound), "changed",
+			 G_CALLBACK(sig_sound), NULL);
 
 	if(iSHASH("rdp_protocol") < 1) { /* disable, it's not supported by the RDP version */
 		gtk_widget_set_sensitive(menu_sound, FALSE);
@@ -833,14 +903,18 @@
 
 	/* insert checkbox */
 	check_prog = gtk_check_button_new_with_label(_("Run program"));
-	gtk_table_attach(GTK_TABLE(widget), check_prog, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 10);
+	gtk_widget_set_hexpand(check_prog, TRUE);
+	gtk_widget_set_halign(check_prog, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_prog, 10);
+	gtk_widget_set_margin_bottom(check_prog, 10);
+	gtk_grid_attach(GTK_GRID(widget), check_prog, 0, 0, 1, 1);
 	gtk_widget_show(check_prog);
 
-	lBox1 = gtk_hbox_new(FALSE, 0);
+	lBox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox1), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox1, 0, 1, 1, 2,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox1, TRUE);
+	gtk_widget_set_halign(lBox1, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox1, 0, 1, 1, 1);
 	gtk_widget_show(lBox1);
 
 	progLabel = gtk_label_new(_("Path and filename:"));
@@ -852,14 +926,18 @@
 	gtk_entry_set_max_length(GTK_ENTRY(input_program), 255);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_program)), "changed",
 		G_CALLBACK(sig_program), NULL);
-	gtk_table_attach(GTK_TABLE(widget), input_program, 0, 1, 2, 3,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(input_program, TRUE);
+	gtk_widget_set_halign(input_program, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(input_program, 5);
+	gtk_widget_set_margin_bottom(input_program, 5);
+	gtk_grid_attach(GTK_GRID(widget), input_program, 0, 2, 1, 1);
 	gtk_widget_show(input_program);
 
-	lBox2 = gtk_hbox_new(FALSE, 0);
+	lBox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(lBox2), 0);
-	gtk_table_attach(GTK_TABLE(widget), lBox2, 0, 1, 3, 4,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
+	gtk_widget_set_hexpand(lBox2, TRUE);
+	gtk_widget_set_halign(lBox2, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(widget), lBox2, 0, 3, 1, 1);
 	gtk_widget_show(lBox2);
 
 	pathLabel = gtk_label_new(_("Working directory:"));
@@ -871,8 +949,11 @@
 	gtk_entry_set_max_length(GTK_ENTRY(input_ppath), 255);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_ppath)), "changed",
 		G_CALLBACK(sig_path), NULL);
-	gtk_table_attach(GTK_TABLE(widget), input_ppath, 0, 1, 4, 5,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(input_ppath, TRUE);
+	gtk_widget_set_halign(input_ppath, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(input_ppath, 5);
+	gtk_widget_set_margin_bottom(input_ppath, 5);
+	gtk_grid_attach(GTK_GRID(widget), input_ppath, 0, 4, 1, 1);
 	gtk_widget_show(input_ppath);
 
 	/* make sure, the entry widget is init */
@@ -887,48 +968,66 @@
 
 	/* insert checkboxes */
 	check_bitmapupd = gtk_check_button_new_with_label(_("Force bitmap updates"));
-	gtk_table_attach(GTK_TABLE(widget), check_bitmapupd, 0, 1, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_bitmapupd, TRUE);
+	gtk_widget_set_halign(check_bitmapupd, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_bitmapupd, 2);
+	gtk_widget_set_margin_bottom(check_bitmapupd, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_bitmapupd, 0, 0, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_bitmapupd)), "toggled",
 		G_CALLBACK(sig_bitmapupdate), NULL);
 	gtk_widget_show(check_bitmapupd);
 
 	check_motionevt = gtk_check_button_new_with_label(
 		_("Don't send motion events"));
-	gtk_table_attach(GTK_TABLE(widget), check_motionevt, 0, 1, 1, 2,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_motionevt, TRUE);
+	gtk_widget_set_halign(check_motionevt, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_motionevt, 2);
+	gtk_widget_set_margin_bottom(check_motionevt, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_motionevt, 0, 1, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_motionevt)), "toggled",
 		G_CALLBACK(sig_motionevents), NULL);
 	gtk_widget_show(check_motionevt);
 
 	check_hidewmdecoration = gtk_check_button_new_with_label(
 		_("Hide window manager decorations"));
-	gtk_table_attach(GTK_TABLE(widget), check_hidewmdecoration, 0, 1, 2, 3,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_hidewmdecoration, TRUE);
+	gtk_widget_set_halign(check_hidewmdecoration, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_hidewmdecoration, 2);
+	gtk_widget_set_margin_bottom(check_hidewmdecoration, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_hidewmdecoration, 0, 2, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_hidewmdecoration)),
 		"toggled", G_CALLBACK(sig_hidewmdecoration), NULL);
 	gtk_widget_show(check_hidewmdecoration);
 
 	check_noencr = gtk_check_button_new_with_label(
 		_("Disable encryption (French TS)"));
-	gtk_table_attach(GTK_TABLE(widget), check_noencr, 0, 1, 3, 4,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_noencr, TRUE);
+	gtk_widget_set_halign(check_noencr, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_noencr, 2);
+	gtk_widget_set_margin_bottom(check_noencr, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_noencr, 0, 3, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_noencr)), "toggled",
 		G_CALLBACK(sig_noencr), NULL);
 	gtk_widget_show(check_noencr);
 
 	check_wmkeybindings = gtk_check_button_new_with_label(
 		_("Window manager key bindings"));
-	gtk_table_attach(GTK_TABLE(widget), check_wmkeybindings, 0, 1, 4, 5,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_wmkeybindings, TRUE);
+	gtk_widget_set_halign(check_wmkeybindings, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_wmkeybindings, 2);
+	gtk_widget_set_margin_bottom(check_wmkeybindings, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_wmkeybindings, 0, 4, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_wmkeybindings)), "toggled",
 		G_CALLBACK(sig_wmkeybindings), NULL);
 	gtk_widget_show(check_wmkeybindings);
 
 	check_attconsole = gtk_check_button_new_with_label(
 		_("Attach to console (>= Windows 2003)"));
-	gtk_table_attach(GTK_TABLE(widget), check_attconsole, 0, 1, 5, 6,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 2);
+	gtk_widget_set_hexpand(check_attconsole, TRUE);
+	gtk_widget_set_halign(check_attconsole, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(check_attconsole, 2);
+	gtk_widget_set_margin_bottom(check_attconsole, 2);
+	gtk_grid_attach(GTK_GRID(widget), check_attconsole, 0, 5, 1, 1);
 	g_signal_connect(G_OBJECT(GTK_CHECK_BUTTON(check_attconsole)), "toggled",
 		G_CALLBACK(sig_attconsole), NULL);
 	gtk_widget_show(check_attconsole);
@@ -939,39 +1038,56 @@
 	}
 
 	/* create the clientname editbox */
-	sep = gtk_hseparator_new();
-	gtk_table_attach(GTK_TABLE(widget), sep, 0, 1, 6, 7,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+	gtk_widget_set_hexpand(sep, TRUE);
+	gtk_widget_set_halign(sep, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(sep, 5);
+	gtk_widget_set_margin_bottom(sep, 5);
+	gtk_grid_attach(GTK_GRID(widget), sep, 0, 6, 1, 1);
 	gtk_widget_show(sep);
 	
-	cBox1 = gtk_hbox_new(FALSE, 0);
+	cBox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(cBox1), 0);
-	gtk_table_attach(GTK_TABLE(widget), cBox1, 0, 1, 7, 8,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(cBox1, TRUE);
+	gtk_widget_set_halign(cBox1, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(cBox1, 5);
+	gtk_widget_set_margin_bottom(cBox1, 5);
+	gtk_grid_attach(GTK_GRID(widget), cBox1, 0, 7, 1, 1);
 	gtk_widget_show(cBox1);
 
 	clientnameLabel = gtk_label_new(_("Fake clientname:"));
 	gtk_box_pack_start(GTK_BOX(cBox1), clientnameLabel, FALSE, FALSE, FALSE);
 	gtk_widget_show(clientnameLabel);
 
-	combo_clientname = gtk_combo_new();
-	gtk_entry_set_max_length(GTK_ENTRY(GTK_COMBO(combo_clientname)->entry), 255);
-	g_signal_connect(G_OBJECT(GTK_ENTRY(GTK_COMBO(combo_clientname)->entry)), "changed",
+	combo_clientname = gtk_combo_box_text_new_with_entry();
+	gtk_entry_set_max_length(GTK_ENTRY
+	                         (gtk_bin_get_child(GTK_BIN(combo_clientname))),
+	                         255);
+	g_signal_connect(G_OBJECT(combo_clientname), "changed",
 		G_CALLBACK(sig_clientname), NULL);
-	gtk_table_attach(GTK_TABLE(widget), combo_clientname, 0, 1, 8, 9,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(combo_clientname, TRUE);
+	gtk_widget_set_halign(combo_clientname, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(combo_clientname, 5);
+	gtk_widget_set_margin_bottom(combo_clientname, 5);
+	gtk_grid_attach(GTK_GRID(widget), combo_clientname, 0, 8, 1, 1);
 	gtk_widget_show(combo_clientname);
 
 	/* create the sshhost editbox */
-	sep2 = gtk_hseparator_new();
-	gtk_table_attach(GTK_TABLE(widget), sep2, 0, 1, 9, 10,			/* 9-10 */
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	sep2 = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
+	gtk_widget_set_hexpand(sep2, TRUE);
+	gtk_widget_set_halign(sep2, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(sep2, 5);
+	gtk_widget_set_margin_bottom(sep2, 5);
+	gtk_grid_attach(GTK_GRID(widget), sep2, 0, 9, 1, 1);
 	gtk_widget_show(sep2);
 	
-	cBox2 = gtk_hbox_new(FALSE, 0);
+	cBox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(cBox2), 0);
-	gtk_table_attach(GTK_TABLE(widget), cBox2, 0, 1, 10, 11,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 5);
+	gtk_widget_set_hexpand(cBox2, TRUE);
+	gtk_widget_set_halign(cBox2, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_top(cBox2, 5);
+	gtk_widget_set_margin_bottom(cBox2, 5);
+	gtk_grid_attach(GTK_GRID(widget), cBox2, 0, 10, 1, 1);
 	gtk_widget_show(cBox2);
 
 	check_sshopts = gtk_check_button_new_with_label(
@@ -981,9 +1097,13 @@
 		G_CALLBACK(sig_sshopts), NULL);
 	gtk_widget_show(check_sshopts);
 
-	btn_sshopts = gtk_button_new_from_stock("gtk-properties");
-	gtk_signal_connect(GTK_OBJECT(btn_sshopts), "clicked",
-		GTK_SIGNAL_FUNC(sig_btn_sshopts), NULL);
+	btn_sshopts = gtk_button_new_from_icon_name("document-properties",
+	                                            GTK_ICON_SIZE_BUTTON);
+	gtk_button_set_label(GTK_BUTTON(btn_sshopts), _("_Properties"));
+	gtk_button_set_use_underline(GTK_BUTTON(btn_sshopts), TRUE);
+	gtk_button_set_always_show_image(GTK_BUTTON(btn_sshopts), TRUE);
+	g_signal_connect(G_OBJECT(btn_sshopts), "clicked",
+		G_CALLBACK(sig_btn_sshopts), NULL);
 	gtk_box_pack_end(GTK_BOX(cBox2), btn_sshopts, FALSE, FALSE, FALSE);
 	gtk_widget_show(btn_sshopts);
 }
@@ -1039,7 +1159,7 @@
 void sig_rdp_protocol(GtkWidget *widget, gpointer data) {
 	gint item;
 
-	item = gtk_option_menu_get_history(GTK_OPTION_MENU(menu_rdp_proto));
+	item = gtk_combo_box_get_active(GTK_COMBO_BOX(menu_rdp_proto));
 
 	setBHASH("rdp_protocol", item);
 
@@ -1064,38 +1184,55 @@
 
 void sig_savebtn(GtkWidget *widget, gpointer data) {
 	GtkWidget *sel;
+	GtkFileChooser *chooser;
 
-	sel = gtk_file_selection_new("Save rdp-File");
-
-	gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sel)->ok_button),
-		"clicked", G_CALLBACK(sig_file_save), sel);
-
-	g_signal_connect_swapped(GTK_OBJECT(
-		GTK_FILE_SELECTION(sel)->ok_button),
-		"clicked", G_CALLBACK(gtk_widget_destroy), sel);
-	g_signal_connect_swapped(GTK_OBJECT(
-		GTK_FILE_SELECTION(sel)->cancel_button),
-		"clicked", G_CALLBACK(gtk_widget_destroy), sel);
+	sel = gtk_file_chooser_dialog_new(_("Save rdp-File"),
+	                                  GTK_WINDOW(window_main),
+	                                  GTK_FILE_CHOOSER_ACTION_SAVE,
+	                                  _("_Cancel"),
+	                                  GTK_RESPONSE_CANCEL,
+	                                  _("_Save"),
+	                                  GTK_RESPONSE_ACCEPT,
+	                                  NULL);
+	chooser = GTK_FILE_CHOOSER(sel);
+
+	gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
+	gtk_file_chooser_set_current_name(chooser, _("Untitled"));
+
+	if(gtk_dialog_run(GTK_DIALOG(sel)) == GTK_RESPONSE_ACCEPT) {
+	        gchar *filename;
+
+	        filename = gtk_file_chooser_get_filename(chooser);
+	        sig_file_save(filename);
+	        g_free(filename);
+	}
 
-	gtk_widget_show(sel);
+	gtk_widget_destroy(sel);
 }
 
 void sig_loadbtn(GtkWidget *widget, gpointer data) {
 	GtkWidget *sel;
+	GtkFileChooser *chooser;
 
-	sel = gtk_file_selection_new("Open rdp-File");
-
-	gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sel)->ok_button),
-		"clicked", G_CALLBACK(sig_file_open), sel);
-
-	g_signal_connect_swapped(GTK_OBJECT(
-		GTK_FILE_SELECTION(sel)->ok_button),
-		"clicked", G_CALLBACK(gtk_widget_destroy), sel);
-	g_signal_connect_swapped(GTK_OBJECT(
-		GTK_FILE_SELECTION(sel)->cancel_button),
-		"clicked", G_CALLBACK(gtk_widget_destroy), sel);
+	sel = gtk_file_chooser_dialog_new(_("Open rdp-File"),
+	                                  GTK_WINDOW(window_main),
+	                                  GTK_FILE_CHOOSER_ACTION_OPEN,
+	                                  _("_Cancel"),
+	                                  GTK_RESPONSE_CANCEL,
+	                                  _("_Open"),
+	                                  GTK_RESPONSE_ACCEPT,
+	                                  NULL);
+	chooser = GTK_FILE_CHOOSER(sel);
+
+	if(gtk_dialog_run(GTK_DIALOG(sel)) == GTK_RESPONSE_ACCEPT) {
+	        gchar *filename;
+
+	        filename = gtk_file_chooser_get_filename(chooser);
+	        sig_file_open(filename);
+	        g_free(filename);
+	}
 
-	gtk_widget_show(sel);
+	gtk_widget_destroy(sel);
 }
 
 void sig_scroll(GtkWidget *widget, gpointer data) {
@@ -1132,7 +1269,7 @@
 	gint item;
 	gchar *filename;
 
-	item = gtk_option_menu_get_history(GTK_OPTION_MENU(menu_colorsize));
+	item = gtk_combo_box_get_active(GTK_COMBO_BOX(menu_colorsize));
 
 	filename = g_strdup_printf("%s/%s_%d.png", PIXDIR, "colors", item+1);
 	setBHASH("colorsize", item);
@@ -1176,7 +1313,7 @@
 void sig_sound(GtkWidget *widget, gpointer data) {
 	gint item;
 
-	item = gtk_option_menu_get_history(GTK_OPTION_MENU(menu_sound));
+	item = gtk_combo_box_get_active(GTK_COMBO_BOX(menu_sound));
 
 	setBHASH("sound", item);
 
--- grdesktop-0.23+d040330.orig/src/run.c
+++ grdesktop-0.23+d040330/src/run.c
@@ -26,6 +26,7 @@
 	gchar *cmd = NULL, *cmdline = NULL;
 	gchar *std_out=NULL, *std_err=NULL;
 	gint estatus = 0;
+	GList *l;
 	GError *err = NULL;
 	gboolean ret = FALSE;
 
@@ -138,8 +139,12 @@
 	/* only if the connection was successful */
 	if(saveServers(SHASH("hostname")) == 0) {
 		loadServers();
-		gtk_combo_set_popdown_strings(GTK_COMBO(combo_host), hostnames);
-		gtk_combo_set_popdown_strings(GTK_COMBO(combo_host2), hostnames);
+	        for(l = hostnames; l != NULL; l = l->next) {
+	                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                               (combo_host), l->data);
+	                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                               (combo_host2), l->data);
+                }
 	}
 	saveOptions();
 
--- grdesktop-0.23+d040330.orig/src/srvsel.c
+++ grdesktop-0.23+d040330/src/srvsel.c
@@ -23,25 +23,27 @@
 #include "srvsel.h"
 
 GtkWidget *server_box() {
+	GList *l;
 	GtkWidget *box;
 	GtkWidget *caption;
 
-	box = gtk_hbox_new(FALSE, 10);
+	box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
 
 	caption = gtk_label_new(_("Computer:"));
 	gtk_label_set_justify(GTK_LABEL(caption), GTK_JUSTIFY_LEFT);
 	gtk_box_pack_start(GTK_BOX(box), caption, FALSE, TRUE, TRUE);
 	gtk_widget_show(caption);
 
-	combo_host = gtk_combo_new();
-	gtk_combo_disable_activate(GTK_COMBO(combo_host));
-	g_signal_connect(G_OBJECT(GTK_COMBO(combo_host)->entry), "changed",
+	combo_host = gtk_combo_box_text_new_with_entry();
+	g_signal_connect(G_OBJECT(combo_host), "changed",
 			G_CALLBACK(sig_selchange), NULL);
 	gtk_box_pack_start(GTK_BOX(box), combo_host, TRUE, TRUE, FALSE);
 	gtk_widget_show(combo_host);
 
 	if(loadServers() == 0)
-		gtk_combo_set_popdown_strings(GTK_COMBO(combo_host), hostnames);
+	        for(l = hostnames; l != NULL; l = l->next)
+	                gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT
+	                                               (combo_host), l->data);
 
 	return(box);
 }
@@ -49,10 +51,14 @@
 void sig_selchange(GtkWidget *widget, gpointer data) {
 	if(SHASH("hostname") != NULL)
 		g_hash_table_replace(config, "hostname",
-			g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))));
+	                g_strdup(gtk_entry_get_text(GTK_ENTRY
+	                                            (gtk_bin_get_child
+	                                             (GTK_BIN(widget))))));
 	else
 		g_hash_table_insert(config, "hostname",
-			g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))));
+			g_strdup(gtk_entry_get_text(GTK_ENTRY
+	                                            (gtk_bin_get_child
+	                                             (GTK_BIN(widget))))));
 
 	if(SHASH("hostname") == NULL)
 		g_hash_table_remove(config, "hostname");
--- grdesktop-0.23+d040330.orig/src/rdpparse.c
+++ grdesktop-0.23+d040330/src/rdpparse.c
@@ -23,54 +23,13 @@
 #include "rdpparse.h"
 
 
-void sig_file_open(GtkWidget *widget, gpointer data) {
-	GtkFileSelection *filesel;
-	gchar *filename;
-
-	filesel = GTK_FILE_SELECTION(data);
-	filename = g_strdup(gtk_file_selection_get_filename(filesel));
-	if(filename[strlen(filename)-1] == '/') {
-		error_dialog(_("Please select a valid rdp file!"));
-		sig_loadbtn(widget, NULL);
-		return;
-	}
-
+void sig_file_open(gchar *filename) {
 	parse_file(filename);
 	return;
 }
 
-void sig_file_save(GtkWidget *widget, gpointer data) {
-	GtkFileSelection *filesel;
+void sig_file_save(gchar *filename) {
 	FILE *file;
-	gchar *filename;
-
-	filesel = GTK_FILE_SELECTION(data);
-	filename = g_strdup(gtk_file_selection_get_filename(filesel));
-	if(filename[strlen(filename)-1] == '/') {
-		error_dialog(_("Please select a valid rdp file!"));
-		sig_savebtn(widget, NULL);
-		return;
-	}
-
-	if(g_file_test(filename, G_FILE_TEST_EXISTS)) {
-		GtkWidget *dlg;
-		gint result;
-
-		dlg = gtk_message_dialog_new(GTK_WINDOW(window_main),
-			GTK_DIALOG_DESTROY_WITH_PARENT,
-			GTK_MESSAGE_QUESTION,
-			GTK_BUTTONS_YES_NO,
-			_("Really override the already existing file?"));
-		result = gtk_dialog_run(GTK_DIALOG(dlg));
-		gtk_widget_destroy(dlg);
-
-		if(result != GTK_RESPONSE_YES) {
-#ifdef _DEBUG_
-			g_warning("Don't override existing file: %s", filename);
-#endif
-			return;
-		}
-	}
 
 	file = fopen(filename, "w");
 	if(file == NULL) {
--- grdesktop-0.23+d040330.orig/src/rdpparse.h
+++ grdesktop-0.23+d040330/src/rdpparse.h
@@ -31,8 +31,8 @@
 
 #define MAX_LINE_BUF 4096
 
-void sig_file_open(GtkWidget *widget, gpointer data);
-void sig_file_save(GtkWidget *widget, gpointer data);
+void sig_file_open(gchar *filename);
+void sig_file_save(gchar *filename);
 gint parse_file(gchar *filename);
 void parse_line(const gchar *line);
 void insert_option(const gchar *key, const gchar *value);
--- grdesktop-0.23+d040330.orig/src/options.c
+++ grdesktop-0.23+d040330/src/options.c
@@ -33,14 +33,18 @@
 		setBHASH("rdp_protocol", 0);
 	}
 
-	gtk_option_menu_set_history(GTK_OPTION_MENU(widget), iSHASH("rdp_protocol"));
+	gtk_combo_box_set_active(GTK_COMBO_BOX(widget), iSHASH("rdp_protocol"));
 }
 
 void fillScreens() {
+	GdkMonitor *monitor;
+	GdkRectangle geom;
 	gint width, height;
 
-	width = gdk_screen_width();
-	height = gdk_screen_height();
+	monitor = gdk_display_get_primary_monitor(gdk_display_get_default());
+	gdk_monitor_get_geometry(monitor, &geom);
+	width = geom.width;
+	height = geom.height;
 
 	if(checkScreen("640x480", width, height))
 		screensize = g_list_append(screensize, "640x480");
@@ -113,7 +117,7 @@
 		setBHASH("colorsize", 0);
 	}
 
-	gtk_option_menu_set_history(GTK_OPTION_MENU(widget), iSHASH("colorsize"));
+	gtk_combo_box_set_active(GTK_COMBO_BOX(widget), iSHASH("colorsize"));
 }
 
 void loadSoundOptions(GtkWidget *widget) {
@@ -122,7 +126,7 @@
 		setBHASH("sound", 0);
 	}
 
-	gtk_option_menu_set_history(GTK_OPTION_MENU(widget), iSHASH("sound"));
+	gtk_combo_box_set_active(GTK_COMBO_BOX(widget), iSHASH("sound"));
 }
 
 void loadKeymap(GtkListStore *model) {
@@ -479,9 +483,11 @@
 	DIR *licence_dir = NULL;
 
 	if(SHASH("hostname") != NULL) {
-		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo_host)->entry),
+	        gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child
+	                                     (GTK_BIN(combo_host))),
 			SHASH("hostname"));
-		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo_host2)->entry),
+	        gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child
+	                                     (GTK_BIN(combo_host2))),
 			SHASH("hostname"));
 	}
 
@@ -558,13 +564,18 @@
 		closedir(licence_dir);
 		g_free(licence_path);
 		if(licence_list != NULL) {
-			gtk_combo_set_popdown_strings(GTK_COMBO(combo_clientname),
-				licence_list);
+	                GList *l;
+
+	                for(l = licence_list; l != NULL; l = l->next)
+				gtk_combo_box_text_append_text
+	                          (GTK_COMBO_BOX_TEXT(combo_clientname),
+	                           l->data);
 		}
 	}
 
 	if(SHASH("clientname") != NULL) {
-		gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo_clientname)->entry),
+	        gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child
+	                           (GTK_BIN(combo_clientname))),
 			SHASH("clientname"));
 	}
 
--- grdesktop-0.23+d040330.orig/src/sshbox.c
+++ grdesktop-0.23+d040330/src/sshbox.c
@@ -28,9 +28,9 @@
 	dlg = gtk_dialog_new_with_buttons(_("SSH-Tunnel settings"),
 		GTK_WINDOW(window_main),
 		GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-		GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+		_("_OK"), GTK_RESPONSE_ACCEPT, NULL);
 
-	ssh_createdialog(GTK_DIALOG(dlg)->vbox);
+	ssh_createdialog(gtk_dialog_get_content_area(GTK_DIALOG(dlg)));
 	ssh_updatebox(status);
 
 	gtk_dialog_run(GTK_DIALOG(dlg));
@@ -42,7 +42,7 @@
 	GtkWidget *hb_user, *hb_host;
 	GtkWidget *l1, *l2;
 
-	vbox = gtk_vbox_new(FALSE, 0);
+	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
 	gtk_container_add(GTK_CONTAINER(widget), vbox);
 	gtk_widget_show(vbox);
@@ -54,14 +54,14 @@
 		G_CALLBACK(sig_enablessh), NULL);
 	gtk_widget_show(check_enablessh);
 
-	tbl = gtk_table_new(2, 2, FALSE);
+	tbl = gtk_grid_new();
 	gtk_container_set_border_width(GTK_CONTAINER(tbl), 10);
 	gtk_box_pack_start(GTK_BOX(vbox), tbl, FALSE, TRUE, TRUE);
 	gtk_widget_show(tbl);
 
-	hb_user = gtk_hbox_new(FALSE, 0);
-	gtk_table_attach(GTK_TABLE(tbl), hb_user, 0, 1, 0, 1,
-		GTK_FILL, GTK_SHRINK, 0, 0);
+	hb_user = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+	gtk_widget_set_halign(hb_user, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(tbl), hb_user, 0, 0, 1, 1);
 	gtk_widget_show(hb_user);
 
 	l1 = gtk_label_new(_("Username:"));
@@ -72,13 +72,18 @@
 	gtk_entry_set_max_length(GTK_ENTRY(input_user), 255);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_user)), "changed",
 		G_CALLBACK(sig_sshuser), NULL);
-	gtk_table_attach(GTK_TABLE(tbl), input_user, 1, 2, 0, 1,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 10, 3);
+	gtk_widget_set_hexpand(input_user, TRUE);
+	gtk_widget_set_halign(input_user, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_start(input_user, 10);
+	gtk_widget_set_margin_end(input_user, 10);
+	gtk_widget_set_margin_top(input_user, 3);
+	gtk_widget_set_margin_bottom(input_user, 3);
+	gtk_grid_attach(GTK_GRID(tbl), input_user, 1, 0, 1, 1);
 	gtk_widget_show(input_user);
 
-	hb_host = gtk_hbox_new(FALSE, 0);
-	gtk_table_attach(GTK_TABLE(tbl), hb_host, 0, 1, 1, 2,
-		GTK_FILL, GTK_SHRINK, 0, 0);
+	hb_host = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+	gtk_widget_set_halign(hb_host, GTK_ALIGN_FILL);
+	gtk_grid_attach(GTK_GRID(tbl), hb_host, 0, 1, 1, 1);
 	gtk_widget_show(hb_host);
 
 	l2 = gtk_label_new(_("Hostname:"));
@@ -89,8 +94,13 @@
 	gtk_entry_set_max_length(GTK_ENTRY(input_host), 255);
 	g_signal_connect(G_OBJECT(GTK_ENTRY(input_host)), "changed",
 		G_CALLBACK(sig_sshhost), NULL);
-	gtk_table_attach(GTK_TABLE(tbl), input_host, 1, 2, 1, 2,
-		GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 10, 3);
+	gtk_widget_set_hexpand(input_host, TRUE);
+	gtk_widget_set_halign(input_host, GTK_ALIGN_FILL);
+	gtk_widget_set_margin_start(input_host, 10);
+	gtk_widget_set_margin_end(input_host, 10);
+	gtk_widget_set_margin_top(input_host, 3);
+	gtk_widget_set_margin_bottom(input_host, 3);
+	gtk_grid_attach(GTK_GRID(tbl), input_host, 1, 1, 1, 1);
 	gtk_widget_show(input_host);
 
 }
