Hi Ed,

Here you go. 

Mattia: the diff implements GetMenu,SetMenu,SetSubMenu and SetText, all which 
seem to date back to before 2.5.3, hence no version checking.

Ed: I don't have very complicated menus but I store the individual items so 
that they are easy to access (ie. somewhere in $self). This way you do that 
work in perl instead of relying on wxWidgets. It may not be what you are 
after (and your menus sound more complicated than mine!) but if you are stuck 
its an alternative approach that should work.

good luck!
Klaas

On Fri, 03 Aug 2007 05:17:19 Ed W wrote:
> Hi
>
> Is it possible to get wxMenuItem::GetMenu wrapped please?
>
> On a related note, how else is it possible to traverse the menu
> structure to delete a menu item?
>
> It seems as though you need to call Menu->Destroy, but the trick seems
> to be getting the Menu object.  In my case I have a
> menubar->menus->submenus->several items.  I found that
> menubar-FindMenu('Tools') works ok on top level menus, but I can't
> figure out the trick to get a submenu this way?
>
> Pointers appreciated!
>
> Ed W


Index: Menu.xs
===================================================================
--- Menu.xs	(revision 2109)
+++ Menu.xs	(working copy)
@@ -607,6 +607,9 @@
   OUTPUT:
     RETVAL
 
+wxMenu*
+wxMenuItem::GetMenu()
+
 #if defined( __WXMSW__ ) && !defined( __WXWINCE__ )
 
 int
@@ -643,6 +646,9 @@
 bool
 wxMenuItem::IsSeparator()
 
+bool 
+wxMenuItem::IsSubMenu()
+
 #if defined( __WXMSW__ ) && !defined( __WXWINCE__ )
 
 void
@@ -663,6 +669,18 @@
 wxMenuItem::SetHelp( helpString )
     wxString helpString
 
+void 
+wxMenuItem::SetMenu( menu )
+    wxMenu* menu
+
+void 
+wxMenuItem::SetSubMenu( menu )
+    wxMenu* menu
+
+void
+wxMenuItem::SetText( text )
+    wxString text
+
 #if defined( __WXMSW__ ) && !defined( __WXWINCE__ )
 
 void

Reply via email to