Re: Gtk::Builder and item id

On Montag, 6. November 2017 15:38:32 CET Christian Schoenebeck wrote:
    uiBuilder = Gtk::Builder::create();
    Glib::ustring ui_info =
        "  <menu id='menu-PopupMenuInsideDimRegion'>"
        "    <section>"
        "      <item id='item-split'>"
        "      </item>"
        "    </section>"
        "  </menu>"
Now the problem is, that add_from_string() throws the following exception:

      Attribute "id" invalid for element "item"

Is that a bug?

Ok, after reviewing the relevant Gtk+ code, the current Gtk Builder XML parser 
clearly does not accept an "id" attribute for "item" elements:
        (Line 107) :


 which contradicts to both, what the Gtk+ docs say, quote:

         "Objects may be given a name with the “id” attribute, which allows the 
        application to retrieve them from the builder with 
        ( )

as well as contradicts to the format's schema file:
        (Line 58) :

        item = element item {
                attribute id { xsd:ID } ?,
                 (attribute_ | link) *

But I guess I have to move this issue over to the Gtk+ list.

However I wonder if I am really the first one encountering this issue. I mean 
it should be quite common to retrieve menu items at runtime. Or does that mean 
other people are using a different approach by assembling menus with

        <object class="GtkMenuItem" id="foo">

format instead?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]