Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 11, 2017 12:41 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 3:55 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
I have a registration window in which I would like people to be able to paste their serial number.
Its a movable modal dialog
I have a menu which only contains Paste, and I attach it to the window.

RB 2012R2
In Carbon, the menu is present, and I can paste.
In Cocoa, the menu is not present and paste does not work.

Is this fixed in Xojo?


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 8:01 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
are you using MenuBar1 and Menubar2 where you switch between them dependingon the window you are displaying?

Seems that I read somewhere that Cocoa does not support that (and if that is correct... then Xojo can't "fix" it)

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 2:17 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
So in Cocoa you get one menu and thats it?
Thats progress.
Not.

So I either CANT have paste work on a modal dialog, or the dialog displays a massive irrelevant menu?
Which new Apple guidelines say you shouldnt hide but just disable bits from?

Urgh.

Surely there must be a way to allow paste to work without having a menu attached to a window, then?
Its just paste...


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 2:24 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
sure... intercept Cmd-V (or Cntrl-V) depending on platform in Keydown and manipulate the clipboard yourself.

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: How to make PASTE work without a menu
PostPosted: Sat May 18, 2013 2:29 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
OK..
Out of the box thinking then..

If its a text box, and someone presses V with the right keyboard option, we need to paste the clipboard..

This appears to work in the keydown event

dim c as new Clipboard
if (key = "v" or key = "V" )and Keyboard.AsyncMenuShortcutKey and c.TextAvailable then
me.Text = C.Text
end if


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 2:42 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
kermit wrote:
So in Cocoa you get one menu and thats it?

I don't think that's entirely accurate. Others will have to chime in here. The real issue is you can't have more than one instance of a menu item. You have to clone them to create the second menu. Carbon allows you to reuse menuitems. Cocoa does not.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 2:49 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
DaveS wrote:
Seems that I read somewhere that Cocoa does not support that (and if that is correct... then Xojo can't "fix" it)

kermit wrote:
So in Cocoa you get one menu and thats it?
Thats progress.
Not.


dave is incorrect - you can use many menu bars

try it

and yes if you enable the paste item it should work just fine

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 3:09 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Quote:
dave is incorrect - you can use many menu bars
try it


Did
Doesn't.
Hence the post.

There is a clear difference between Cocoa and Carbon: I only have to change the build settings to lose the menu.
Its not a question of 'menus dont work'
The menu doesn't even appear.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sat May 18, 2013 3:36 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
kermit wrote:
Quote:
dave is incorrect - you can use many menu bars
try it


Did
Doesn't.
Hence the post.

There is a clear difference between Cocoa and Carbon: I only have to change the build settings to lose the menu.
Its not a question of 'menus dont work'
The menu doesn't even appear.


Odd as I also tried it with a movable modal before posting and it switched the menu bar just fine & enabled the paste item which then worked
Can't imagine what you're doing differently ?

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sun May 19, 2013 4:08 am 
Offline

Joined: Wed Feb 04, 2009 1:43 pm
Posts: 427
This is (was) a bug. It works fine now with Xojo.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cocoa: Unable to get a menu on non-main window
PostPosted: Sun May 19, 2013 5:56 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Quote:
This is (was) a bug. It works fine now with Xojo.


Thank you.
I expect thats what Norman is using.
But this is what I needed to know.
The CMD-V option is actually a better one for me now, so the panic is over for the moment.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group