Moving to glade and GtkInspector

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Moving to glade and GtkInspector

Martin Owens
Hi Gtk Devs,

I'm brining this up in devel mailing list because it might not be
possible to do well enough, but I'm interested in raising the question
of moving projects from widget code to glade ui files.

I work on Inkscape. The next version of Inkscape (0.93) will be Gtk3
and Gtk2 is now removed from our codebase. But we're still generating
all of our widget trees in-code and is kinda hurts redesigning our
dialogs.

Is it worth moving to glade for parts of a large gtk3 app, does it help
with css adjustments at all and would it be an acceptable patch to make
the gtkinspector dump out our existing widget trees (it would be really
nice to have it generate glade xml, but that's just silly right). At
least getting the data out of the inspector and into a python script
for generating the xml would be a start.

Any ideas, or thoughts?

Thanks for your help, Best Regards, Martin Owens
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Moving to glade and GtkInspector

Sébastien Wilmet-2
Hi,

On Mon, Apr 03, 2017 at 01:29:01AM -0400, Martin Owens wrote:

> I'm brining this up in devel mailing list because it might not be
> possible to do well enough, but I'm interested in raising the question
> of moving projects from widget code to glade ui files.
>
> I work on Inkscape. The next version of Inkscape (0.93) will be Gtk3
> and Gtk2 is now removed from our codebase. But we're still generating
> all of our widget trees in-code and is kinda hurts redesigning our
> dialogs.
>
> Is it worth moving to glade for parts of a large gtk3 app, does it help
> with css adjustments at all and would it be an acceptable patch to make
> the gtkinspector dump out our existing widget trees (it would be really
> nice to have it generate glade xml, but that's just silly right). At
> least getting the data out of the inspector and into a python script
> for generating the xml would be a start.
>
> Any ideas, or thoughts?

Glade is not well maintained, some developers prefer to edit the XML
files directly, which is not really convenient.

At least by writing C/C++ code, you have compilation warnings when using
deprecated functions. Personally I prefer writing code instead of using
GtkBuilder, but that's just my preference. With code it's easy to write
re-usable functions, in XML files it is not possible.

--
Sébastien
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Moving to glade and GtkInspector

Alberto Ruiz-4
In reply to this post by Martin Owens
Hey Martin,

When I maintained gnome-calculator I ported a bunch of Widgets to use GtkBuilder templates:
https://blogs.gnome.org/tvb/2013/04/09/announcing-composite-widget-templates/

This allowed me to massively reduce my codebase as I turned the UI into content, I also used the chance to port many layouts from nested v/hboxes to the newer GtkGrid. GtkBuilder templates are generally encouraged and we even do so in Gtk+ itself.

While glade is not perfect, moving my handcrafted UI code to .ui files certainly made my life easier as a maintainer.

2017-04-03 6:29 GMT+01:00 Martin Owens <[hidden email]>:
Hi Gtk Devs,

I'm brining this up in devel mailing list because it might not be
possible to do well enough, but I'm interested in raising the question
of moving projects from widget code to glade ui files.

I work on Inkscape. The next version of Inkscape (0.93) will be Gtk3
and Gtk2 is now removed from our codebase. But we're still generating
all of our widget trees in-code and is kinda hurts redesigning our
dialogs.

Is it worth moving to glade for parts of a large gtk3 app, does it help
with css adjustments at all and would it be an acceptable patch to make
the gtkinspector dump out our existing widget trees (it would be really
nice to have it generate glade xml, but that's just silly right). At
least getting the data out of the inspector and into a python script
for generating the xml would be a start.

Any ideas, or thoughts?

Thanks for your help, Best Regards, Martin Owens
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list



--
Cheers,
Alberto Ruiz

_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Moving to glade and GtkInspector

Martin Owens
In reply to this post by Sébastien Wilmet-2
On Wed, 2017-04-12 at 13:28 +0200, Sébastien Wilmet wrote:
> > Any ideas, or thoughts?

Yes, so we have existing user interfaces and I was really hoping
there'd be a way of using the gtk=inspector to dump out the widget
structure into a machine readable format. Even if it was something
sloppy I could python into glade xml.

> Glade is not well maintained, some developers prefer to edit the XML
> files directly, which is not really convenient.
>
> At least by writing C/C++ code, you have compilation warnings when
> using deprecated functions. Personally I prefer writing code instead
> of using GtkBuilder, but that's just my preference. With code it's
> easy to write re-usable functions, in XML files it is not possible.

It's possible with things like the python gtkme library. But I do
understand why programmers would want to code.

The problem is that it's easier for a programmer to workaround glade
xml than it is for designers to work around C++ code. More designers,
more ux people, better software for end users. (theoretically)

Best Regards, Martin Owens
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Moving to glade and GtkInspector

Bastien Nocera
In reply to this post by Martin Owens
On Mon, 2017-04-03 at 01:29 -0400, Martin Owens wrote:

> Hi Gtk Devs,
>
> I'm brining this up in devel mailing list because it might not be
> possible to do well enough, but I'm interested in raising the
> question
> of moving projects from widget code to glade ui files.
>
> I work on Inkscape. The next version of Inkscape (0.93) will be Gtk3
> and Gtk2 is now removed from our codebase. But we're still generating
> all of our widget trees in-code and is kinda hurts redesigning our
> dialogs.
>
> Is it worth moving to glade for parts of a large gtk3 app, does it
> help
> with css adjustments at all and would it be an acceptable patch to
> make
> the gtkinspector dump out our existing widget trees (it would be
> really
> nice to have it generate glade xml, but that's just silly right). At
> least getting the data out of the inspector and into a python script
> for generating the xml would be a start.
>
> Any ideas, or thoughts?

I wrote this horror a long time ago:
http://www.hadess.net/2009/04/because-i-suck-at-glade.html

I'm pretty sure you could reimplement this in the inspector without too
much trouble, even if it would likely suck codewise.

HTH
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Loading...