Re: redraw problem

2010-07-29 Thread Tony Romano
That was it Michael.  Thank you.
On Jul 29, 2010, at 9:19 PM, Michael Ash wrote:

> On Thu, Jul 29, 2010 at 4:26 PM, Tony Romano  wrote:
>> I have a document based Cocoa App and I am trying to understand what is 
>> causing these residual lines to happen.  Attached is a link to what I am 
>> referring to.  The solid blue lines are the new lines after they have moved. 
>>  The greyish lines are what's being left behind. 
>> http://dl.dropbox.com/u/5614061/Screen shot 2010-07-29 at 1.08.36 PM.png.  
>> Notice they look like borders from the old lines.
> 
> It looks like you're changing the filled region of an
> irregularly-shaped window. This is perfectly fine, but note that
> NSWindow will *not* automatically update the window's shadow when you
> do so. Your artifacts look like leftover shadow to me, so I'd guess
> that this is what's happening.
> 
> If I'm right, you can simply do [window invalidateShadow] any time you
> change the filled region to force the window to regenerate the shadow.
> 
> Mike
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/tonyrom%40hotmail.com
> 
> This email sent to tony...@hotmail.com
> 

-Tony

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: redraw problem

2010-07-29 Thread Michael Ash
On Thu, Jul 29, 2010 at 4:26 PM, Tony Romano  wrote:
> I have a document based Cocoa App and I am trying to understand what is 
> causing these residual lines to happen.  Attached is a link to what I am 
> referring to.  The solid blue lines are the new lines after they have moved.  
> The greyish lines are what's being left behind. 
> http://dl.dropbox.com/u/5614061/Screen shot 2010-07-29 at 1.08.36 PM.png.  
> Notice they look like borders from the old lines.

It looks like you're changing the filled region of an
irregularly-shaped window. This is perfectly fine, but note that
NSWindow will *not* automatically update the window's shadow when you
do so. Your artifacts look like leftover shadow to me, so I'd guess
that this is what's happening.

If I'm right, you can simply do [window invalidateShadow] any time you
change the filled region to force the window to regenerate the shadow.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: redraw problem

2010-07-29 Thread Markus Spoettl
On Jul 29, 2010, at 7:30 PM, Tony Romano wrote:
> Moved the code to here. http://dl.dropbox.com/u/5614061/snippet.txt
> 
> The drawRect redraws the entire view.  So, in a sense, I am drawing over 
> everything in that view.  What's interesting, is the lines are left from the 
> first time I adjust the blue lines, any additional adjustments to the blue 
> line don't leave any residuals. 
> 
> Changing the setLineWidth prior to any drawing doesn't have any affect on the 
> problem.  Didn't think it would as I understand the "attributes" are not 
> applied until the stroke happens.  I'll look into Quartz debug.


Not sure if that causes your problem but you should use -drawRect: to draw the 
view, nothing else. The first half sets visual properties of the window and 
another view. There are much better places to do that.

Secondly - and not sure if that causes the issue either - but it's good 
practice that whenever you change properties of the current graphics context, 
you should first store its state and restore it when you're done. That way 
things that use the same context after you did find it in a state they expect 
it in. See 


Regards
Markus
--
__
Markus Spoettl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: redraw problem

2010-07-29 Thread Tony Romano
Moved the code to here. http://dl.dropbox.com/u/5614061/snippet.txt

The drawRect redraws the entire view.  So, in a sense, I am drawing over 
everything in that view.  What's interesting, is the lines are left from the 
first time I adjust the blue lines, any additional adjustments to the blue line 
don't leave any residuals. 

Changing the setLineWidth prior to any drawing doesn't have any affect on the 
problem.  Didn't think it would as I understand the "attributes" are not 
applied until the stroke happens.  I'll look into Quartz debug.

On Jul 29, 2010, at 3:54 PM, Tony Romano wrote:

