After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734676 - GtkBuider can't add a GtkMenuButton as a GtkHeaderBar's title
GtkBuider can't add a GtkMenuButton as a GtkHeaderBar's title
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-12 16:32 UTC by Adrien Plazas
Modified: 2018-04-14 23:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
'menu_button' isn't added to the GtkHeaderBar (3.96 KB, text/plain)
2014-08-12 16:32 UTC, Adrien Plazas
Details

Description Adrien Plazas 2014-08-12 16:32:39 UTC
Created attachment 283220 [details]
'menu_button' isn't added to the GtkHeaderBar

Basically, this didn't work:

<child type="title">
  <object class="GtkMenuButton" id="menu_button">
    <property name="visible">True</property>
    <property name="valign">center</property>
    <property name="menu-model">selection-menu</property>

    <child>
      <object class="GtkGrid" id="selection_menu_button_grid">
        …
      </object>
    </child>

    <style>
      <class name="selection-menu"/>
    </style>
  </object>
</child>
Comment 1 Matthias Clasen 2014-08-12 16:48:51 UTC
It kinda works here:

https://git.gnome.org/browse/gtk+/tree/tests/selectionmode.ui

Although it is not quite the same - its not a template, and there's an extra stack involved.

A complete testcase would be helpful. What happens instead, the headerbar stays empty ? or shows the title ?
Comment 2 Adrien Plazas 2014-08-12 17:05:08 UTC
The titlebar stays empty, you can test Boxes's master branch to see what happen by reverting 25c9a14a8e6602f30c64c94d69f4ddbdcf72ec93 as it applies a workaround.
Comment 3 Matthias Clasen 2014-08-14 01:08:22 UTC
The problem is that custom-title is a construct property.
What is happening is that your header bar subclass instance_init calls init_template, which in turn constructs the child of type "title". And then later, the constructor chain is run which gets passed the default value of NULL for the custom-title property, and wipes out the value set earlier.
Comment 4 Matthias Clasen 2018-02-10 05:12:20 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 5 Matthias Clasen 2018-04-14 23:58:15 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new