diff options
author | Pierre Equoy <pierre.equoy@canonical.com> | 2022-06-15 11:53:10 +0800 |
---|---|---|
committer | Pierre Equoy <pierre.equoy@canonical.com> | 2022-06-15 11:53:10 +0800 |
commit | af20bbbdada16cdcb36af1cb7f86918d8ed9f196 (patch) | |
tree | 12c6efe79149f00aa2aa4451b048b3069ff76bf2 | |
parent | 50b110fc7d6d43ad375c75edb01f809b3109a129 (diff) |
Fix:touchpad_test.py: Deprecation warnings
Fix code to avoid deprecation warnings from Gtk in the logs
-rwxr-xr-x | bin/touchpad_test.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/touchpad_test.py b/bin/touchpad_test.py index 95d096d..9c55196 100755 --- a/bin/touchpad_test.py +++ b/bin/touchpad_test.py @@ -70,7 +70,7 @@ class GtkScroller(object): button_hbox = self._add_hbox(vbox) validation_hbox = self._add_hbox(vbox) self.status = self._add_label(vbox) - self.exit_button = self._add_button(vbox, Gtk.STOCK_CLOSE) + self.exit_button = self._add_button(vbox, "_Close") self.exit_button.connect("clicked", lambda w: self.quit()) # Add widgets for each direction. @@ -85,8 +85,8 @@ class GtkScroller(object): "\n" + _("Then scroll in each direction on your touchpad.")) - def _add_button(self, context, stock): - button = self.button_factory(stock=stock) + def _add_button(self, context, label): + button = self.button_factory.new_with_mnemonic(label) context.add(button) button.show() return button @@ -156,7 +156,7 @@ class GtkScroller(object): def found_direction(self, direction): direction.tested = True - self.icons[direction].set_from_stock( + self.icons[direction].set_from_icon_name( self.ICON_TESTED, size=self.ICON_SIZE) self.check_directions() |