Using UI templates #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This issue is to keep track of figuring out how to use UI template elements.
For Dropship there is an idea to have a 'Pending Transmissions' view, where each initiated transmission is collected into an overview. There one can again copy the code, watch transfer progress, cancel this transmission or restart it. Since each transmission will have an identical interface it is best to use a template. See attached image for sketches.
Apparently
glade
supports 'Composite Templates' which is a way of defining a particular design as a template which can be reused throughout the application. How this is used in PyGTK is still a mistery.Some hints in this issue-thread:
https://github.com/sebp/PyGObject-Tutorial/issues/149
edit: also
https://stackoverflow.com/questions/58315926/pygobject-template-child-not-defined
https://www.reddit.com/r/gnome/comments/81ii38/anyone_using_gnome_builder_with_python/
Here is some example code:
https://github.com/virtuald/pygi-composite-templates/blob/master/examples/from_gresource/mywidget.py
based on:
https://web.archive.org/web/20180308063953/http://www.virtualroadside.com/blog/index.php/2015/05/24/gtk3-composite-widget-templates-for-python/
This can serve as a general example:
and
re: this comment I saw in https://github.com/virtuald/pygi-composite-templates/issues/9 that the upstream pygobject has a template implementation which is different from the custom pygi-composite-templates repository, see https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/52. So, some code differs, it seems. Not sure if you were aware. A lot of this is undocumented it seems...
Raised https://gitlab.gnome.org/GNOME/pygobject/-/issues/429.
If we get these kinds of errors again, double check the template file to make sure that it is indeed a template and not a widget object:
bea60004ce
This feels solved now 🌱
Yes it does, I'm just gonna take some time and summarize the helpful bits over at https://git.vvvvvvaria.org/rra/dropship/wiki before I close!