diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/inc/aquavclevents.hxx ooo_SRC680_m177_src/vcl/aqua/inc/aquavclevents.hxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/inc/aquavclevents.hxx	2006-07-22 17:33:06.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/inc/aquavclevents.hxx	2006-07-22 17:33:07.000000000 +0200
@@ -35,4 +35,10 @@
 const EventTypeSpec cWindowResizeStarted = { kEventClassWindow, kEventWindowResizeStarted };
 const EventTypeSpec cWindowResizeCompleted = { kEventClassWindow, kEventWindowResizeCompleted };
 
+/* Events for native menus */
+const EventTypeSpec cCommandProcessEvent	= { kEventClassCommand,	kEventCommandProcess };
+const EventTypeSpec cMenuPopulateEvent		= { kEventClassMenu,	kEventMenuPopulate };
+const EventTypeSpec cMenuClosedEvent		= { kEventClassMenu,	kEventMenuClosed };
+const EventTypeSpec cMenuTargetItemEvent	= { kEventClassMenu,	kEventMenuTargetItem };
+
 #endif // INCLUDED_AQUAVCLEVENTS_HXX
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/inc/salframe.h ooo_SRC680_m177_src/vcl/aqua/inc/salframe.h
--- ooo_SRC680_m177_src.orig/vcl/aqua/inc/salframe.h	2006-07-22 17:33:06.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/inc/salframe.h	2006-07-22 17:33:07.000000000 +0200
@@ -38,6 +38,8 @@
 
 #include <salframe.hxx>
 
+#include <salmenu.h>
+
 #ifndef _SV_SV_H
 #include <sv.h>
 #endif
@@ -184,6 +186,9 @@
     typedef std::pair<EventHandlerUPP, EventHandlerRef> SysWindowEventHandlerData_t;
     typedef std::vector<SysWindowEventHandlerData_t> SysWindowEventHandlerDataContainer_t;
     SysWindowEventHandlerDataContainer_t mSysWindowEventHandlerDataContainer;
+
+    // Menu associated with this SalFrame
+    AquaSalMenu *myMenu;
 };
     
 #endif // _SV_SALFRAME_H
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/inc/salmenu.h ooo_SRC680_m177_src/vcl/aqua/inc/salmenu.h
--- ooo_SRC680_m177_src.orig/vcl/aqua/inc/salmenu.h	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m177_src/vcl/aqua/inc/salmenu.h	2006-07-22 23:55:46.000000000 +0200
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: salmenu.h,v $
+ *
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: rt $ $Date: 2005/09/09 12:45:35 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_SALMENU_H
+#define _SV_SALMENU_H
+
+#include <premac.h>
+#include <Carbon/Carbon.h>
+#include <postmac.h>
+
+#ifndef _SV_SV_H
+#include <sv.h>
+#endif
+#ifndef _SV_BITMAP_HXX
+#include <bitmap.hxx>
+#endif
+
+#ifndef _SV_SALMENU_HXX
+#include <salmenu.hxx>
+#endif
+
+
+class AquaSalMenu : public SalMenu
+{
+public:
+	AquaSalMenu() {}
+	virtual ~AquaSalMenu();
+
+	virtual BOOL VisibleMenuBar();  // must return TRUE to actually DISPLAY native menu bars
+					// otherwise only menu messages are processed (eg, OLE on Windows)
+
+	virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos );
+	virtual void RemoveItem( unsigned nPos );
+	virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos );
+	virtual void SetFrame( const SalFrame* pFrame );
+	virtual void CheckItem( unsigned nPos, BOOL bCheck );
+	virtual void EnableItem( unsigned nPos, BOOL bEnable );
+	virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText );
+	virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage);
+	virtual void SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName );
+	virtual void GetSystemMenuData( SystemMenuData* pData );
+
+	CFStringRef sMenuText;		// Title of this menu
+	MenuRef myMenuRef;		// The Carbon reference to this menu
+	MenuID myMenuID;		// The MenuID of this menu
+
+	BOOL bMenuBar;		// TRUE - Menubar
+				// FALSE - Menu
+};
+
+class AquaSalMenuItem : public SalMenuItem
+{
+public:
+	AquaSalMenuItem() {}
+        virtual ~AquaSalMenuItem();
+
+	USHORT nId;			// Item ID
+	Menu *myMenu;			// Menu into which this MenuItem is inserted
+	CFStringRef sMenuText;		// Title of this menu item
+	MenuRef parentMenuRef;		// The menu in which this menu item is inserted
+
+	MenuItemIndex myMenuItemIndex;	// The menu index of this menu item in the myMenu menu
+					// It is 1 based, so the first
+					// menu item's MenuItemIndex in the menu has value 1
+
+	MenuItemAttributes menuAttributes; // menu attributes of this menu item
+};
+
+#endif // _SV_SALMENU_H
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/app/salinst.cxx ooo_SRC680_m177_src/vcl/aqua/source/app/salinst.cxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/app/salinst.cxx	2006-07-22 17:33:06.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/source/app/salinst.cxx	2006-07-22 17:33:07.000000000 +0200
@@ -612,26 +612,6 @@
 
 
 
-SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
-{
-    return NULL;
-}
-
-void AquaSalInstance::DestroyMenu( SalMenu* )
-{
-    
-}
-
-SalMenuItem* AquaSalInstance::CreateMenuItem( const SalItemParams* pItemData )
-{
-    
-}
-
-void AquaSalInstance::DestroyMenuItem( SalMenuItem* )
-{
-    
-}
-
 SalSound* AquaSalInstance::CreateSalSound()
 {
     return new AquaSalSound();
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/window/makefile.mk ooo_SRC680_m177_src/vcl/aqua/source/window/makefile.mk
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/window/makefile.mk	2006-07-22 17:33:06.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/source/window/makefile.mk	2006-07-22 17:33:07.000000000 +0200
@@ -59,6 +59,7 @@
 
 SLOFILES=	\
 		$(SLO)/salframe.obj		\
+		$(SLO)/salmenu.obj		\
 		$(SLO)/salobj.obj
 
 .ENDIF		# "$(GUIBASE)"!="aqua"
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salframe.cxx ooo_SRC680_m177_src/vcl/aqua/source/window/salframe.cxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salframe.cxx	2006-07-22 17:33:06.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/aqua/source/window/salframe.cxx	2006-07-23 11:12:54.000000000 +0200
@@ -47,6 +47,9 @@
 #ifndef _SV_SALFRAME_H
 #include <salframe.h>
 #endif
+#ifndef _SV_SALMENU_H
+#include <salmenu.h>
+#endif
 #ifndef _SV_SALTIMER_H
 #include <saltimer.h>
 #endif
@@ -276,6 +279,8 @@
         ShowWindow(mrWindow);
         if(!bNoActivate)
             SelectWindow(mrWindow); //ActivateWindow(mrWindow, true);
+	if (myMenu)
+	  SetRootMenu(myMenu->myMenuRef);
     }
     else
         HideWindow(mrWindow);
@@ -594,7 +599,8 @@
 void AquaSalFrame::SetMenu( SalMenu* pSalMenu )
 {
     fprintf(stderr, ">*>_> %s\n",__func__);
-    //TODO: implement
+
+    myMenu = (AquaSalMenu *) pSalMenu;
 }
 
 void AquaSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
@@ -674,6 +680,140 @@
     //DbgPrintFrameGeometry(fullWindowRect, contentRect, titleBarRect, maGeometry);
 }
 
