gtk-stream 0.14__tar.gz → 0.14.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {gtk_stream-0.14 → gtk_stream-0.14.1}/PKG-INFO +1 -1
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/_version.py +2 -2
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Dropdown.py +10 -10
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/PKG-INFO +1 -1
- {gtk_stream-0.14 → gtk_stream-0.14.1}/README.md +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk-stream +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/__init__.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/application.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/command_line.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/common.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/__init__.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Box.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Button.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Document.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Entry.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/FlowBox.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Frame.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Grid.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Label.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Paned.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Picture.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/ProgressBar.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Scale.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/ScrolledWindow.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Separator.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Stack.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Switch.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/documents/classes/__init__.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/parser.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream/properties.py +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/SOURCES.txt +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/dependency_links.txt +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/entry_points.txt +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/requires.txt +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/gtk_stream.egg-info/top_level.txt +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/pyproject.toml +0 -0
- {gtk_stream-0.14 → gtk_stream-0.14.1}/setup.cfg +0 -0
@@ -18,10 +18,11 @@ from ... import Gtk, Gio, GObject
|
|
18
18
|
from .. import Document
|
19
19
|
|
20
20
|
class Item(Document):
|
21
|
-
def __init__(self, app, value, **kwargs):
|
21
|
+
def __init__(self, app, value, key = None, **kwargs):
|
22
22
|
super().__init__(app, **kwargs)
|
23
23
|
self.child = None
|
24
24
|
self.value = value
|
25
|
+
self.key = key if key != None else value
|
25
26
|
def add_child(self, child):
|
26
27
|
self.child = child
|
27
28
|
def render(self):
|
@@ -31,6 +32,7 @@ class _ItemObject(GObject.Object):
|
|
31
32
|
super().__init__()
|
32
33
|
self.doc = doc
|
33
34
|
self.value = doc.value
|
35
|
+
self.key = doc.key
|
34
36
|
|
35
37
|
@GObject.Property(type=str)
|
36
38
|
def item_value(self):
|
@@ -41,29 +43,27 @@ class Dropdown(Document):
|
|
41
43
|
def __init__(self, app, id, **kwargs):
|
42
44
|
super().__init__(app, id=id, **kwargs)
|
43
45
|
def render_raw(self):
|
44
|
-
model = Gio.ListStore(item_type=_ItemObject)
|
45
|
-
for item in self.children:
|
46
|
-
model.append(_ItemObject(item))
|
46
|
+
self.model = Gio.ListStore(item_type=_ItemObject)
|
47
47
|
|
48
48
|
factory = Gtk.SignalListItemFactory()
|
49
49
|
def on_list_setup(_, list_item):
|
50
|
-
list_item.
|
50
|
+
list_item.item_key = None
|
51
51
|
def on_list_bind(_, list_item):
|
52
52
|
item = list_item.get_item()
|
53
|
-
if list_item.
|
54
|
-
list_item.
|
53
|
+
if list_item.item_key != item.key:
|
54
|
+
list_item.item_key = item.key
|
55
55
|
list_item.set_child(item.doc.render())
|
56
56
|
factory.connect("setup", on_list_setup)
|
57
57
|
factory.connect("bind", on_list_bind)
|
58
58
|
|
59
59
|
ret = Gtk.DropDown(
|
60
|
-
model=model,
|
60
|
+
model=self.model,
|
61
61
|
expression=Gtk.PropertyExpression.new(_ItemObject, None, 'item_value'),
|
62
62
|
factory=factory)
|
63
63
|
|
64
64
|
self.connect_event(
|
65
65
|
ret, 'notify::selected-item', 'selected',
|
66
|
-
get_data = lambda w,_: w.get_selected_item().
|
66
|
+
get_data = lambda w,_: w.get_selected_item().key)
|
67
67
|
return ret
|
68
68
|
def insert_child(self, w, d):
|
69
|
-
|
69
|
+
self.model.append(_ItemObject(d))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|