[pygobject/wip/jfelder/gtk4-toolbutton: 1/2] gtk overrides: Drop ToolButton for Gtk4



commit 2d4dfdf171a7f4c3a1bba47634c3c430d5c76601
Author: Jean Felder <jean felder gmail com>
Date:   Mon Mar 16 20:19:48 2020 +0100

    gtk overrides: Drop ToolButton for Gtk4
    
    It has been removed (gtk commit
    44e153d8a8679633681dd3ae2029735255e4f839).

 gi/overrides/Gtk.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 834f5eb6..74555d16 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -696,14 +696,14 @@ IconView = override(IconView)
 __all__.append('IconView')
 
 
-class ToolButton(Gtk.ToolButton):
-    __init__ = deprecated_init(Gtk.ToolButton.__init__,
-                               arg_names=('stock_id',),
-                               category=PyGTKDeprecationWarning)
-
+if Gtk._version in ("2.0", "3.0"):
+    class ToolButton(Gtk.ToolButton):
+        __init__ = deprecated_init(Gtk.ToolButton.__init__,
+                                   arg_names=('stock_id',),
+                                   category=PyGTKDeprecationWarning)
 
-ToolButton = override(ToolButton)
-__all__.append('ToolButton')
+    ToolButton = override(ToolButton)
+    __all__.append('ToolButton')
 
 
 class IMContext(Gtk.IMContext):


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