[pygobject] Add overrides for Gtk.Button set/get_focus_on_click



commit 4927856945899de09cfe99c052a83aec6e2f3c1a
Author: Dan Yeaw <dan yeaw me>
Date:   Sat Jan 4 14:46:51 2020 -0500

    Add overrides for Gtk.Button set/get_focus_on_click
    
    Fixes #371. Gtk.Button.set_focus_on_click and Gtk.Button.get_focus_on_click
    are deprecated since version 3.20. This override calls the Gtk.Widget methods
    so that users don't get a deprecation message.
    
    Signed-off-by: Dan Yeaw <dan yeaw me>

 gi/overrides/Gtk.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 35d5fcb9..b797cf8c 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -1460,6 +1460,16 @@ class Button(Gtk.Button, Container):
         else:
             self._init(*args, **kwargs)
 
+    def set_focus_on_click(self, focus_on_click):
+        # Gtk.Button.set_focus_on_click is deprecated since version 3.20
+        # Use Gtk.Widget.set_focus_on_click instead
+        Gtk.Widget.set_focus_on_click(self, focus_on_click)
+
+    def get_focus_on_click(self):
+        # Gtk.Button.get_focus_on_click is deprecated since version 3.20
+        # Use Gtk.Widget.get_focus_on_click instead
+        Gtk.Widget.get_focus_on_click(self)
+
 
 Button = override(Button)
 __all__.append('Button')


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