New topic: 

How do you get Quit to display in PopupMenu using Clone

<http://forums.realsoftware.com/viewtopic.php?t=43892>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        mallen          Post subject: How do you get Quit to display in 
PopupMenu using ClonePosted: Sat May 05, 2012 10:16 pm                         
Joined: Mon Mar 01, 2010 11:59 pm
Posts: 15                I’ve been looking at the example MenuItemPopup.rbp 
in the MenuItem folder with regards to a Cocoa implementation. This mean the 
the code must be changed to use the Clone Method. So the following code:
// And do something really crazy, like add a MenuItem
// that already exists on a menu bar!  Ooooh!
bar.Append( TestFoobar )
bar.Append( TestBarFoo )
bar.Append( FileQuit )

Must be changed to:
// And do something really crazy, like add a MenuItem
// that already exists on a menu bar!  Ooooh!
bar.Append TestFoobar.Clone
bar.Append TestBarFoo.Clone
bar.Append FileQuit.Clone

This will display TestFoobar and TestBarFoo in the popup but Quit does not 
display. The debugger show that the menu has inherited the Cmd+Q and &Quit from 
the menu so the clone is apparently bring made not just displayed.

Some further testing revels that:
bar.Append EditMenu.Child( "EditCut" ).Clone
bar.Append EditMenu.Child( "EditCopy" ).Clone
bar.Append EditMenu.Child( "EditPaste" ).Clone

Will display the Cut, Copy and Paste popups.

But 
bar.Append FileMenu.Child( "FileQuit" ).Clone
Also inherits the Cmd+Q and &Quit from the menu but also fails to display.

And
bar.Append QuitMenuItem.Clone
Will autocomplete but the compiles says this property (Clone) does not exist.

Anyone have any idea how to add Quit to a popupmenu?      
_________________
mallen
iMac 3.4 GHz Intel Core i7, OS X 10.7.3; RS 2011r4.3
"Sometimes you're the windshield, Sometimes you're the bug." — Mark Knopfler, 
The Bug, 1991  
                             Top                NaNdummy          Post subject: 
Re: How do you get Quit to display in PopupMenu using ClonePosted: Sun May 06, 
2012 2:12 am                         
Joined: Thu Dec 01, 2011 2:13 pm
Posts: 221                I would add a normal item (bar.append "Quit") and add 
in the change event the quit method.

not sure if ive understand it right..      
_________________
Mac OS X 10.3-10.7
Windows 2000 (I know it sucks)
Windows Server 2007

You want a bunch of new classes and WebStyles? http://www.webstyleplugin.tk/
Folderitem is too hard? File Bin Class  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to