> The drawRect redraws the entire view.  So, in a sense, I am drawing over 
> everything in that view.  What's interesting, is the lines are left from the 
> first time I adjust the blue lines, any additional adjustments to the blue 
> line don't leave any residuals. 
> 
> Changing the setLineWidth prior to any drawing doesn't have any affect on the 
> problem.  Didn't think it would as I understand the "attributes" are not 
> applied until the stroke happens.  I'll look into Quartz debug.
> 
> -Tony
> 
> On Jul 29, 2010, at 2:48 PM, Michael Dautermann wrote:
> 
>> Here's something else I noticed in your code.
>> 
>> You set the stroke width near the bottom of the drawGrid function, which 
>> happens AFTER you do the first draw of the lines.  Try moving the 
>> setLineWidth method call up to the top of your drawGrid and see if that 
>> makes any difference.
>> 
>> On Jul 29, 2010, at 2:01 PM, Tony Romano wrote:
>> 
>>> The drawRect redraws the entire view.  So, in a sense, I am drawing over 
>>> everything in that view.  What's interesting, is the lines are left from 
>>> the first time I adjust the blue lines, any additional adjustments to the 
>>> blue line don't leave any residuals. 
>>> 
>>> -Tony
 

-Tony

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: redraw problem

2010-07-29 Thread Gideon King
Yeah, hard to be of help without the source

...and you could use Quartz Debug to see what is actually being redrawn. 
(/Developer/Applications/Graphics Tools)


On 30/07/2010, at 6:37 AM, Michael Dautermann wrote:

> On Jul 29, 2010, at 1:26 PM, Tony Romano wrote:
> 
>> I have a document based Cocoa App and I am trying to understand what is 
>> causing these residual lines to happen.  Attached is a link to what I am 
>> referring to.  The solid blue lines are the new lines after they have moved. 
>>  The greyish lines are what's being left behind. 
>> http://dl.dropbox.com/u/5614061/Screen shot 2010-07-29 at 1.08.36 PM.png.  
>> Notice they look like borders from the old lines.
> 
> A slightly better encoded version of your URL is 
> 
> 
> How are you moving your blue lines?  Could you try drawing clear color lines 
> over the original position of the blue lines (i.e. explicitly erasing the 
> artifacts) before drawing the blue lines in their new position?  
> 
> Could you show a bit more code that demonstrates how your drawing is being 
> done?  
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/gideon%40novamind.com
> 
> This email sent to gid...@novamind.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: redraw problem

2010-07-29 Thread Michael Dautermann
On Jul 29, 2010, at 1:26 PM, Tony Romano wrote:

> I have a document based Cocoa App and I am trying to understand what is 
> causing these residual lines to happen.  Attached is a link to what I am 
> referring to.  The solid blue lines are the new lines after they have moved.  
> The greyish lines are what's being left behind. 
> http://dl.dropbox.com/u/5614061/Screen shot 2010-07-29 at 1.08.36 PM.png.  
> Notice they look like borders from the old lines.

A slightly better encoded version of your URL is 


How are you moving your blue lines?  Could you try drawing clear color lines 
over the original position of the blue lines (i.e. explicitly erasing the 
artifacts) before drawing the blue lines in their new position?  

Could you show a bit more code that demonstrates how your drawing is being 
done?  



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

redraw problem

2010-07-29 Thread Tony Romano
I have a document based Cocoa App and I am trying to understand what is causing 
these residual lines to happen.  Attached is a link to what I am referring to.  
The solid blue lines are the new lines after they have moved.  The greyish 
lines are what's being left behind. http://dl.dropbox.com/u/5614061/Screen shot 
2010-07-29 at 1.08.36 PM.png.  Notice they look like borders from the old lines.

The Class structure is(as seen by FScript):

NSThemeFrame
NSView (ContentView)
MyView


I am setting the ContentView's window to setBackgroundColor: clearColor and 
setOpaque:NO.  And in the .png, the opacity is 0.0.  If I set the opacity to 
1.0, the greyish lines are hidden but adjusting to 0.0 will cause them to be 
revealed(the same one. i.e. I only change the opacity and not move the lines).  
I am getting the drawRect calls due to me calling setNeedsDisplay:YES during 
observing the keypath changes to grid values.


