Re: Transparent window and opaque objects
Re: Transparent window and opaque objects
- Subject: Re: Transparent window and opaque objects
- From: Lorenzo <email@hidden>
- Date: Thu, 25 Oct 2007 17:16:55 +0200
Hi Ricky,
On the docs I have found the following:
===============================
- (NSArray *)subviews
Discussion
The order of the subviews may be considered as being back-to-front, but this
does not imply invalidation and drawing behavior. The order is based on the
order of the receiver's subviews as specified in the nib file from which
they were unarchived or the programmatic interface for modifying the
receiver's subview list. This ordering is also the reverse of the order in
which hit-testing is done.
===============================
Something is not so clear there. Does the OS draw the objects from the index
0 to the last index? If so, I can quite assume that the object 1 will be
drawn over the object 0. Actually it seems to work right this way.
Also, I just need to show a half-a-transparent pop-up under the mouse
containing some text fields. So I setIntValue of the NSTextFields then I
call [textField setNeedsDisplay:YES]; It works.
May you please explain what I should be aware?
Best Regards
--
Lorenzo
email: email@hidden
> From: Ricky Sharp <email@hidden>
> Date: Wed, 24 Oct 2007 18:59:27 -0500
> To: Lorenzo <email@hidden>
> Cc: Shawn Erickson <email@hidden>, email@hidden
> Subject: Re: Transparent window and opaque objects
>
>
> On Oct 24, 2007, at 6:44 PM, Lorenzo wrote:
>
>> Thank you Shawn. Your suggestions made me think about the trick I
>> used to
>> solve an overlapping problem. I solved it reordering the subviews.
>>
>> I iterate through the subviews looking for the NSImageView obj and
>> I store
>> its index. Then I delete all the subviews. Now I
>> addSubview:NSImageView (as
>> first) then I add all the other objects. So the NSView gets drawn
>> as first.
>> It works like a charm. Thank you so much!
>
> There is no 'trick' to solving overlapping view problems.
> Overlapping views are not supported at all. If you continue to go
> that route, don't be surprised if some hardware/OS/etc combo will
> cause problems for your app.
>
> Valid alternatives have already been mentioned in earlier replies
>
> ___________________________________________________________
> Ricky A. Sharp mailto:email@hidden
> Instant Interactive(tm) http://www.instantinteractive.com
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden