• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help on NSToolbar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help on NSToolbar


  • Subject: Re: Help on NSToolbar
  • From: Karim Morsy <email@hidden>
  • Date: Wed, 15 Mar 2006 02:40:26 +0100

thanks a lot for the help, mike!

In your NIB file, you already have an NSWindow. Now for each preference, you want to add an NSView to the NIB. If you want more help on this, just e-mail me off list.

ok, I've added 6 views to the nib file and connected the outlets of file's owner (prefs controller) with them. the nib file also contains a single prefs window with blank content and a toolbar that's created in awake from nib.


Now whenever the user clicks on an item in the toolbar, you need to do something like:

[MyWindow setContentView: nil];

do i really have to set the content view to nil ? because if I do that the content of the window turns black for like a tenth of a second.


[MyWindow setFrame: [newPreferenceView frame] display: YES animate: YES];

[MyWindow setContentView: newPreferenceView];

if I do this the window does not resize correctly. if I press an item multiple times the window gets smaller and smaller and the origin is in the wrong location.
i tried to resize and relocate like this:
int diff= [window frame].size.height - [prefsView frame].size.height;
newFrame.size.height += diff; // hoehenveränderung
newFrame.origin.y -= diff;
[window setFrame: newFrame display: YES animate: YES];
[window setContentView: prefsView];


however, this doesn't result exactly in the desired bahavior of the window.

any further help on this topic would be highly appreciated.

Thanks again,
Karim






On Mar 12, 2006, at 8:47 PM, Mike Abdullah wrote:

No problem.

In your NIB file, you already have an NSWindow. Now for each preference, you want to add an NSView to the NIB. If you want more help on this, just e-mail me off list.

Now whenever the user clicks on an item in the toolbar, you need to do something like:

[MyWindow setContentView: nil];

[MyWindow setFrame: [newPreferenceView frame] display: YES animate: YES];

[MyWindow setContentView: newPreferenceView];

Hope that helps.

Mike.

On 12 Mar 2006, at 19:06, Karim Morsy wrote:

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Help on NSToolbar
      • From: Mike Abdullah <email@hidden>
References: 
 >Help on NSToolbar (From: Karim Morsy <email@hidden>)
 >Re: Help on NSToolbar (From: Uli Kusterer <email@hidden>)
 >Re: Help on NSToolbar (From: Karim Morsy <email@hidden>)
 >Re: Help on NSToolbar (From: Mike Abdullah <email@hidden>)
 >Re: Help on NSToolbar (From: Karim Morsy <email@hidden>)
 >Re: Help on NSToolbar (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Progress TextField as like Safari
  • Next by Date: question about NSTimer objects
  • Previous by thread: Re: Help on NSToolbar
  • Next by thread: Re: Help on NSToolbar
  • Index(es):
    • Date
    • Thread