+OSStatus HandleCommandProcessEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
+{
+
+    ImplSalYieldMutexAcquire();
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    HICommand commandStruct;
+
+    GetEventParameter (inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &commandStruct);
+
+    // If the CommandProcess event is from menu, print its MenuRef and itemidex
+    if ( commandStruct.attributes & kHICommandFromMenu ) {
+
+      fprintf(stderr, "PJ: CommandProcess, SALEVENT_MENUCOMMAND event!\n");
+
+      fprintf(stderr, "PJ: Menu item selected, MenuRef = %p, (%d. item)\n",
+	      commandStruct.menu.menuRef, commandStruct.menu.menuItemIndex);
+
+      UInt32 pointer;
+      GetMenuItemRefCon (commandStruct.menu.menuRef,
+			 commandStruct.menu.menuItemIndex,
+			 &pointer);
+      SalMenuItem *pSalMenuItem = (SalMenuItem *) pointer;
+      fprintf(stderr, "PJ: SalMenuItem = %p\n", pSalMenuItem);
+      fprintf(stderr, "PJ: nId = %p\n", ((AquaSalMenuItem *)pSalMenuItem)->nId);
+
+      // Posting native menu event...
+      SalMenuEvent aMenuEvt;
+      aMenuEvt.mnId = ((AquaSalMenuItem *)pSalMenuItem)->nId;
+      aMenuEvt.mpMenu = ((AquaSalMenuItem *)pSalMenuItem)->myMenu;
+      pSalFrame->CallCallback(SALEVENT_MENUCOMMAND, &aMenuEvt);
+    }
+
+    ImplSalYieldMutexRelease();
+
+    return noErr;
+}
+
+OSStatus HandleMenuPopulateEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
+{
+
+    ImplSalYieldMutexAcquire();
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    fprintf(stderr, "PJ: MenuPopulate, SALEVENT_MENUACTIVATE event!\n");
+
+    MenuRef pMenuRef;
+
+    GetEventParameter (inEvent, kEventParamDirectObject, typeMenuRef, NULL, sizeof(typeMenuRef), NULL, &pMenuRef);
+    fprintf(stderr, "PJ: MenuRef = %p\n", pMenuRef);
+
+    UInt32 pointer;
+    GetMenuItemRefCon (pMenuRef, 0, &pointer);
+    SalMenu *pSalMenu = (SalMenu *) pointer;
+    fprintf(stderr, "PJ: SalMenu = %p\n", pSalMenu);
+
+    // Posting native menu event...
+    SalMenuEvent aMenuEvt;
+    aMenuEvt.mpMenu = pSalMenu;
+    // FIXME: This does not propagate to the application yet. WHY?
+    // pSalFrame->CallCallback(SALEVENT_MENUACTIVATE, &aMenuEvt);
+
+    ImplSalYieldMutexRelease();
+
+    return noErr;
+}
+
+OSStatus HandleMenuClosedEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
+{
+
+    ImplSalYieldMutexAcquire();
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    fprintf(stderr, "PJ: MenuClosed, SALEVENT_MENUDEACTIVATE event!\n");
+
+    MenuRef pMenuRef;
+
+    GetEventParameter (inEvent, kEventParamDirectObject, typeMenuRef, NULL, sizeof(typeMenuRef), NULL, &pMenuRef);
+    fprintf(stderr, "PJ: MenuRef = %p\n", pMenuRef);
+
+    UInt32 pointer;
+    GetMenuItemRefCon (pMenuRef, 0, &pointer);
+    SalMenu *pSalMenu = (SalMenu *) pointer;
+    fprintf(stderr, "PJ: SalMenu = %p\n", pSalMenu);
+
+    // Posting native menu event...
+    SalMenuEvent aMenuEvt;
+    aMenuEvt.mpMenu = pSalMenu;
+    // FIXME: This does not propagate to the application yet. WHY?
+    // pSalFrame->CallCallback(SALEVENT_MENUDEACTIVATE, &aMenuEvt);
+
+    ImplSalYieldMutexRelease();
+
+    return noErr;
+}
+
+OSStatus HandleMenuTargetItemEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
+{
+
+    ImplSalYieldMutexAcquire();
+    AquaSalFrame* pSalFrame = reinterpret_cast<AquaSalFrame*>(inUserData);
+
+    fprintf(stderr, "PJ: MenuTargetItem, SALEVENT_MENUHIGHLIGHT event!\n");
+
+    MenuRef pMenuRef;
+    MenuItemIndex myMenuItemIndex;
+
+    GetEventParameter (inEvent, kEventParamDirectObject, typeMenuRef, NULL, sizeof(typeMenuRef), NULL, &pMenuRef);
+    GetEventParameter (inEvent, kEventParamMenuItemIndex, typeMenuItemIndex, NULL, sizeof(typeMenuItemIndex), NULL, &myMenuItemIndex);
+    fprintf(stderr, "PJ: MenuRef = %p\n", pMenuRef);
+    fprintf(stderr, "PJ: MenuItemIndex = %p\n", myMenuItemIndex);
+
+    // kEventMenutargetItem is sent also for top-level items. Ignore
+    // them (MenuItemIndex == 0 for them).
+    if (myMenuItemIndex != 0) {
+      UInt32 pointer;
+      GetMenuItemRefCon (pMenuRef, myMenuItemIndex, &pointer);
+
+      SalMenuItem *pSalMenuItem = (SalMenuItem *) pointer;
+      fprintf(stderr, "PJ: SalMenuItem = %p\n", pSalMenuItem);
+      fprintf(stderr, "PJ: nId = %p\n", ((AquaSalMenuItem *)pSalMenuItem)->nId);
+
+      // Posting native menu event...
+      SalMenuEvent aMenuEvt;
+      aMenuEvt.mnId = ((AquaSalMenuItem *)pSalMenuItem)->nId;
+      aMenuEvt.mpMenu = ((AquaSalMenuItem *)pSalMenuItem)->myMenu;
+      pSalFrame->CallCallback(SALEVENT_MENUHIGHLIGHT, &aMenuEvt);
+    }
+
+    ImplSalYieldMutexRelease();
+
+    return noErr;
+}
+
 OSStatus HandleWindowCloseEvent(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
 {
     BOOST_ASSERT(GetEventClass(inEvent) == kEventClassWindow && GetEventKind(inEvent) == kEventWindowClose && "Only WindowClose event expected");
@@ -1089,6 +1229,13 @@
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleMouseUpDownEvent), GetEventTypeCount(cMouseUpDownEvent), cMouseUpDownEvent);
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleWindowResizeStarted), 1, &cWindowResizeStarted);
     InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleWindowResizeCompleted), 1, &cWindowResizeCompleted);
