Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI - shift back-end to Gtk::Builder from GladeXML #413

Closed
GoogleCodeExporter opened this issue Mar 27, 2015 · 10 comments
Closed

GUI - shift back-end to Gtk::Builder from GladeXML #413

GoogleCodeExporter opened this issue Mar 27, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

Gtk2::Buildable has superseded the Gtk2::GladeXML library as the means of 
building UIs for Gtk from glade files.

As issue #5 has shown, there are also memory leaks in the GladeXML 
implementation.  Gtk2::Buildable hopefully does not.

This will also remove one dependency from the distribution, as Gtk2::Buildable 
comes as part of Gtk2.  


Original issue reported on code.google.com by shawnlaffan on 31 Oct 2013 at 4:30

@GoogleCodeExporter
Copy link
Author

Drop the 1.0 milestone.  Save this for later.  

Original comment by shawnlaffan on 20 Aug 2014 at 10:30

  • Added labels: ****
  • Removed labels: Milestone-Release1.0

@shawnlaffan
Copy link
Owner

@andersonku
Copy link
Collaborator

andersonku commented Mar 22, 2016

TODOS:

  • Break Biodiverse.glade file into multiple GtkBuilder UI files because GtkBuilder does not support root node. (done)
    • using gtk-builder-convert scripts "--root" option (done)
  • Glade does not set the "Visible" property to "Yes" for widgets by default while converted ones do. (done)
  • Devise strategy. (e.g. have it all hidden and setShow when required) (done)
  • Currently hacking with $builder->connect_signals ($user_data, $package)
    • need to know what $user_data is used for
  • https://mail.gnome.org/archives/gtk-perl-list/2011-November/msg00015.html
  • Address warnings
# $self->{glade_xml_coll}->signal_autoconnect_from_package($self);
$self->{glade_xml_coll}->connect_signals($self);

@shawnlaffan
Copy link
Owner

That should be OK, as we want them shown in most cases. This will reduce the need for many of the show_all calls, although I expect leaving them be will be harmless so we won't need to audit the code for them unless they show adverse effects.

@andersonku
Copy link
Collaborator

From: http://developer.gimp.org/api/2.0/gtk/gtk-migrating-GtkBuilder.html
GtkBuilder can not construct partial trees, it lacks the equivalent of the root parameter of glade_xml_new(). Due to the way GtkBuilder parses its input, this is difficult to implement, see bug 447998. As a workaround, you can split your glade file into multiple GtkBuilder input files using the --root that was mentioned above.

@shawnlaffan
Copy link
Owner

That makes sense given some of the other transition docs I've seen.

We can break the various components into their own files. These can be located under a bin/ui directory. This process will probably simplify the transition, as the glade file can still be used while parts of it are shifted across.

@shawnlaffan
Copy link
Owner

The general approach in this looks relevant.
http://f-spot.org/gtkbuilder_transition

@andersonku
Copy link
Collaborator

andersonku commented Apr 16, 2016

Currently investigating difficulties when converting 'hboxSpatialPage'. Maybe this is related to the fact that converter cannot handle menu:

andersonku@andersonku-ubuntu1404:~/biodiverse/bin/ui$ gtk-builder-convert hboxSpatialPage.glade hboxSpatialPage.ui
WARNING: duplicate id "menuitem_spatial_display"
WARNING: duplicate id "menuitem_spatial_overlays"
WARNING: duplicate id "menu_item_colour_stretch"
WARNING: duplicate id "radio_colour_stretch0"
WARNING: duplicate id "radio_colour_stretch1"
WARNING: duplicate id "radio_colour_stretch2"
WARNING: duplicate id "radio_colour_stretch3"
WARNING: duplicate id "radio_colour_stretch4"
WARNING: duplicate id "radio_colour_stretch5"
WARNING: duplicate id "radio_colour_stretch6"
WARNING: duplicate id "menuitem_spatial_colour_mode"
WARNING: duplicate id "menuitem_spatial_colour_mode_hue"
WARNING: duplicate id "menuitem_spatial_colour_mode_sat"
WARNING: duplicate id "menuitem_spatial_colour_mode_grey"
WARNING: duplicate id "menuitem_spatial_nbr_highlighting"
WARNING: duplicate id "menuitem_nbr_highlight_all"
WARNING: duplicate id "menuitem_nbr_highlight_set1"
WARNING: duplicate id "menuitem_nbr_highlight_set2"
WARNING: duplicate id "menuitem_nbr_highlight_off"
WARNING: duplicate id "menuitem_spatial_excluded_cell_colour"
WARNING: duplicate id "menuitem_spatial_undef_cell_colour"
WARNING: duplicate id "menuitem_spatial_cell_outline_colour"
WARNING: duplicate id "menuitem_spatial_cell_show_outline"
WARNING: duplicate id "menuitem_spatial_show_legend"
WARNING: duplicate id "menuitem_spatial_set_tree_line_widths"
Wrote hboxSpatialPage.ui
andersonku@andersonku-ubuntu1404:~/biodiverse/bin/ui$ ag -i menuitem_spatial_display
hboxSpatialPage.glade
164:                  <widget class="GtkMenuItem" id="menuitem_spatial_display">
hboxSpatialPage.ui
39:          <object class="GtkAction" id="menuitem_spatial_display">
40:            <property name="name">menuitem_spatial_display</property>
229:        <menu action="menuitem_spatial_display">

shawnlaffan added a commit that referenced this issue Apr 28, 2016
Converting from Glade to GTK Builder to remove dependency

Updates issue #413
@shawnlaffan
Copy link
Owner

Updated by pull request #591
Now for me to modify the BiodiverseGUI.pl PAR code.

shawnlaffan added a commit that referenced this issue Apr 29, 2016
Also clean up the logic to check for missing files, as more recent versions of PAR handle that now.

Updates issue #413
shawnlaffan added a commit that referenced this issue Apr 29, 2016
All the requisite files are now in the ui folder.

Move strip_redundant_text.pl across in case it is needed.

Updates issue #413.
shawnlaffan added a commit that referenced this issue Apr 30, 2016
shawnlaffan added a commit that referenced this issue May 3, 2016
Otherwise some of the widgets took up too much space.

Updates issue #413
@shawnlaffan
Copy link
Owner

Mark as fixed.
Kudos to @andersonku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants