Re: Failure to add radio buttons to popup menu.



I combined ideas from the book/menus/main_menu and book/menus/popup examples in gtkmm-documentation. Then it works. See attached files.

On 2020-12-04 16:51, Carlo Wood wrote:
Hi Kjell,

I've been trying for days to get radio buttons working
in my popup menu. I can't get closer than "it doesn't work".

Most notably, the line

    refActionGroup->add_action_radio_string("radio",
    sigc::mem_fun(*this, &ExampleWindow::on_menu_file_popup_radio),
    "'A'");

doesn't even cause the call back function to be called
when I click on the radio menu entry.

Can you please tell me what I do wrong and how it should
be done?

I reproduced my problem by editing
gtkmm-documentation/-/blob/gtkmm-3-24/examples/book/menus/popup

The cloned repository and commit can be found here:

https://gitlab.gnome.org/carlo.wood/gtkmm-documentation/-/commit/e106f79c78bba7ad265817a74897f09501d024db

If you clone my repository, please note that the change was
made to the gtkmm-3-24 branch (not master)!

Or you can copy the two changed files from here:

https://gitlab.gnome.org/carlo.wood/gtkmm-documentation/-/blob/gtkmm-3-24/examples/book/menus/popup/examplewindow.cc
https://gitlab.gnome.org/carlo.wood/gtkmm-documentation/-/blob/gtkmm-3-24/examples/book/menus/popup/examplewindow.h

Any pointers would be greatly appreciated.

Regards,
Carlo Wood
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Attachment: examplewindow.h
Description: Text Data

Attachment: examplewindow.cc
Description: Text Data



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