+
+    /* Menu event handlers*/
+
+    InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleCommandProcessEvent), 1, &cCommandProcessEvent);
+    InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleMenuPopulateEvent), 1, &cMenuPopulateEvent);
+    InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleMenuClosedEvent), 1, &cMenuClosedEvent);
+    InstallAndRegisterEventHandler(NewEventHandlerUPP(HandleMenuTargetItemEvent), 1, &cMenuTargetItemEvent);
 }
 
 OSStatus AquaSalFrame::InstallAndRegisterEventHandler(EventHandlerUPP upp, size_t nEvents, const EventTypeSpec* eventSpec)
diff -urN ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salmenu.cxx ooo_SRC680_m177_src/vcl/aqua/source/window/salmenu.cxx
--- ooo_SRC680_m177_src.orig/vcl/aqua/source/window/salmenu.cxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m177_src/vcl/aqua/source/window/salmenu.cxx	2006-07-23 10:00:35.000000000 +0200
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile: salmenu.cxx,v $
+ *
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: rt $ $Date: 2005/09/09 13:51:47 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
+ *
+ ************************************************************************/
+
+
+#ifndef _SV_SALDATA_HXX
+#include <saldata.hxx>
+#endif
+#ifndef _SV_SALINST_H
+#include <salinst.h>
+#endif
+#ifndef _SV_SALMENU_H
+#include <salmenu.h>
+#endif
+
+
+// =======================================================================
+
+SalMenu* AquaSalInstance::CreateMenu( BOOL bMenuBar )
+{
+  fprintf(stderr, "PJ: AquaSalInstance::CreateMenu(%d)\n", bMenuBar);
+
+  AquaSalMenu *pAquaSalMenu = new AquaSalMenu();
+
+  pAquaSalMenu->bMenuBar = bMenuBar;
+
+  // FIXME: any other solution for MenuIDs for CreateNewMenu?
+  // Do we need to store it at all?
+  static MenuID inMenuID=0;
+  pAquaSalMenu->myMenuID = inMenuID++;
+
+  CreateNewMenu (pAquaSalMenu->myMenuID, 0, &pAquaSalMenu->myMenuRef);
+
+  /* Associate the pointer to this SalMenu with the menu */
+  fprintf(stderr, "PJ: Associating %p, 0 = %p\n", pAquaSalMenu->myMenuRef, pAquaSalMenu);
+
+  // FIXME: should probably be done using SetMenuItemProperty, but I
+  // was not able to make it work properly outside of this
+  // function. It worked here, but not in salframe.cxx :-(
+  // So for now, I'll misuse SetMenuItemRefCon and pass pointer to
+  // this SalMenu to it as UInt32
+  SetMenuItemRefCon (pAquaSalMenu->myMenuRef, 0, (UInt32) pAquaSalMenu);
+
+  fprintf(stderr, "PJ: returning %p (MenuRef = %p)\n", pAquaSalMenu, pAquaSalMenu->myMenuRef);
+
+  return pAquaSalMenu;
+}
+
+void AquaSalInstance::DestroyMenu( SalMenu* pSalMenu )
+{
+  /* PJ: FIXME: delete myMenuRef */
+    delete pSalMenu;
+}
+
+SalMenuItem* AquaSalInstance::CreateMenuItem( const SalItemParams* pItemData )
+{
+  fprintf(stderr, "PJ: AquaSalInstance::CreateMenuItem()\n");
+
+  if( !pItemData )
+    return NULL;
+
+  AquaSalMenuItem *pSalMenuItem = new AquaSalMenuItem();
+
+  pSalMenuItem->menuAttributes = 0;
+  pSalMenuItem->nId = pItemData->nId;
+
+  pSalMenuItem->sMenuText = CFStringCreateWithFormat(NULL, NULL, CFSTR("%s"),
+			     ByteString(pItemData->aText,RTL_TEXTENCODING_UTF8).GetBuffer());
+  fprintf(stderr, "PJ: sMenuText = %s\n",
+	  ByteString(pItemData->aText, RTL_TEXTENCODING_UTF8).GetBuffer());
+
+  pSalMenuItem->myMenu = pItemData->pMenu;
+
+  fprintf(stderr, "PJ: nId = %d\n", pItemData->nId);
+  fprintf(stderr, "PJ: returning %p\n", pSalMenuItem);
+
+  fprintf(stderr, "PJ: Separator = %d\n", pItemData->eType & MENUITEM_SEPARATOR);
+
+  if (pItemData->eType == MENUITEM_SEPARATOR)
+    pSalMenuItem->menuAttributes |= kMenuItemAttrSeparator;
+  
+  return pSalMenuItem;
+}
+
+void AquaSalInstance::DestroyMenuItem( SalMenuItem* pSalMenuItem )
+{
+    delete pSalMenuItem;
+}
+
+
+// =======================================================================
+
+
+/*
+ * AquaSalMenu
+ */
+
+
+AquaSalMenu::~AquaSalMenu()
+{
+}
+
+BOOL AquaSalMenu::VisibleMenuBar()
+{
+  fprintf(stderr, "PJ: VisibleMenuBar called!\n");
+    return TRUE;
+}
+
+void AquaSalMenu::SetFrame( const SalFrame *pFrame )
+{
+  fprintf(stderr, "PJ: SetFrame called!\n");
+}
+
+void AquaSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
+{
+  fprintf(stderr, "PJ: AquaSalMenu::InsertItem called (%p, nPos = %d)\n.", pSalMenuItem, nPos);
+
+  AquaSalMenuItem *pAquaSalMenuItem = (AquaSalMenuItem *) pSalMenuItem;
+  fprintf(stderr, "PJ: pAquaSalMenuItem = %p\n", pAquaSalMenuItem);
+
+  // save MenuRef of the menu for future reference
+  pAquaSalMenuItem->parentMenuRef = myMenuRef;
+
+  fprintf(stderr, "PJ: bMenuBar = %d\n", bMenuBar);
+
+  if (bMenuBar)
+    AppendMenuItemTextWithCFString( myMenuRef, NULL,  pAquaSalMenuItem->menuAttributes, 0, &pAquaSalMenuItem->myMenuItemIndex);
+  else
+    AppendMenuItemTextWithCFString( myMenuRef, pAquaSalMenuItem->sMenuText,  pAquaSalMenuItem->menuAttributes, 0, &pAquaSalMenuItem->myMenuItemIndex);
+
+  /* Associate the pointer to this SalMenuItem with the menu item */
+  fprintf(stderr, "PJ: Associating %p, %d = %p\n", myMenuRef, pAquaSalMenuItem->myMenuItemIndex, pSalMenuItem);
+
+  // FIXME: should probably be done using SetMenuItemProperty, but I
+  // was not able to make it work properly outside of this
+  // function. It worked here, but not in salframe.cxx :-(
+  // So for now, I'll misuse SetMenuItemRefCon and pass pointer to
+  // this SalMenuItem to it as UInt32
+  SetMenuItemRefCon (myMenuRef, pAquaSalMenuItem->myMenuItemIndex, (UInt32) pSalMenuItem);
+}
+
+void AquaSalMenu::RemoveItem( unsigned nPos )
+{
+}
+
+void AquaSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos )
+{
+  fprintf(stderr, "PJ: SetSubMenu called!\n");
+
+  AquaSalMenuItem *pAquaSalMenuItem = (AquaSalMenuItem *) pSalMenuItem;
+
+  AquaSalMenu *subAquaSalMenu = (AquaSalMenu *) pSubMenu;
+
+  CFStringRef sMenuText = pAquaSalMenuItem->sMenuText;
+
+  fprintf(stderr, "PJ: pSalMenuItem = %p\n", pSalMenuItem);
+  fprintf(stderr, "PJ: pSubMenu = %p\n", pSubMenu);
+  fprintf(stderr, "PJ: nPos = %d\n", nPos);
+
+  SetMenuTitleWithCFString(subAquaSalMenu->myMenuRef, sMenuText);
+  SetMenuItemHierarchicalMenu (myMenuRef, pAquaSalMenuItem->myMenuItemIndex, subAquaSalMenu->myMenuRef);
+}
+
+void AquaSalMenu::CheckItem( unsigned nPos, BOOL bCheck )
+{
+  // nPos is 0 based, MenuItemIndex is 1 based
+  CheckMenuItem(this->myMenuRef, nPos+1, bCheck);
+}
+
+void AquaSalMenu::EnableItem( unsigned nPos, BOOL bEnable )
+{
+  // nPos is 0 based, MenuItemIndex is 1 based
+  if (bEnable)
+    EnableMenuItem(this->myMenuRef, nPos+1);
+  else
+    DisableMenuItem(this->myMenuRef, nPos+1);
+}
+
+void AquaSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage )
+{
+}
+
+void AquaSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText )
+{
+  fprintf(stderr, "PJ: SetItemText (rText = %s).\n", rText.GetBuffer());
+}
+
+void AquaSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const XubString& rKeyName )
+{
+}
+
+void AquaSalMenu::GetSystemMenuData( SystemMenuData* pData )
+{
+}
+
+// =======================================================================
+
+/*
+ * SalMenuItem
+ */
+
+
+AquaSalMenuItem::~AquaSalMenuItem()
+{
+}
+
+// -------------------------------------------------------------------
+
diff -urN ooo_SRC680_m177_src.orig/vcl/workben/svdem.cxx ooo_SRC680_m177_src/vcl/workben/svdem.cxx
--- ooo_SRC680_m177_src.orig/vcl/workben/svdem.cxx	2006-07-22 17:33:07.000000000 +0200
+++ ooo_SRC680_m177_src/vcl/workben/svdem.cxx	2006-07-23 11:40:21.000000000 +0200
@@ -42,6 +42,7 @@
 #include <msgbox.hxx>
 #include <introwin.hxx>
 #include <msgbox.hxx>
