绑定事件到wxMenu而不是wxMenuItem [英] Binding event to wxMenu instead of wxMenuItem

查看:496
本文介绍了绑定事件到wxMenu而不是wxMenuItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从xml文件创建动态菜单栏,并使用Connect()将事件绑定到菜单项。

某些菜单中没有项,但需要触发事件。

是否有方法使用Connect()将事件处理程序附加到wxMenu?

Im creating a dynamic MenuBar from xml file, and binding events to menu items using Connect().
Some menus does not have items inside, but needs to fire events.
Is there a way to attach an event handler to a wxMenu using Connect()?

* Im使用wxWidgets 2.8.8& MS VC ++ 6.0

推荐答案

Ive尝试了很多事情,但没有什么成效。

作为wx-widgets列表中的一个快速反应引用

Ive tried many things, but nothing worked out for me.
As a quick answaer ill quote Vadim Zeitlin from wx-widgets list:


不应该将命令
直接关联到顶级菜单。这是在所有系统下不鼓励的
,并且
在某些
下不受支持。

No, you shouldn't associate commands directly to top level menus. This is discouraged under all systems and is not supported at all under some of them.

这篇关于绑定事件到wxMenu而不是wxMenuItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