[pygobject] Only create function _construct_target_list for GTK2/3
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Only create function _construct_target_list for GTK2/3
- Date: Sun, 27 Mar 2022 13:51:35 +0000 (UTC)
commit ad3c274d12b93a594571714b1800f20639a46cf6
Author: Arjan Molenaar <gaphor gmail com>
Date: Wed Nov 3 21:39:42 2021 +0100
Only create function _construct_target_list for GTK2/3
It's not used in GTK 4.
gi/overrides/Gtk.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index d9ec6fbe..6ddc12f6 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -64,21 +64,21 @@ class PyGTKDeprecationWarning(PyGIDeprecationWarning):
__all__.append('PyGTKDeprecationWarning')
-def _construct_target_list(targets):
- """Create a list of TargetEntry items from a list of tuples in the form (target, flags, info)
-
- The list can also contain existing TargetEntry items in which case the existing entry
- is re-used in the return list.
- """
- target_entries = []
- for entry in targets:
- if not isinstance(entry, Gtk.TargetEntry):
- entry = Gtk.TargetEntry.new(*entry)
- target_entries.append(entry)
- return target_entries
-
+if GTK2 or GTK3:
+ def _construct_target_list(targets):
+ """Create a list of TargetEntry items from a list of tuples in the form (target, flags, info)
-__all__.append('_construct_target_list')
+ The list can also contain existing TargetEntry items in which case the existing entry
+ is re-used in the return list.
+ """
+ target_entries = []
+ for entry in targets:
+ if not isinstance(entry, Gtk.TargetEntry):
+ entry = Gtk.TargetEntry.new(*entry)
+ target_entries.append(entry)
+ return target_entries
+
+ __all__.append('_construct_target_list')
def _builder_connect_callback(builder, gobj, signal_name, handler_name, connect_obj, flags, obj_or_map):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]