Re: Complete example code...


Finally, You are reason... I had the libraries wrongly configured on my system... but now, all seems OK.

Only one question more...

Which is the method to disable all one entire "submenu" (like File, Edit...) ?

With the example code, I made an unsuccessfully test (it compiles but the effect is not as attended) adding a code as follows:


  //Edit menu:

Glib::RefPtr<Gio::SimpleAction> menu_edit = refActionGroup->add_action ("edit");
menu_edit->set_enabled (false);

    sigc::mem_fun(*this, &ExampleWindow::on_menu_others));


    "    <submenu>"
    "      <attribute name='label' translatable='yes'>_Edit</attribute>"
    "      <attribute name='action'>example.edit</attribute>"
    "      <section>"

What's wrong ?


2013/10/25 Murray Cumming <murrayc murrayc com>
On Thu, 2013-10-24 at 15:48 +0200, Glus Xof wrote:
> Hi guys,
> Since the last menu objects related deprecations, I'm a bit
> confused...

There are no deprecations of menu API in the latest stable version, if
you (please) ignore the experiments that happened during the unstable

> Among Gtk::Builder and Gtk::UIManager... Which is the preferred one ?

Ideally, you would not use Gtk::UIManager in new code. But you might
need to. Here are the boring details:

We would like to have only one non-deprecated API, but we've done the
best we can with what GTK+ has given us for now.

> Is it possible to see a complete example of menu programming...
> as, for example, an updated version of the following example code

That example already is the updated one.

Here is the older version of that, using Gtk::UIManager:

> ... or something else (that exits correctly at runtime) ?

If you have an actual bug or problem with some example code, please just
discuss or report that.

Murray Cumming
murrayc murrayc com

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