Re: Weird behavior when setting the size of a window used as a sheet
Re: Weird behavior when setting the size of a window used as a sheet
- Subject: Re: Weird behavior when setting the size of a window used as a sheet
- From: "Louis C. Sacha" <email@hidden>
- Date: Sun, 28 Dec 2003 14:07:00 -0800
Hello...
Maybe using the NSWindow method setContentSize: instead of setFrame:
display: animate: would work, since it sounds like the size you are
using is the size you want the content rect to be. Also, another way
is that you could use the NSWindow class method
frameRectForContentRect:styleMask: to get the correct window frame
for the desired content size, and then do setFrame: display: animate:.
I'm not sure why the sheet is displayed wrong the first time, and
then is correct later. Maybe someone else will know...
Louis
Hello!
I am writing a little application that makes use of a sheet very
much like iTunes' smart playlist edit dialog.
When the user selects an item in the main window and clicks edit, a
sheet comes down with a list of rules. The window needs to be
resized in order to fit all the rules, and here is my problem, the
very first time the sheet is display the size of the window (sheet)
is always off by a number of pixels (by the height of the title
bar). The second time I display the sheet the size is correct. I do
not understand what is going on!
The original window I display is prepared in IB and linked to my
controller, then it is modified before being display (I resize and
add cells to the 4 NSMatrix objects I have in the window). To resize
the window I compute the new height according to the number of rules
to display, and then I use NSWindow's (setFrame: display: animate:)
method.
Any idea is welcome, I am clueless, when I print the frame of the
window (the NSRect returned by NSWindow's frame method) when it's
displayed, it always indicates the same size and origin, the first
time and the second time but it does not display the same:
first time: http://www.pommsoft.com/homes/alex/sb-bad-sheet.jpg
after the first time: http://www.pommsoft.com/homes/alex/sb-good-sheet.jpg
Thanks a lot!
Alex.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.