+/* testmultidisplay.c
+ * Copyright (C) 2001 Sun Microsystems Inc.
+ * Author: Erwann Chenede <erwann.chenede@sun.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
#include <gtk/gtk.h>
static GtkWidget **images;
}
static void
-move (GtkWidget *button, GtkVBox *vbox)
+move (GtkWidget *button, GtkBox *vbox)
{
GdkScreen *screen = gtk_widget_get_screen (button);
GtkWidget *toplevel = gtk_widget_get_toplevel (button);
gtk_init (&argc, &argv);
- dpy = gdk_get_default_display ();
+ dpy = gdk_display_get_default ();
num_screen = gdk_display_get_n_screens (dpy);
displayname = g_strdup (gdk_display_get_name (dpy));
g_print ("This X Server (%s) manages %d screen(s).\n",
screen_list[i] = gdk_display_get_screen (dpy, i);
- window[i] = gtk_widget_new (GTK_TYPE_WINDOW,
+ window[i] = g_object_new (GTK_TYPE_WINDOW,
"screen", screen_list[i],
"user_data", NULL,
"type", GTK_WINDOW_TOPLEVEL,
"title", label,
- "allow_grow", FALSE,
- "allow_shrink", FALSE,
+ "resizable", FALSE,
"border_width", 10, NULL,
NULL);
g_signal_connect (window[i], "destroy",
G_CALLBACK (gtk_main_quit), NULL);
- vbox[i] = gtk_vbox_new (TRUE, 0);
+ vbox[i] = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (vbox[i]), TRUE);
gtk_container_add (GTK_CONTAINER (window[i]), vbox[i]);
- button = gtk_widget_new (GTK_TYPE_BUTTON,
+ button = g_object_new (GTK_TYPE_BUTTON,
"label", label,
"parent", vbox[i],
"visible", TRUE, NULL,
gtk_container_add (GTK_CONTAINER (vbox[i]), images[i]);
- button = gtk_widget_new (GTK_TYPE_BUTTON,
+ button = g_object_new (GTK_TYPE_BUTTON,
"label", "Hide Icon",
"parent", vbox[i],
"visible", TRUE, NULL,
gtk_widget_show_all (window[i]);
moving_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- moving_vbox = gtk_vbox_new (TRUE, 0);
-
+ moving_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (moving_vbox), TRUE);
+
gtk_container_add (GTK_CONTAINER (moving_window), moving_vbox);
- moving_button = gtk_widget_new (GTK_TYPE_BUTTON,
+ moving_button = g_object_new (GTK_TYPE_BUTTON,
"label", "Move to Next Screen",
"visible", TRUE,
NULL);
- g_signal_connect (G_OBJECT (moving_button), "clicked",
+ g_signal_connect (moving_button, "clicked",
G_CALLBACK (move), moving_vbox);
gtk_container_add (GTK_CONTAINER (moving_vbox), moving_button);