+#include <menu.hxx>
 
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/servicefactory.hxx>
@@ -87,10 +88,83 @@
 	void		KeyUp( const KeyEvent& rKEvt );
 	void		Paint( const Rectangle& rRect );
 	void		Resize();
+	MenuBar		aMenuBar;
+	PopupMenu	aFileMenu;
+	PopupMenu	aEditMenu;
+
+	DECL_LINK(MyFileSelectHandler, Menu *);
+	DECL_LINK(MyEditSelectHandler, Menu *);
+
+	DECL_LINK(MyFileHighlightHandler, Menu *);
+	DECL_LINK(MyEditHighlightHandler, Menu *);
 };
 
 // -----------------------------------------------------------------------
 
+IMPL_LINK (MyWin, MyFileSelectHandler, Menu *, pMenu)
+{
+  fprintf (stderr, "MyFileSelectHandler called!\n");
+
+  USHORT nItemId = pMenu->GetCurItemId();
+  fprintf(stderr, "PJ: nItemId = %d\n", nItemId);
+
+  if ( nItemId == 1)
+    fprintf(stderr, "PJ: Open selected\n");
+  else if ( nItemId == 4) {
+    fprintf(stderr, "PJ: Exit selected -> Quit!\n");
+    exit(0);
+  }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK (MyWin, MyEditSelectHandler, Menu *, pMenu)
+{
+  fprintf (stderr, "MyEditSelectHandler called!\n");
+
+  USHORT nItemId = pMenu->GetCurItemId();
+  fprintf(stderr, "PJ: nItemId = %d\n", nItemId);
+
+  if ( nItemId == 1)
+    fprintf(stderr, "PJ: Search selected\n");
+  else if ( nItemId == 2)
+    fprintf(stderr, "PJ: Replace selected\n");
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK (MyWin, MyFileHighlightHandler, Menu *, pMenu)
+{
+  fprintf (stderr, "MyFileHighlightHandler called!\n");
+
+  USHORT nItemId = pMenu->GetCurItemId();
+  fprintf(stderr, "PJ: nItemId = %d\n", nItemId);
+
+  if ( nItemId == 1)
+    fprintf(stderr, "PJ: Open highlighted\n");
+  else if ( nItemId == 2)
+    fprintf(stderr, "PJ: Close highlighted\n");
+  else if ( nItemId == 4)
+    fprintf(stderr, "PJ: Exit highlighted, take care when selecting it!\n");
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK (MyWin, MyEditHighlightHandler, Menu *, pMenu)
+{
+  fprintf (stderr, "MyEditHighlightHandler called!\n");
+
+  USHORT nItemId = pMenu->GetCurItemId();
+  fprintf(stderr, "PJ: nItemId = %d\n", nItemId);
+
+  if ( nItemId == 1)
+    fprintf(stderr, "PJ: Search highlighted\n");
+  else if ( nItemId == 2)
+    fprintf(stderr, "PJ: Replace highlighted\n");
+}
+
+// -----------------------------------------------------------------------
+
 void Main()
 {
     /*
@@ -104,10 +178,82 @@
 	aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
 	aMainWin.Show();
 
-    /*
-    InfoBox ib(NULL, String((sal_Char*)"Test", sizeof("Test")));
-    ib.Execute();
-    */
+#define PJ_DEBUG(STRING) fprintf(stderr, "PJ: --- " STRING " ---\n");
+
+	PJ_DEBUG("1");
+
+	aMainWin.aMenuBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "File" ) ) );
+
+	PJ_DEBUG("2");
+
+	aMainWin.aMenuBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Edit" ) ) );
+
+	PJ_DEBUG("3");
+
+	aMainWin.aMenuBar.SetPopupMenu( 1, &aMainWin.aFileMenu );
+
+	PJ_DEBUG("4");
+
+	aMainWin.aMenuBar.SetPopupMenu( 2, &aMainWin.aEditMenu );
+
+	PJ_DEBUG("5");
+
+	aMainWin.aFileMenu.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Open" ) ));
+
+	PJ_DEBUG("6");
+
+	aMainWin.aFileMenu.CheckItem( 1, TRUE);
+
+	PJ_DEBUG("7");
+
+	aMainWin.aFileMenu.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Close" ) ));
+
+	PJ_DEBUG("8");
+
+	aMainWin.aFileMenu.EnableItem( 2, FALSE);
+
+	PJ_DEBUG("9");
+
+	aMainWin.aFileMenu.InsertSeparator( 3 );
+
+	PJ_DEBUG("10");
+
+	aMainWin.aFileMenu.InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Exit" ) ));
+
+	PJ_DEBUG("11");
+
+	aMainWin.aFileMenu.SetSelectHdl( LINK( &aMainWin, MyWin, MyFileSelectHandler));
+
+	PJ_DEBUG("12");
+
+	aMainWin.aFileMenu.SetHighlightHdl( LINK( &aMainWin, MyWin, MyFileHighlightHandler));
+
+	PJ_DEBUG("13");
+
+	aMainWin.aEditMenu.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Search" ) ));
+
+	PJ_DEBUG("14");
+
+	aMainWin.aEditMenu.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Replace" ) ));
+
+	PJ_DEBUG("15");
+
+	aMainWin.aEditMenu.SetSelectHdl( LINK( &aMainWin, MyWin, MyEditSelectHandler));
+
+	PJ_DEBUG("16");
+
+	aMainWin.aEditMenu.SetHighlightHdl( LINK( &aMainWin, MyWin, MyEditHighlightHandler));
+
+	PJ_DEBUG("17");
+
+	aMainWin.SetMenuBar( &aMainWin.aMenuBar );
+
+	PJ_DEBUG("18");
+
+	/*
+		InfoBox ib(NULL, String((sal_Char*)"Test", sizeof("Test")));
+		ib.Execute();
+	*/
 
 	Application::Execute();
 }
