Re: Stock item "GO_BACK"




2013-12-04 16:28, John Emmas skrev:
I'm building a gtkmm dialog which uses the following line of code to add a button (where 'back_button' is of type Gtk::Button*):-

        back_button = add_button (Stock::GO_BACK, RESPONSE_NO);

When the specified button is 'Stock::GO_BACK' the program repeatedly crashes at run time. I've tried around 20 other values (Stock::OPEN / Stock::CANCEL / Stock::QUIT etc) and all of them worked successfully. It's just that one value which crashes. The only discrepancy I can see is this (in gtkmm/stock.h):-

extern GTKMM_API const Gtk::BuiltinStockID GO_BACK; /*!< left-to-right languages: @image html gtk-go-back-ltr.png */

compared to this, in gtkstock.h (libgtk):-

    /**
     * GTK_STOCK_GO_BACK:
     *
     * The "Back" item.
* <inlinegraphic fileref="go-previous-ltr.png" format="PNG"></inlinegraphic>
     * RTL variant
* <inlinegraphic fileref="go-previous-rtl.png" format="PNG"></inlinegraphic>
     */
    #define GTK_STOCK_GO_BACK  "gtk-go-back"

Notice from the comments that gtkmm seems to think the graphic image should be called "gtk-go-back-ltr.png" whereas gtkmm thinks it's called "go-previous-ltr.png". I don't know if I happened to pick 20 good examples but in all the other cases, gtkmm and gtk+ seemed to agree about the name. Could this disagreement be causing my crash? And if so, which name is the right one?

John
No, this disagreement can't cause your crash. It's in a comment. It probably affects the reference documentation. Probably no icon is shown in the documentation. GO_FORWARD has a similar disagreement.

Gtk::Stock::GO_BACK is initialized like so:
  const Gtk::BuiltinStockID GO_BACK = { GTK_STOCK_GO_BACK };

The icon files are probably called go-previous-ltr.png and go-previous-rtl.png. I found the following line in gtkiconfactory.c, but I don't know exactly what it means:
  register_bidi_stock_icon (factory, GTK_STOCK_GO_BACK, "go-previous");



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