how to call fathers setNeedsDisplay from child.
hy everybody. i am from slovakia, so excuse my english 
i have two NSOpenGLView in two class. Pirates.h is father and Objects.h is child. i need to refresh NSOpenGLView in Pirates.h from Objects.h. in child when i call [super setNeedsDisplay:YES]; it refresh a child's View not a father's View. in Pirates.m is this function
- (void)refresh
{
NSLog(@"Refreshing");
[self setNeedsDisplay:YES];
}
when i call it from Objects.m like [super refresh]; it refresh child's View.
any ideas how can i refresh fathers NSOpenGLView?

i have two NSOpenGLView in two class. Pirates.h is father and Objects.h is child. i need to refresh NSOpenGLView in Pirates.h from Objects.h. in child when i call [super setNeedsDisplay:YES]; it refresh a child's View not a father's View. in Pirates.m is this function
- (void)refresh
{
NSLog(@"Refreshing");
[self setNeedsDisplay:YES];
}
when i call it from Objects.m like [super refresh]; it refresh child's View.
any ideas how can i refresh fathers NSOpenGLView?
Code:
[[child superview] setNeedsDisplay:YES];Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
did you meen that i will call this in Objects.m?
[[self superview] setNeedsDisplay:YES];
becouse it not work
[[self superview] setNeedsDisplay:YES];
becouse it not work
Maybe it would be useful to take a look at example code?
http://fax.twilightcoders.net/files/Coco...cation.zip
(its an xcode template btw so you'd need to put it in "/Library/Application Support/Apple/Developer Tools/Project Templates/Application/" to actually use it)
http://fax.twilightcoders.net/files/Coco...cation.zip
(its an xcode template btw so you'd need to put it in "/Library/Application Support/Apple/Developer Tools/Project Templates/Application/" to actually use it)
Sir, e^iπ + 1 = 0, hence God exists; reply!
You referred to the superview as "pirate" and the child view as "child", so I was following your terminology. If you have one view "inside" (a subview) of another view, then you can access the parent view by calling -superview on the child view.
Virus Out
Big Bang Board Games
Adventures on Pirate Isle
Solace - Strategy, War, and Glory!
The Belt
in InterfaceBuilder i create an Outlet type Pirates named pirat. and i create connetion between Class Pirates and object pirat. in Pirates.m in function refresh i call "[pirat setNeedsDisplay:YES];" and it work wery well. thanks guys for helping
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| cocos2d: memory question adding child to scenes | sefiroths | 8 | 8,629 |
Apr 19, 2011 08:06 AM Last Post: OneSadCookie |
|
| Child Units | grazhoper | 1 | 2,333 |
Sep 2, 2009 12:25 AM Last Post: AnotherJake |
|
| drawRect: is not executed after setNeedsDisplay:YES | Moridin | 7 | 6,624 |
Oct 19, 2005 12:42 AM Last Post: Moridin |
|
| setNeedsDisplay | Coin | 9 | 6,102 |
Jan 7, 2005 01:49 PM Last Post: Coin |
|