Not sure what other information is needed.  Please let me know, 

Thanks in advance,
-Tony

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTableView with Custom Views as Cells Redraw Problem

2008-11-03 Thread Carmen Cerino Jr.
I was messing around in IB by turning off "draw background", which
also turns off copy on scroll, on the NSScrollView that contains the
table. I am not exactly sure what this means yet, but I am in the
middle of investigating this new discovery. It may be linked to your
suggestion.

Thanks again for your help!

On Mon, Nov 3, 2008 at 4:05 PM, Corbin Dunn <[EMAIL PROTECTED]> wrote:
>
> On Nov 3, 2008, at 12:35 PM, Carmen Cerino Jr. wrote:
>
>> Basically I have an array of views for every item in my data source,
>> and my table uses a custom cell for its data cell. This cell has a
>> weak reference to one of the views in the array, and it is set every
>> time during the tableWillDisplayCell delegate method of the TableView.
>> When the cell goes to draw itself it will set its view's frame to
>> match the cell's frame, and it checks to see if its view's superview
>> matches the control view of that cell. If they do not match the view
>> is added to the control view. The issue I am having is when I go to
>> resize the window, it appears the views are drawing over themselves.
>> Here a link to a screen capture of the issue in action:
>> http://screencast.com/t/Fbc2WrZsG
>>
>
> This is probably live-resize conflicting with it. Override -drawRect: in an
> NSTableView subclass, and call super (that's it). That help?
>
> .corbin
>
>
>> Any help would be greatly appreciated! Please let me know if you would
>> like to see my code. I am following this tutorial on pulling of this
>> custom cell effect: http://www.joar.com/code/body.html
>
>



-- 
Carmen C. Cerino
   University of Akron ACM Chapter President
   University of Akron Aux. Services Student Assistant
   Cell: 440.263.5057
   AIM: UAcodeweaver
   [ I <3 MACs ]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSTableView with Custom Views as Cells Redraw Problem

2008-11-03 Thread Corbin Dunn


On Nov 3, 2008, at 12:35 PM, Carmen Cerino Jr. wrote:


Basically I have an array of views for every item in my data source,
and my table uses a custom cell for its data cell. This cell has a
weak reference to one of the views in the array, and it is set every
time during the tableWillDisplayCell delegate method of the TableView.
When the cell goes to draw itself it will set its view's frame to
match the cell's frame, and it checks to see if its view's superview
matches the control view of that cell. If they do not match the view
is added to the control view. The issue I am having is when I go to
resize the window, it appears the views are drawing over themselves.
Here a link to a screen capture of the issue in action:
http://screencast.com/t/Fbc2WrZsG



This is probably live-resize conflicting with it. Override -drawRect:  
in an NSTableView subclass, and call super (that's it). That help?


.corbin



Any help would be greatly appreciated! Please let me know if you would
like to see my code. I am following this tutorial on pulling of this
custom cell effect: http://www.joar.com/code/body.html


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


NSTableView with Custom Views as Cells Redraw Problem

2008-11-03 Thread Carmen Cerino Jr.
Basically I have an array of views for every item in my data source,
and my table uses a custom cell for its data cell. This cell has a
weak reference to one of the views in the array, and it is set every
time during the tableWillDisplayCell delegate method of the TableView.
When the cell goes to draw itself it will set its view's frame to
match the cell's frame, and it checks to see if its view's superview
matches the control view of that cell. If they do not match the view
is added to the control view. The issue I am having is when I go to
resize the window, it appears the views are drawing over themselves.
Here a link to a screen capture of the issue in action:
http://screencast.com/t/Fbc2WrZsG

Any help would be greatly appreciated! Please let me know if you would
like to see my code. I am following this tutorial on pulling of this
custom cell effect: http://www.joar.com/code/body.html

Cheers,
Carmen
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]