Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mac > BOOK: Beginning Mac OS X Programming
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Mac OS X Programming
This is the forum to discuss the Wrox book Beginning Mac OS X Programming by Michael Trent, Drew McCormack; ISBN: 9780764573996
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Mac OS X Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2010, 01:03 AM
Registered User
Join Date: Jul 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Window Closes when Resizing in Carbon Simulator

I'm trying to follow the "Building a Resizable Carbon Window" section on page 120 of the 2005 "Tiger" edition of the text. If I create an empty Carbon project and add a window object from the Palette/Library (making sure that the Close, Minimize, Resize and Zoom buttons are all checked), run the Carbon Simulator and then attempt to resize the window by grabbing the resize control, the window vanishes.

However if I create a Carbon project that already has the window object included (i.e instead of an empty project where I add the window to after first creating) I have no problem resizing the window in that case.

I try to visually match the selections in the inspector to see what is different between the settings of these two cases but I don't readily notice any differences in these two sets of parameters that are displayed. Thus I a curious as whether there are more settings that just aren't displayed on the Inspector and where is the best most compete documentation available from Apple on the subject.

I am using IB 3.2.3

  #2 (permalink)  
Old July 17th, 2010, 11:16 PM
Registered User
Join Date: Jul 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

In case anyone else comes across this problem or finds this otherwise useful, I think I was able to (sort of) figure out the discrepancy examining the .nib file.

Both files have two keys defined: maxSize (under com.apple.ibtool.document.localizable-all) and gMaxSize (under com.apple.ibtool.document.objects). In the working file both of these have a string setting of {480, 270}. In the nonworking file they had a string setting of {0, 0}. Apparently the default configuration of the working file was setting the maximum size of the window equal to zero. In Inspector the Window Template Size tab had the "Maximum Size" box checked but a "0" for both Width and Height. I clicked the box once to clear the check. Ran the Carbon Simulator again and the window resized properly without disappearing. When I rechecked the box, Inspector automatically filled in the Width and Height parameters with valid values of 480 and 270. I ran the Carbon Simulator again and it resized properly in accordance with the new maximum size constraint.

I don't fully understand the XML code in the .nib file but apparently the default setting for the maximum size of the window was being set to zero. The incorrect code appeared in the .nib file as follows (with non relevant lines deleted):


        <string>{0, 0}</string>


        <string>{0, 0}</string>

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
delete session when tab window closes bikermike Beginning PHP 2 February 21st, 2009 05:02 PM
Resizing and moving new window through opener Gajender BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 2 July 22nd, 2008 08:40 AM
Resizing Main Access Window McDiddy Access VBA 0 January 5th, 2007 04:33 AM
Detect when window closes, not unload Snib Javascript How-To 11 October 24th, 2006 01:14 AM
Is there an Event for resizing the main XL window? labdad Excel VBA 2 January 6th, 2006 07:23 PM

All times are GMT -4. The time now is 02:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.