Re: More on drawRect not getting called
Re: More on drawRect not getting called
- Subject: Re: More on drawRect not getting called
- From: Patrick William Walker <email@hidden>
- Date: Sun, 24 Jul 2011 15:59:09 -0300
I should make sure that I'm not making an assumption here, but is SequeraStepWindow a subclass of NSWindow?
It's been a while since I've worked with NSWindow, but the reason that it works once is because the awakeFromNib likely sends setNeedsDisplay to all it's associated views once it's loaded. From what I gathered you have custom NSViews in an NSWindow, and you would like to send a message to that view from your application controller to the NSWindow so that it would then redisplay changes in the views?
So from your class method (not sure why you've done that), you sent a message to your SequeraStepWindow, and that method sets a flag, then calls [self DrawNotes]. What is inside DrawNotes? Inside that there has to be a [myView setNeedsDisplay: YES];
On 2011-07-24, at 3:45 PM, Tom Jeffries wrote:
> Patrick,
>
> Everything works except that I can't get drawRect to be called a second time. I assume that means the IBOutlet is working. However, I think you're right that there's something about the interaction between the modules that is causing the problem.
>
> Thanks, Tom
>
> On Sun, Jul 24, 2011 at 11:38 AM, Patrick William Walker <email@hidden> wrote:
>
> On 2011-07-24, at 2:11 PM, Tom Jeffries wrote:
>
> > I appreciate the answers, so far everything that's been suggested is
> > something I've tried. Maybe if I put the code out somebody will see what
> > I'm doing wrong:
> >
> > This is the function that is called by the mouse click, it's in another
> > module:
> >
> > + (BOOL) Play
> >
> > {
> >
> > // init code
> >
> > [SequeraStepWindow DrawCurrentBarNotes];
> >
> > }
>
> It's hard to see what you've done. One thing to check is to make sure you have correctly added in (and connected) an IBOutlet inside your NIB/XIB file. You can send [myView setNeedsDisplay: YES] over and over and nothing will happen and is a common oversight. Is your custom view is configured property (and connected) under your SequeraStepWindow?
>
> I'm not sure why you've defined + (BOOL) Play as a class method but without seeing more of the actual code I cannot say much more. Is your custom view is configured property (and connected) under your SequeraStepWindow?
>
> ____________________________________
> Patrick William Walker
>
> email@hidden
> email@hidden
> email@hidden
>
>
>
>
____________________________________
Patrick William Walker
email@hidden
email@hidden
email@hidden
_______________________________________________
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