Re: question about frame and bounds (mostly FIXED with a little problem)
Re: question about frame and bounds (mostly FIXED with a little problem)
- Subject: Re: question about frame and bounds (mostly FIXED with a little problem)
- From: Ivan Kourtev <email@hidden>
- Date: Tue, 21 Oct 2003 00:39:23 -0400
So I took care of everything, thanks everyone for your help. One
little annoying problem remains, however.
In order to quickly calculate the required window resizing using IB I
put the groups of interface objects that need to show or go away
[please see (a), (b) below] in an invisible box. Notably, as the
program runs, the progress indicator and the values of a bunch of text
fields (both with the invisible box) must be constantly updated. In
order for this to happen, however, I needed to do two things:
1 - send a [hiddenDisclosableBox displayIfNeeded] message to the NSBox
after every value update or progress bar update (I am not familiar with
the drawing system in detail but can justify the necessity for this).
2 - resize the main window (in order to expose the
hiddenDisclosableBox) with a [main_window setFrame:w_frame display:YES
animate:NO]; message.
Now this is puzzling. If I resize with animate:YES, then the updates
to the progress bar do NOT propagate until the entire process bar
fill-up is finished, which is when the progress bar is updated to full
state in one single shot.
Is that a known bug? Am I missing something?
I wanted to keep the nice animation window resizing effect so I tried
sending a setFrame with NO animation in succession after after the
animate:YES message -- thinking this would 'undo' the effect of
animate:YES, like this:
[main_window setFrame:w_frame display:YES animate:YES];
[main_window setFrame:w_frame display:YES animate:NO];
but this didn't fix it. Any clues as to this behavior? Why does
[main_window setFrame:w_frame display:YES animate:YES]; mess up the
subsequent animation of the progress bar?
Thanks for any help,
-- ivan
On Sunday, Oct 19, 2003, at 17:43 US/Eastern, j o a r wrote:
At any rate, what I am trying to do is dynamically change the size
and appearance of the main application window based on the program
state. For example, when the user selects a certain action, a file
must be read in. At this point, I would like to:
(a) resize the window a little larger (already know how to do that
with setFrame:display:animate),
(b) show a progress bar and a bunch of NSTextField's in the new
window area
(c) read the file, indicating progress with progress bar, fill out
NSTextFields
(d) when user is done, resize window back to normal (get rid of
progress bar, NSTextFields, etc.)
So, according to an example I have seen, I create the entire
interface in PB. In awakeFromNib I want to hide this portion of the
main window interface which is not needed yet. So I wanted to get
the dimensions and positions of interface objects (in the portion to
be hidden) in order to calculate how much does the main window need
to shrink (and hide the objects that are not needed for display).
You're definitively on the right track. If I were you I would write a
subclass of NSBox called "CollapsableBox" that looked something like
this:
_______________________________________________
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.