Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 22, 2018 7:54 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Window and FullScreenbutton
PostPosted: Mon Jul 25, 2011 1:22 pm 
Offline

Joined: Mon May 10, 2010 6:51 am
Posts: 36
Location: Berlin, Germany
Hey guys,
I have a question, I try to call an external method to add a standardbutton to my window (the FullScreenButton/Lion).
I tried with:
declare sub FullScreenButton lib "Cocoa" selector "setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary" (WID As Integer)
FullScreenButton(self.handle)

I took these snippet:
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];


But it won't work, where am I mistaking?
The only message I received was from RB, that there something went wrong and I should call the FeedbackSystem.
Can anyone help.

Faithful :)

_________________
Visit: Paeric's | OpenSource Code Resources
iMac 8,1 ; PowerBook G4(5,2) ; iBook G3 (Clamshell)


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 11:06 am 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
oh yes, i'd love to see how to achieve this using declares...!

so let's hope anyone familiar with this can help...

it seems that this fullscreen-mode could even work with Carbon, not only Cocoa?
http://www.mbsplugins.de/archive/2011-07-24/Lion_features_for_Real_Studio

so what would the carbon-declares look like...?


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 12:30 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Well, you could try our plugins. :-)

The carbon thing works somehow, but not very good. It's working much better in Cocoa.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 12:40 pm 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
Quote:
Well, you could try our plugins.

That's why i posted the link to your site :-)

Anyway, there are some projects where using Plugins is a "don't want"...
...and as it must be possible to do it in "pure realbasic", we're still interested to learn from those that know how to achieve it that way.


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 1:27 pm 
Offline
Site Admin
User avatar

Joined: Tue May 06, 2008 1:07 pm
Posts: 1464
Location: NotEvenOnTheMap, CT
You need to look into [NSApplication setPresentationOptions:]

_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 4:18 pm 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
here's my first approach...

you can download the example project from here:
http://www.jr-tools.ch/ -> some bits and pieces for REAL Studio Developers

it would be kind to send me your improvements, so that i can update the example for others to use.


Quote:
You need to look into [NSApplication setPresentationOptions:]

for example: the Toolbar doesn't yet hide in this first approach...


Last edited by jraess on Tue Aug 23, 2011 2:43 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Jul 26, 2011 8:24 pm 
Offline

Joined: Mon May 10, 2010 6:51 am
Posts: 36
Location: Berlin, Germany
Ah you're the best!
If I'm allowed to, I want to add this to my Homepage bit changed, but with credits of your's.
I want to create a complete Project including most important Cocoa-Lion-Features for RB users.
(Of cause for free)

Best regards, Patric.

_________________
Visit: Paeric's | OpenSource Code Resources
iMac 8,1 ; PowerBook G4(5,2) ; iBook G3 (Clamshell)


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Thu Jul 28, 2011 10:17 am 
Offline

Joined: Mon Apr 02, 2007 5:51 pm
Posts: 420
Location: Cosalient EHR in Washington
One thing to look out for....

This works with Cocoa targets, but with Carbon apps, there are some issues....

The window will indeed go full screen under Lion, but the Carbon RS framework won't properly resize and position your window contents and their clipping regions that are locked to borders. This fails despite the resized event firing.

At least this is what I see using the Monkeybread plugin to enable the full screen widget.

Under, Cocoa, window contents will resize appropriately.

_________________
RS 2012r1.1x OSX 10.8.x Win7 XP; MBP17 w OWC SSD


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Aug 23, 2011 2:50 pm 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
i updated the example:
Image

it now shows how to achieve all:
  • Full Screen Button
  • MenuItem
  • Notifications

you can download the example project from here:
http://www.jr-tools.ch/ -> some bits and pieces for REAL Studio Developers

btw: thanks to Thom@real for his help!


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Tue Apr 24, 2012 6:21 am 
Offline

Joined: Tue Dec 27, 2011 8:54 am
Posts: 139
Location: India
Hello jraess,

Thank you for sharing this logic.

I was unable to download the project from your link. Can you please provide the right link for it ?


Thanks,
Prakash

_________________
PK Pothal
Software Developer in REAL STUDIO 2011r4.3, ASP.NET, VB.NET, C# AND SQL SERVER 2005/08
OS:WINDOWS N MAC


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Wed Apr 25, 2012 12:12 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
- go to http://www.jr-tools.ch/realbasic/lioncocoadeclares/
- click on the "Download" button
- fill in the field on the next page and click the "Download" button again

_________________
Real Studio 2012r1.1 | MacBook Pro i5, 10.6.8 | Windows 7


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Wed Apr 25, 2012 1:42 am 
Offline

Joined: Tue Dec 27, 2011 8:54 am
Posts: 139
Location: India
HI shaosean,

Thanks for sharing this link. But sorry to say i am unable to download the link. when i was trying to open the page it's showing some message like "Page is not responding"



Thanks,
Prakash

_________________
PK Pothal
Software Developer in REAL STUDIO 2011r4.3, ASP.NET, VB.NET, C# AND SQL SERVER 2005/08
OS:WINDOWS N MAC


Top
 Profile  
Reply with quote  
 Post subject: Re: Window and FullScreenbutton
PostPosted: Sun Nov 04, 2012 12:35 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
I'm not at my main computer, so I tried to use this code as I couldn't recall the correct declare. I also couldn't access the page in this link. So I tried this one and it didn't work, so I fixed it and are posting it for others to use.

declare sub FullScreenButton lib "Cocoa" selector "setCollectionBehavior:" ( WID As Integer, behaviour as integer )
FullScreenButton( self.handle, 128 )

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group