[dia] [gtk-deprecated] fix GtkAdjustment usage



commit 6e1f7a534b8cb79e04b6ef8878ca873065ee57d5
Author: Hans Breuer <hans breuer org>
Date:   Wed Jul 10 10:25:05 2013 +0200

    [gtk-deprecated] fix GtkAdjustment usage
    
    with gtk-3-0 GtkObject is gone and GtkAdjustment is a GtkWidget.
    But casting a GtkAdjustment to GtkWidget fails with gtk-2-0

 lib/prop_matrix.c         |    6 +++---
 lib/prop_sdarray_widget.c |    8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/lib/prop_matrix.c b/lib/prop_matrix.c
index 691d597..cde0f42 100644
--- a/lib/prop_matrix.c
+++ b/lib/prop_matrix.c
@@ -165,14 +165,14 @@ matrixprop_set_from_offset(MatrixProperty *prop,
 static GtkWidget *
 matrixprop_get_widget (MatrixProperty *prop, PropDialog *dialog) 
 { 
-  GtkWidget *adj;
+  GtkAdjustment *adj;
   GtkWidget *ret, *sb;
   int i;
 
   ret = gtk_hbox_new (FALSE,0);
   /* angle */
-  adj = GTK_WIDGET(gtk_adjustment_new(0.0, -180.0, 180.0, 1.0, 15.0, 0));
-  sb = gtk_spin_button_new(GTK_ADJUSTMENT (adj), 1.0, 2);
+  adj = gtk_adjustment_new(0.0, -180.0, 180.0, 1.0, 15.0, 0);
+  sb = gtk_spin_button_new(adj, 1.0, 2);
   gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(sb),TRUE);
   prophandler_connect(&prop->common, G_OBJECT(sb), "changed");
   gtk_widget_show(sb);
diff --git a/lib/prop_sdarray_widget.c b/lib/prop_sdarray_widget.c
index c9b77c3..438c8e8 100644
--- a/lib/prop_sdarray_widget.c
+++ b/lib/prop_sdarray_widget.c
@@ -6,7 +6,7 @@
  * Copyright (C) 2001 Cyrille Chepelov
  *
  * Properties List Widget
- * Copyright (C) 2007  Hans Breuer
+ * Copyright (C) 2007, 2013  Hans Breuer
  *
  * 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
@@ -79,13 +79,13 @@ _cell_renderer_real_new (const Property *p)
   const RealProperty *prop = (RealProperty *)p;
   GtkCellRenderer *cren = gtk_cell_renderer_spin_new ();
   PropNumData *numdata = prop->common.descr->extra_data;
-  GtkWidget *adj;
+  GtkAdjustment *adj;
 
   /* must be non NULL to make it editable */
-  adj = GTK_WIDGET (gtk_adjustment_new (prop->real_data,
+  adj = gtk_adjustment_new (prop->real_data,
                            numdata->min, numdata->max,
                            numdata->step, 
-                           10.0 * numdata->step, 0));
+                           10.0 * numdata->step, 0);
 
   g_object_set (G_OBJECT (cren), "adjustment", adj, NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]