]> Pileus Git - ~andy/gtk/blobdiff - tests/testcalendar.c
stylecontext: Do invalidation on first resize container
[~andy/gtk] / tests / testcalendar.c
index a71b5cc8860d0bdecff5b6d80436cfeef178f2f7..84de5ec139c15b877250439f7d024687c5c76823 100644 (file)
@@ -3,19 +3,18 @@
  * Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund
  * Copyright (C) 2000 Tony Gale
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -477,10 +476,11 @@ create_calendar(void)
   size = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
   context = gtk_widget_get_style_context (calendar);
-  font_desc = gtk_style_context_get_font (context, GTK_STATE_FLAG_NORMAL);
+  gtk_style_context_get (context, GTK_STATE_FLAG_NORMAL, &font_desc, NULL);
   font = pango_font_description_to_string (font_desc);
   button = gtk_font_button_new_with_font (font);
   g_free (font);
+  pango_font_description_free (font_desc);
 
   g_signal_connect (button, "font-set",
                     G_CALLBACK(calendar_select_font),
@@ -488,7 +488,8 @@ create_calendar(void)
 
   label = gtk_label_new_with_mnemonic ("_Font:");
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_widget_set_halign (label, GTK_ALIGN_START);
+  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
   gtk_size_group_add_widget (size, label);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
@@ -508,7 +509,8 @@ create_calendar(void)
 
   label = gtk_label_new_with_mnemonic ("Details W_idth:");
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_widget_set_halign (label, GTK_ALIGN_START);
+  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
   gtk_size_group_add_widget (size, label);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);
@@ -528,7 +530,8 @@ create_calendar(void)
 
   label = gtk_label_new_with_mnemonic ("Details H_eight:");
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+  gtk_widget_set_halign (label, GTK_ALIGN_START);
+  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
   gtk_size_group_add_widget (size, label);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, DEF_PAD_SMALL);