| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Hi List, In my app Racing Math I have a custom chooser for printing. This appears to drop down from the menu bar. I implement this using a small toolbar class window as the parent which is also part of my main window group. BTW, I do know it isn't standard UI and did it after much consideration. The problem is that when this sheet is dismissed and pulled back up, the entire window group slides up ~20 or so pixels as well. This happens every time the sheet is hid & build up so that after time the main window group has slid all the way up the screen. This worked fine on Tiger, Panther, and Jaguar. It only behaves like this on Leopard. I already filed a bug, it's radar://5568112 I broke down a code sample which shows the bad behavior, it's included below. When I change the the sheet's parent window class to kPlainWindowClass I get the behavior I want back, but not the appearance. So then I'd also have to implement a draw handler. What I would like to know is if there is something better I could do. In other words, if it's something other than the bad window class/group behavior I would like to fix it. In the following code you select Quit from the app menu to hide the sheet & again to actually quit the test app. All error checking has been removed. Any comments would be appreciated. David **CODE** // // main.c // SheetWindow // // Created by David Alger on 10/30/07. // Copyright Family Friendly Software, LLC 2007. All rights reserved. // #include <Carbon/Carbon.h> /****************************************************************************/ int main(int argc, char* argv[]) { IBNibRef nibRef; WindowGroupRef group; WindowRef backdrop; WindowRef parent; WindowRef sheet; Rect bounds = (**GetMainDevice()).gdRect; Rect pBounds; Rect sBounds; //Create Backdrop CreateWindowGroup(kWindowGroupAttrLayerTogether | kWindowGroupAttrMoveTogether | kWindowGroupAttrSharedActivation | kWindowGroupAttrHideOnCollapse, &group); SetWindowGroupParent(group , GetWindowGroupOfClass(kPlainWindowClass)); CreateNewWindow(kPlainWindowClass, kWindowNoAttributes, &bounds, &backdrop); SetWindowGroup(backdrop, group); ShowWindow(backdrop); //Create sheet parent pBounds.top = 0; pBounds.left = (bounds.right - bounds.left) / 2 - 512; pBounds.bottom = 1; pBounds.right = bounds.right - bounds.left - ((bounds.right - bounds.left) / 2 - 512); CreateNewWindow(kToolbarWindowClass , kWindowNoShadowAttribute , &pBounds , &parent); SetWindowGroup(parent, group); ShowWindow(parent); //Create sheet sBounds.top = 0; sBounds.left = (bounds.right - bounds.left) / 2 - 250; sBounds.bottom = 300; sBounds.right = bounds.right - bounds.left - ((bounds.right - bounds.left) / 2 - 250); CreateNewWindow(kSheetAlertWindowClass, kWindowNoAttributes, &sBounds, &sheet); ShowSheetWindow(sheet, parent); RunApplicationEventLoop(); HideSheetWindow(sheet); RunApplicationEventLoop(); return 0; } **END CODE** ******************** Ron Paul for President 2008 |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.