Re: Can't locate object method "popup" via package "Gtk3::Menu"



On 22.04.2012 17:57, intrigeri wrote:
intrigeri wrote (16 Apr 2012 19:13:06 GMT) :
and right-clicking on the status icon, on gets:

So this test program now runs without throwing exceptions,
*but* the context menu displayed on right-click only displays
the separator.

Well, there are two things going on here, and one more that is related:

• You're missing the $menu->append($item) call, but that's probably an artifact of the reduction to the example.

• You're using Gtk3::MenuItem->new('something'), which resolves to gtk_menu_item_new which does not take any arguments, hence the label is ignored. In Gtk2, we overload Gtk2::MenuItem->new to resolve to new_with_mnemonic if a label is provided. Gtk3 does not do this yet; I'll add the overrides soon.

• There was a bug in G:O:I occurring when undef was given for a callback. If you change your example to construct the menu inside the signal handler, then it triggers this bug. I just fixed it in git.



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