[pygobject/pygtk-compat: 1/10] Add bw-compatible arguments to Gtk.Adjustment



commit 8e50baa4a562cbee4b5fb0aeabde8a15de72b40b
Author: Johan Dahlin <johan gnome org>
Date:   Wed Mar 14 15:20:53 2012 -0300

    Add bw-compatible arguments to Gtk.Adjustment
    
    The argument used to be called page/step_incr, if they
    are found map them to the existing properties for extra
    compatibility.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672087

 gi/overrides/Gtk.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 8f0d74a..5ad5fe9 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -1347,9 +1347,15 @@ __all__.append('Label')
 class Adjustment(Gtk.Adjustment):
     def __init__(self, *args, **kwds):
         arg_names = ('value', 'lower', 'upper',
-                        'step_increment', 'page_increment', 'page_size')
+                     'step_increment', 'page_increment', 'page_size')
         new_args = dict(zip(arg_names, args))
         new_args.update(kwds)
+
+        # PyGTK compatiblity
+        if 'page_incr' in new_args:
+            new_args['page_increment'] = new_args.pop('page_incr')
+        if 'step_incr' in new_args:
+            new_args['step_increment'] = new_args.pop('step_incr')
         Gtk.Adjustment.__init__(self, **new_args)
 
         # The value property is set between lower and (upper - page_size).



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