]> Pileus Git - ~andy/gtk/blobdiff - tests/testmultiscreen.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testmultiscreen.c
index a2c894d4ab4d3d114caf2166fbc3c45389a0ab7d..0c20f19600b627c52ebfcc4e193d58585aac7f48 100644 (file)
@@ -1,3 +1,22 @@
+/* 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;
@@ -30,7 +49,7 @@ show_hide (GtkWidget * button, gpointer data)
 }
 
 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);
@@ -71,7 +90,7 @@ main (int argc, char *argv[])
   
   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",
@@ -90,22 +109,22 @@ main (int argc, char *argv[])
       
       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,
@@ -118,7 +137,7 @@ main (int argc, char *argv[])
       
       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,
@@ -131,15 +150,16 @@ main (int argc, char *argv[])
     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);