[Discuss] Make a thinner Glib/GTK+ to fit tiny device better
Hi all, I'm thinking and interested in the idea of running Glib/GTK+ based applications on tiny devices, e.g. wearable devices. I notice Tizen employs EFL because it is lightweight and fast. But when went through the code, it seems terrible and in a mess. Glib is clean and elegant, and with the incoming GSK, GTK+ will be polished. I'm thinking how to make Glib/GTK+ thinner ( to make memory footprint comparable with EFL's , though I haven't found any 'GTK+ vs EFL' benchmark yet...) And here are some rough thoughts: 1. Make Glib/GTK+ more modular for building, e.g. a configuration system similar to linux kernel's. Autoconf do support select in/out optional modules, but will be too many configure args with a huge options. 2. I notice EFL use some "COW" logic[1], but we already have a much clean implementation in GStreamer, that's gst_mini_object_make_writable[2]. Then we may merge GstMiniObject back to glib? 3. Remove extra layers. E.g. the malloc implementations in nowadays are very powerfull(e.g. jemalloc), hence GSlice can be retired(which otherwise introduces an extra cache layer).Also I'm thinking about providing APIs to make GTK+(also GIO) easily integrated to other event loop, then we use epoll() on Linux, kqueue() onBSD or even libdispatch[3] - client code can use simpler event loop(e.g. no locks, no recursive main loop support) --- 1. https://docs.enlightenment.org/stable/efl/group__Eina__Cow__Group.html 2. http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMiniObject.html#gst-mini-object-make-writable 3. https://github.com/cee1/cee1.archive/blob/master/documents/libdispatch-event.pdf - Regards, - cee1 ___ gtk-devel-list mailing list gtk-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: TypeError in GtkWindow
On 10/09/2015 09:25 AM, Felipe Borges wrote: As mentioned by Stefan, Coor2MASS was expecting a GtkWindow (the parent window), and you are passing a TitleBar object. Try something like this: diff --git a/q2MASS.py b/q2MASS.py index 43af88c..6b6a6d7 100644 --- a/q2MASS.py +++ b/q2MASS.py @@ -37,7 +37,7 @@ class Query2MASS(Gtk.Window): self.set_border_width(10) # add headerbar -tb = TitleBar() + tb = TitleBar(self) titlebar = tb.headerbar() self.set_titlebar(titlebar) @@ -62,7 +62,9 @@ class Query2MASS(Gtk.Window): class TitleBar: """Create the header bar""" -def __init__(self): +def __init__(self, parent): +self.parent = parent + """Initialize the class""" # create left and right headers self.left_header = Gtk.Grid() @@ -131,7 +133,7 @@ class TitleBar: def on_button_coor_clicked(self, widget): """Close popover and show Coordinates options""" self.popover_opts.hide() -coor = Coor2MASS(self) + coor = Coor2MASS(self.parent) resp = coor.run() if resp == Gtk.ResponseType.OK: print("Clicked OK!") Hi Felipe, That really worked! Thank you for your time! All the best, Germán. -- Germán A. Racca Fedora Package Maintainer https://fedoraproject.org/wiki/User:Skytux ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: TypeError in GtkWindow
On 10/09/2015 08:21 AM, Stefan Salewski wrote: On Thu, 2015-10-08 at 22:05 -0300, Germán Racca wrote: About "coor.run()", I have followed the exact steps in the official PyGObject tutorial: https://python-gtk-3-tutorial.readthedocs.org/en/latest/dialogs.html#c ustom-dialogs Good to know :-) Well, I do not know much about Python. But the difference seems to be obviously. You have class TitleBar: and call coor = Coor2MASS(self) So for you self is not a widget at all, but it should, it is used as parent widget! In the Python tutorial we have class DialogWindow(Gtk.Window): Here self is a Gtk.Window. Can not say you exactly how to solve your problems, but you should get the idea. Or maybe ask in a Python list/forum when Python itself is the problem. Thanks for your advises! As you can see, I'm not so good when it comes to OOP... All the best, Germán. -- Germán A. Racca Fedora Package Maintainer https://fedoraproject.org/wiki/User:Skytux ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list