gtk-stream 0.13.6__tar.gz → 0.14.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/PKG-INFO +1 -1
  2. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/_version.py +2 -2
  3. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/application.py +1 -1
  4. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Box.py +5 -3
  5. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Button.py +2 -2
  6. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Document.py +4 -0
  7. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Dropdown.py +10 -10
  8. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/FlowBox.py +3 -2
  9. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Frame.py +3 -2
  10. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Grid.py +1 -1
  11. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/ScrolledWindow.py +1 -1
  12. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Stack.py +1 -1
  13. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/PKG-INFO +1 -1
  14. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/README.md +0 -0
  15. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk-stream +0 -0
  16. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/__init__.py +0 -0
  17. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/command_line.py +0 -0
  18. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/common.py +0 -0
  19. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/__init__.py +0 -0
  20. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Entry.py +0 -0
  21. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Label.py +0 -0
  22. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Paned.py +0 -0
  23. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Picture.py +0 -0
  24. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/ProgressBar.py +0 -0
  25. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Scale.py +0 -0
  26. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Separator.py +0 -0
  27. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/Switch.py +0 -0
  28. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/documents/classes/__init__.py +0 -0
  29. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/parser.py +0 -0
  30. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream/properties.py +0 -0
  31. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/SOURCES.txt +0 -0
  32. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/dependency_links.txt +0 -0
  33. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/entry_points.txt +0 -0
  34. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/requires.txt +0 -0
  35. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/gtk_stream.egg-info/top_level.txt +0 -0
  36. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/pyproject.toml +0 -0
  37. {gtk_stream-0.13.6 → gtk_stream-0.14.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gtk-stream
3
- Version: 0.13.6
3
+ Version: 0.14.1
4
4
  Summary: A simple stream-oriented GUI protocol
5
5
  Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
6
6
  Project-URL: Homepage, https://coiffier.net/projects/gtk-stream/
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.13.6'
16
- __version_tuple__ = version_tuple = (0, 13, 6)
15
+ __version__ = version = '0.14.1'
16
+ __version_tuple__ = version_tuple = (0, 14, 1)
@@ -141,7 +141,7 @@ class GtkStreamApp(Gtk.Application):
141
141
  @app_message('remove')
142
142
  def remove_widget(self, id):
143
143
  w = self.named_widgets[id]
144
- w.get_parent().remove(w)
144
+ w.remove_self()
145
145
 
146
146
  @app_message('insert', multiple_store)
147
147
  def insert_widgets(self, documents, into):
@@ -29,10 +29,12 @@ class Box(Document):
29
29
  def render_raw(self):
30
30
  return Gtk.Box()
31
31
  def insert_child(self, w, d):
32
+ child = d.render_in(w)
32
33
  if isinstance(d, BoxPrepend):
33
34
  if d.after != None:
34
- w.insert_child_after(d.render(), self.app.named_widgets[d.after])
35
+ w.insert_child_after(child, self.app.named_widgets[d.after])
35
36
  else:
36
- w.prepend(d.render())
37
+ w.prepend(child)
37
38
  else:
38
- w.append(d.render())
39
+ w.append(child)
40
+
@@ -26,7 +26,7 @@ class Button(Document):
26
26
  self.connect_event(button, 'clicked', 'clicked')
27
27
  return button
28
28
  def insert_child(self, w, d):
29
- w.set_child(d.render())
29
+ w.set_child(d.render_in(w))
30
30
 
31
31
  class LinkButton(Button):
32
32
  __g_class__ = Gtk.LinkButton
@@ -39,4 +39,4 @@ class LinkButton(Button):
39
39
  retval = True)
40
40
  return button
41
41
  def insert_child(self, w, d):
42
- w.set_child(d.render())
42
+ w.set_child(d.render_in(w))
@@ -51,6 +51,10 @@ class Document:
51
51
  for child in self.children:
52
52
  self.insert_child(w, child)
53
53
  return w
54
+ def render_in(self, w):
55
+ ret = self.render()
56
+ ret.remove_self = lambda: w.remove(ret)
57
+ return ret
54
58
 
55
59
  def insert_child(self, w, child):
56
60
  raise Exception("Unimplemented method 'insert_child'")
@@ -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.item_value = None
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.item_value != item.value:
54
- list_item.item_value = item.value
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().value)
66
+ get_data = lambda w,_: w.get_selected_item().key)
67
67
  return ret
68
68
  def insert_child(self, w, d):
69
- pass
69
+ self.model.append(_ItemObject(d))
@@ -28,7 +28,8 @@ class FlowBox(Document):
28
28
  def render_raw(self):
29
29
  return Gtk.FlowBox()
30
30
  def insert_child(self, w, d):
31
+ child = d.render_in(w)
31
32
  if isinstance(d, FlowBoxPrepend):
32
- w.prepend(d.render())
33
+ w.prepend(child)
33
34
  else:
34
- w.append(d.render())
35
+ w.append(child)
@@ -28,7 +28,8 @@ class Frame(Document):
28
28
  def render_raw(self):
29
29
  return Gtk.Frame()
30
30
  def insert_child(self, w, d):
31
+ child = d.render_in(w)
31
32
  if isinstance(d, FrameLabel):
32
- w.set_label_widget(d.render())
33
+ w.set_label_widget(child)
33
34
  else:
34
- w.set_child(d.render())
35
+ w.set_child(child)
@@ -33,4 +33,4 @@ class Grid(Document):
33
33
  def render_raw(self):
34
34
  return Gtk.Grid()
35
35
  def insert_child(self, w, d):
36
- w.attach(d.render(), d.x, d.y, d.w, d.h)
36
+ w.attach(d.render_in(w), d.x, d.y, d.w, d.h)
@@ -24,4 +24,4 @@ class ScrolledWindow(Document):
24
24
  def render_raw(self):
25
25
  return Gtk.ScrolledWindow()
26
26
  def insert_child(self, w, d):
27
- w.set_child(d.render())
27
+ w.set_child(d.render_in(w))
@@ -38,7 +38,7 @@ class Stack(Document):
38
38
  def render_raw(self):
39
39
  return Gtk.Stack()
40
40
  def insert_child(self, w, d):
41
- child = d.render()
41
+ child = d.render_in(w)
42
42
  w.add_child(child)
43
43
  if isinstance(d, StackPage):
44
44
  page = w.get_page(child)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gtk-stream
3
- Version: 0.13.6
3
+ Version: 0.14.1
4
4
  Summary: A simple stream-oriented GUI protocol
5
5
  Author-email: Marc Coiffier <marc.coiffier@univ-grenoble-alpes.fr>
6
6
  Project-URL: Homepage, https://coiffier.net/projects/gtk-stream/
File without changes
File without changes
File without changes
File without changes