ikimagebrowserview + bindings

2008-07-20 Thread Duncan Campbell
Does anyone know of any example code that demonstrate  
IKImageBrowserView working with bindings?


Cheers in advance,

Duncan.


___

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]


IKImageBrowserView crash

2009-04-08 Thread Ashley Clark
I'm using an IKImageBrowserView to show sets of PDF documents in my  
program and am occasionally seeing crashes during IKImageWrapper  
finalize calls. The crash log shows absolutely none of my code at all.  
This typically happens when someone is adding a document to the image  
browser's datasource.


Has anyone seen these types of crashes and have any idea if there's a  
way for me to resolve it?


Thanks,
Ashley


Here's a few relevant bits from the crash log:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x1d05e0b0
Crashed Thread:  0

Application Specific Information:
objc[6119]: garbage collection is ON
IKImageWrapper

Thread 0 Crashed:
0   GLEngine0x1e4daf17  
glDeleteTextures_Exec + 23

1   libGL.dylib 0x941cc476 glDeleteTextures + 38
2   com.apple.imageKit  0x93aa4684  
_deleteTextureForIKGLImageInfo + 105

3   com.apple.imageKit  0x93aa46da _removeOwners + 53
4   com.apple.CoreFoundation0x942bcb29  
CFDictionaryApplyFunction + 169
5   com.apple.imageKit  0x93aa528a - 
[IKGLSharedContextRegistry removeOwner:] + 141

6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29
...

Thread 1:
0   libSystem.B.dylib   0x956be3ae __semwait_signal + 10
1   libSystem.B.dylib   0x956e8d0d pthread_cond_wait 
$UNIX2003 + 73
2   com.apple.Foundation0x902532d2 -[NSCondition wait]  
+ 210
3   com.apple.Foundation0x9020bc6a - 
[NSObject(NSThreadPerformAdditions)  
performSelector:onThread:withObject:waitUntilDone:modes:] + 938
4   com.apple.Foundation0x9028c76c - 
[NSObject(NSThreadPerformAdditions)  
performSelectorOnMainThread:withObject:waitUntilDone:modes:] + 92
5   com.apple.imageKit  0x939c4bcd -[_IKIRLMainProxy  
forwardInvocation:] + 121
6   com.apple.CoreFoundation0x9436b96a ___forwarding___ +  
986
7   com.apple.CoreFoundation0x9436b9d2  
_CF_forwarding_prep_0 + 50
8   com.apple.imageKit  0x939b6e7e -[IKImageWrapper  
finalize] + 81
9   libobjc.A.dylib 0x94ab46b6 finalizeOneObject +  
56

...

Thread 4:
0   com.apple.AppKit0x905fe758 _NSReadImage + 4633
1   com.apple.AppKit0x905fd3de -[NSBitmapImageRep  
initWithFocusedViewRect:] + 187
2   com.apple.imageKit  0x939bd4ec  
IKCGImageFromNSImage + 550
3   com.apple.imageKit  0x939bca32 -[IKImageWrapper  
_tryToCreateCGImageRepFromNonCGFile:] + 125
4   com.apple.imageKit  0x939bc4d1 -[IKImageWrapper  
_thumbnailWithSize:antialiased:qualityRequested:qualityProduced:] + 264
5   com.apple.imageKit  0x939c2bb1 -[IKMipmapItem  
setAsMipmapOfImage:withSize:antialiased:quality:] + 111
6   com.apple.imageKit  0x939c2e94 -[IKMipmapItem  
setAsMipmapOfImage:aspectRatio:antialiased:quality:] + 355
7   com.apple.imageKit  0x939c05e1 -[IKMipmapImage  
validateMipmap:withModel:withQuality:] + 350
8   com.apple.imageKit  0x939c0776 -[IKMipmapImage  
validateMipmap:withQuality:] + 228
9   com.apple.imageKit  0x939e2b1a - 
[IKImageBrowserView(ImageBrowserImport) startScrollPrefetchTask] + 1040
10  com.apple.imageKit  0x93a92167 -[IKTaskManager  
taskLoop] + 2037

...

___

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


Customizing IKImageBrowserView

2009-04-17 Thread Srinivasa Prabhu

Hi,

We are developing a project in which we have a view showing matrix of  
images ( a common theme). As an enhancement,
we would like to support some animations while performing operations  
like adding, removing, reloading images to this view . As an example  
we could consider

Apple's  Preview 4.0.

Though we might have to change our existing implementation to some  
extent, we think switching to IKImageBrowserView is a good option.  
With this

change we can support most of the animations mentioned above.

However there are a few things where we think we might run into trouble.

1. We need to customize the selection of the item as in iTunes.

2. We might in the future customize the individual thumbnails.

3.  Editing title of the thumbnail.

Considering the above 3 requirements we found that IKImageBrowserView  
is not so flexible. We think
it is not  possible for us to customize individual images. We tried by  
overriding drawrect : of   IKImageBrowserView. However, we discovered  
that

if drawrect : is overridden in IKImageBrowserView, it displays nothing.

So our question boils down to the following:

1. Are we right in our approach of using IKImageBrowserView?
2.  If so, how could be achieve the above requirements by leveraging  
IKImageBrowserView?
   2a. Please let us know if there is any workaround for customizing  
individual images in IKImageBrowserView.
  2b. Is there a method to edit text displayed in
IKImageBrowserView by clicking on the text area.


Thank you.

Regards,
Srinivas.
---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.
___

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


IKImageBrowserView is bonkers

2008-06-06 Thread Randall Meadows
So I have an IKImageBrowserView in my window.  It's supplied by a  
IKImageBrowserViewDataSource object.


The images are captured from a digital camera, which is oriented in a  
portrait fashion.  Once downloaded from the camera, the images are  
rotated (using jpegtran) to a "normal" orientation, the EXIF is edited  
to match (using exiftool, since jpegtran leaves the flag alone when it  
rotates it), and finally an icon is added to the file using this code:


NSImage *preview = [[NSImage alloc] initWithContentsOfFile:filePath]];
[[NSWorkspace sharedWorkspace] setIcon:preview forFile:filePath  
options:0];


So the image is created from the rotated, EXIF-fixed image file.  The  
image file displays correctly in Preview, Safari, QuickLook, and its  
Finder preview icon is correct also.


Why come then does the IKImageBrowserView always initially show the  
image rotated 90° CW, and then a little while later refresh it to be  
correct?  Sorry, not even INITIALLY, its whenever the view updates  
from the data source.  The data source simply returns the full path to  
the image in the filesystem to display when requested.  I've already  
determined that the image file itself is correct in all ways.


You can see a short (~30 second) QT movie of this strange behavior in  
action at <http://idisk.mac.com/callipygiani/Public/RotationWTF.mov>.   
The movie shows several images being captured and added to the view, a  
couple deleted from the view, and then another captured and added.


Any tips or suggestions as to what is going on would be GREATLY  
appreciated.  I really don't want to have to write my own image  
browser view...



Thanks!
randy___

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]


IKImageBrowserView aspect ratio

2008-07-13 Thread Chilton Webb
Hi,

I have a lot of 4:3 ratio images I'd like to line up with IKImageBrowserView. 
Unfortunately, the default configuration forces all of the IKImageBrowserView 
cells to be square. Is there a way to set the aspect ratio of the 
IKImageBrowserView cells?

Thank you,
-Chilton Webb
___

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]


IKImageBrowserView Dragging outside

2009-10-23 Thread TFS - Tobias Jordan

Hi all,

I've been wondering on how to implement dragging out of the view in  
the IKImageBrowserView. I am pretty sure this is where I have to  
start: -imageBrowser:writeItemsAtIndexes:toPasteboard: but I don't  
have a clue what to do next. It's not a real File Promise, I just need  
the folder (in most cases the Desktop) dragged to and the indexes that  
have been dragged.
The class seems to be quite different to the NSTableView in which I am  
using '-tableView:writeRowsWithIndexes:toPasteboard' and '- 
tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes 
:'.


What's the method I am missing?

Best regards & thanks.
Tobias Jordan.
___

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


IKImageBrowserView and reordering

2009-11-05 Thread Harry Vangberg
Hello

I am (with much success) using IKImageBrowserView. I have enabled
reordering and implemented -imageBrowser:moveItemsAtIndexes:toIndex: in
the image browsers delegate, which works very, very fine, until I put
the contentView of the window in fullscreen. Everything else works fine,
but I cant initiate a drag at all. Developing against 10.6 SDK.

Harry
___

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


IKImageBrowserView selection notification

2009-11-24 Thread Charles Burnstagger
How do I detect when the selection changes in a IKImageBrowserView? I didn't 
see anything in the docs on that.

Thanks,

Chuck



  
___

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


IKImageBrowserView - multiline labels

2009-02-07 Thread Eric Gorr
I was wondering if anyone has used this control. I have a situation  
which it may be perfect for, but the three things I am not certain it  
is capable of is:


1. supporting in-place editing of the labels
2. supporting multi-line labels
3. using a smaller font in the labels

I have tried to figure out how to get it to do these things, but have  
been unable.


If it cannot, I intend to file bugs, but wanted to first verify these  
things weren't possible.


Thank you.

___

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: IKImageBrowserView crash

2009-04-09 Thread jonat...@mugginsoft.com

I don't have a solution just a couple of suggestions.

As GC is enabled you can try temporarily disabling the collector.
Bracket the crashing code segment with:

[[NSGarbageCollector defaultCollector] disable];

// crashing code

[[NSGarbageCollector defaultCollector] enable];

Otherwise I can only suggest extracting the essentials of your code  
into a test project.

If the problem can be replicated there then repost with more detail

On 8 Apr 2009, at 20:36, Ashley Clark wrote:

I'm using an IKImageBrowserView to show sets of PDF documents in my  
program and am occasionally seeing crashes during IKImageWrapper  
finalize calls. The crash log shows absolutely none of my code at  
all. This typically happens when someone is adding a document to the  
image browser's datasource.


Has anyone seen these types of crashes and have any idea if there's  
a way for me to resolve it?


Thanks,
Ashley


Here's a few relevant bits from the crash log:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x1d05e0b0
Crashed Thread:  0

Application Specific Information:
objc[6119]: garbage collection is ON
IKImageWrapper

Thread 0 Crashed:
0   GLEngine0x1e4daf17  
glDeleteTextures_Exec + 23
1   libGL.dylib 0x941cc476 glDeleteTextures  
+ 38
2   com.apple.imageKit  0x93aa4684  
_deleteTextureForIKGLImageInfo + 105

3   com.apple.imageKit  0x93aa46da _removeOwners + 53
4   com.apple.CoreFoundation0x942bcb29  
CFDictionaryApplyFunction + 169
5   com.apple.imageKit  0x93aa528a - 
[IKGLSharedContextRegistry removeOwner:] + 141

6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29
...

Thread 1:
0   libSystem.B.dylib   0x956be3ae __semwait_signal  
+ 10
1   libSystem.B.dylib   0x956e8d0d pthread_cond_wait 
$UNIX2003 + 73
2   com.apple.Foundation0x902532d2 -[NSCondition  
wait] + 210
3   com.apple.Foundation0x9020bc6a - 
[NSObject(NSThreadPerformAdditions)  
performSelector:onThread:withObject:waitUntilDone:modes:] + 938
4   com.apple.Foundation0x9028c76c - 
[NSObject(NSThreadPerformAdditions)  
performSelectorOnMainThread:withObject:waitUntilDone:modes:] + 92
5   com.apple.imageKit  0x939c4bcd -[_IKIRLMainProxy  
forwardInvocation:] + 121
6   com.apple.CoreFoundation0x9436b96a ___forwarding___  
+ 986
7   com.apple.CoreFoundation0x9436b9d2  
_CF_forwarding_prep_0 + 50
8   com.apple.imageKit  0x939b6e7e -[IKImageWrapper  
finalize] + 81
9   libobjc.A.dylib 0x94ab46b6 finalizeOneObject  
+ 56

...

Thread 4:
0   com.apple.AppKit0x905fe758 _NSReadImage + 4633
1   com.apple.AppKit0x905fd3de - 
[NSBitmapImageRep initWithFocusedViewRect:] + 187
2   com.apple.imageKit  0x939bd4ec  
IKCGImageFromNSImage + 550
3   com.apple.imageKit  0x939bca32 -[IKImageWrapper  
_tryToCreateCGImageRepFromNonCGFile:] + 125
4   com.apple.imageKit  0x939bc4d1 -[IKImageWrapper  
_thumbnailWithSize:antialiased:qualityRequested:qualityProduced:] +  
264
5   com.apple.imageKit  0x939c2bb1 -[IKMipmapItem  
setAsMipmapOfImage:withSize:antialiased:quality:] + 111
6   com.apple.imageKit  0x939c2e94 -[IKMipmapItem  
setAsMipmapOfImage:aspectRatio:antialiased:quality:] + 355
7   com.apple.imageKit  0x939c05e1 -[IKMipmapImage  
validateMipmap:withModel:withQuality:] + 350
8   com.apple.imageKit  0x939c0776 -[IKMipmapImage  
validateMipmap:withQuality:] + 228
9   com.apple.imageKit  0x939e2b1a - 
[IKImageBrowserView(ImageBrowserImport) startScrollPrefetchTask] +  
1040
10  com.apple.imageKit  0x93a92167 -[IKTaskManager  
taskLoop] + 2037

...

___

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/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.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: IKImageBrowserView crash

2009-04-09 Thread Bill Bumgarner

On Apr 8, 2009, at 12:36 PM, Ashley Clark wrote:

Thread 0 Crashed:
0   GLEngine0x1e4daf17  
glDeleteTextures_Exec + 23
1   libGL.dylib 0x941cc476 glDeleteTextures  
+ 38
2   com.apple.imageKit  0x93aa4684  
_deleteTextureForIKGLImageInfo + 105

3   com.apple.imageKit  0x93aa46da _removeOwners + 53
4   com.apple.CoreFoundation0x942bcb29  
CFDictionaryApplyFunction + 169
5   com.apple.imageKit  0x93aa528a - 
[IKGLSharedContextRegistry removeOwner:] + 141

6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29


Known bug.  It has been fixed.

If you (or anyone else) need more information about when the fix might  
be available, etc, please contact Apple's Developer Tech Support.


b.bum

___

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


Crash using IKImageBrowserView

2009-12-28 Thread Dan Treiman
I'm seeing a recurring but intermittent crash in my GC-enabled app, which uses 
multiple IKImageBrowserViews.

Has anybody seen anything like this?  Have any insight as to why its crashing 
here?

Stack:

Thread 0 Crashed:
0   GLEngine0x00011b051940 glGetError_Exec + 16
1   com.apple.imageKit  0x000100cc81b4 -[IKTexturePacker 
releaseTexturePackerAtIndex:] + 309
2   com.apple.imageKit  0x000100cd71e3 -[IKVRamManager 
_unbind:notifyDelegate:] + 471
3   com.apple.imageKit  0x000100cd7d10 -[IKVRamManager 
removeEntriedOlderThanSessionID:] + 404
4   com.apple.imageKit  0x000100cd23b5 -[IKCacheManager 
removeEntriedOlderThanSessionID:] + 47
5   com.apple.imageKit  0x000100cd2ba1 -[IKCacheManager 
IKCleanTimedOutCache] + 174
6   com.apple.Foundation0x7fff84081ca3 
__NSFireDelayedPerform + 307
7   com.apple.CoreFoundation0x7fff83f33245 CFRunLoopRunSpecific 
+ 3797
8   com.apple.HIToolbox 0x7fff83b8bd0e 
RunCurrentEventLoopInMode + 278
9   com.apple.HIToolbox 0x7fff83b8bb44 
ReceiveNextEventCommon + 322
10  com.apple.HIToolbox 0x7fff83b8b9ef 
BlockUntilNextEventMatchingListInMode + 79
11  com.apple.AppKit0x7fff82ff2e70 _DPSNextEvent + 603
12  com.apple.AppKit0x7fff82ff27b1 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 136
13  com.apple.AppKit0x7fff82fec523 -[NSApplication run] 
+ 434
14  com.apple.AppKit0x7fff82fb92f0 NSApplicationMain + 
373
15  com.gendaigames.GameSalad   0x00012290 start + 52
___

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


IKImageBrowserView Title & Subtitle Woes

2008-04-13 Thread Thaddeus Cooper

Hello all.

I am trying to set the color of the title and subtitle in an  
IKImageBrowserView. From what I see in the documentation I need to set  
up a dictionary with key-value pairs that describe the attributes of  
what I want to set it to. I have the snippet of code that I'm trying  
to use below:


		NSDictionary *titleTextInfo = [NSDictionary dictionaryWithObject: 
[CIColor colorWithRed:0.0 green:1.0 blue:0.0] forKey:@"titleColor"];
		[myBrowserView setValue:titleTextInfo  
forKey:IKImageBrowserCellsTitleAttributesKey];


What I can't figure out is what is the magic key for setting the color  
of the title and subtitle. I've tried: foregroundColor,  
ForegroundColor, color, Color, titleColor, TitleColor and probably a  
few others. I've also tried using both CIColor (as shown above) and  
NSColor. As far as I can tell from a search of the documentation the  
actual keys are not documented.


Any help would be greatly appreciated.

Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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]


Image reflection in IKImageBrowserView

2008-05-01 Thread Aby
Hi list,
How to implement Image reflection for all the images in
IKImageBrowserView.

Regards
Tom
___

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: IKImageBrowserView is bonkers

2008-06-06 Thread j o a r


On Jun 6, 2008, at 3:50 PM, Randall Meadows wrote:

The images are captured from a digital camera, which is oriented in  
a portrait fashion.  Once downloaded from the camera, the images are  
rotated (using jpegtran) to a "normal" orientation, the EXIF is  
edited to match (using exiftool, since jpegtran leaves the flag  
alone when it rotates it), and finally an icon is added to the file  
using this code:


NSImage *preview = [[NSImage alloc] initWithContentsOfFile:filePath]];
[[NSWorkspace sharedWorkspace] setIcon:preview forFile:filePath  
options:0];


So the image is created from the rotated, EXIF-fixed image file.   
The image file displays correctly in Preview, Safari, QuickLook, and  
its Finder preview icon is correct also.


Why come then does the IKImageBrowserView always initially show the  
image rotated 90° CW, and then a little while later refresh it to be  
correct?  Sorry, not even INITIALLY, its whenever the view updates  
from the data source.  The data source simply returns the full path  
to the image in the filesystem to display when requested.  I've  
already determined that the image file itself is correct in all ways.


You can see a short (~30 second) QT movie of this strange behavior  
in action at <http://idisk.mac.com/callipygiani/Public/ 
RotationWTF.mov>.  The movie shows several images being captured and  
added to the view, a couple deleted from the view, and then another  
captured and added.


Any tips or suggestions as to what is going on would be GREATLY  
appreciated.  I really don't want to have to write my own image  
browser view...



The images probably have an embedded thumbnail / preview that is not  
updated when you rotate the main image using "jpegtran". My bet is  
that the image browser for performance reasons by default use an  
existing embedded thumbnail / preview to improve perceived performance.


j o a r


___

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: IKImageBrowserView is bonkers

2008-06-06 Thread Adam R. Maxwell


On Jun 6, 2008, at 3:57 PM, j o a r wrote:



On Jun 6, 2008, at 3:50 PM, Randall Meadows wrote:

The images are captured from a digital camera, which is oriented in  
a portrait fashion.  Once downloaded from the camera, the images  
are rotated (using jpegtran) to a "normal" orientation, the EXIF is  
edited to match (using exiftool, since jpegtran leaves the flag  
alone when it rotates it), and finally an icon is added to the file  
using this code:


NSImage	*preview = [[NSImage alloc]  
initWithContentsOfFile:filePath]];
[[NSWorkspace sharedWorkspace] setIcon:preview forFile:filePath  
options:0];


So the image is created from the rotated, EXIF-fixed image file.   
The image file displays correctly in Preview, Safari, QuickLook,  
and its Finder preview icon is correct also.


Why come then does the IKImageBrowserView always initially show the  
image rotated 90° CW, and then a little while later refresh it to  
be correct?  Sorry, not even INITIALLY, its whenever the view  
updates from the data source.  The data source simply returns the  
full path to the image in the filesystem to display when  
requested.  I've already determined that the image file itself is  
correct in all ways.


You can see a short (~30 second) QT movie of this strange behavior  
in action at <http://idisk.mac.com/callipygiani/Public/RotationWTF.mov 
>.  The movie shows several images being captured and added to the  
view, a couple deleted from the view, and then another captured and  
added.


Any tips or suggestions as to what is going on would be GREATLY  
appreciated.  I really don't want to have to write my own image  
browser view...



The images probably have an embedded thumbnail / preview that is not  
updated when you rotate the main image using "jpegtran". My bet is  
that the image browser for performance reasons by default use an  
existing embedded thumbnail / preview to improve perceived  
performance.


If that's the case, maybe you need to implement -imageVersion from the  
IKImageBrowserItem protocol and bump the version number after you  
rotate it?  I haven't tried that, since I wrote my own image browser  
view ;).


--
Adam

___

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: IKImageBrowserView is bonkers

2008-06-06 Thread Ken Ferry
On Fri, Jun 6, 2008 at 4:16 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote:
>
> On Jun 6, 2008, at 3:57 PM, j o a r wrote:
>
>>
>> On Jun 6, 2008, at 3:50 PM, Randall Meadows wrote:
>>
>>> The images are captured from a digital camera, which is oriented in a
>>> portrait fashion.  Once downloaded from the camera, the images are rotated
>>> (using jpegtran) to a "normal" orientation, the EXIF is edited to match
>>> (using exiftool, since jpegtran leaves the flag alone when it rotates it),
>>> and finally an icon is added to the file using this code:
>>>
>>> NSImage *preview = [[NSImage alloc] initWithContentsOfFile:filePath]];
>>> [[NSWorkspace sharedWorkspace] setIcon:preview forFile:filePath
>>> options:0];
>>>
>>> So the image is created from the rotated, EXIF-fixed image file.  The
>>> image file displays correctly in Preview, Safari, QuickLook, and its Finder
>>> preview icon is correct also.
>>>
>>> Why come then does the IKImageBrowserView always initially show the image
>>> rotated 90° CW, and then a little while later refresh it to be correct?
>>>  Sorry, not even INITIALLY, its whenever the view updates from the data
>>> source.  The data source simply returns the full path to the image in the
>>> filesystem to display when requested.  I've already determined that the
>>> image file itself is correct in all ways.
>>>
>>> You can see a short (~30 second) QT movie of this strange behavior in
>>> action at <http://idisk.mac.com/callipygiani/Public/RotationWTF.mov>.  The
>>> movie shows several images being captured and added to the view, a couple
>>> deleted from the view, and then another captured and added.
>>>
>>> Any tips or suggestions as to what is going on would be GREATLY
>>> appreciated.  I really don't want to have to write my own image browser
>>> view...
>>
>>
>> The images probably have an embedded thumbnail / preview that is not
>> updated when you rotate the main image using "jpegtran". My bet is that the
>> image browser for performance reasons by default use an existing embedded
>> thumbnail / preview to improve perceived performance.
>
> If that's the case, maybe you need to implement -imageVersion from the
> IKImageBrowserItem protocol and bump the version number after you rotate it?
>  I haven't tried that, since I wrote my own image browser view ;).

Joar's right on - ImageKit does use the thumbnail if it's there.

It isn't the image browser's cache that's wrong, it's the original
file.  It has an embedded thumbnail that is in a different orientation
than the main image data.

-Ken
___

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: IKImageBrowserView is bonkers

2008-06-06 Thread Adam R. Maxwell


On Jun 6, 2008, at 8:13 PM, Ken Ferry wrote:

On Fri, Jun 6, 2008 at 4:16 PM, Adam R. Maxwell <[EMAIL PROTECTED]>  
wrote:


On Jun 6, 2008, at 3:57 PM, j o a r wrote:


The images probably have an embedded thumbnail / preview that is not
updated when you rotate the main image using "jpegtran". My bet is  
that the
image browser for performance reasons by default use an existing  
embedded

thumbnail / preview to improve perceived performance.


If that's the case, maybe you need to implement -imageVersion from  
the
IKImageBrowserItem protocol and bump the version number after you  
rotate it?

I haven't tried that, since I wrote my own image browser view ;).


Joar's right on - ImageKit does use the thumbnail if it's there.

It isn't the image browser's cache that's wrong, it's the original
file.  It has an embedded thumbnail that is in a different orientation
than the main image data.


Oops...thanks for clarifying that!  I misread Joar's message as  
referring to the existing thumbnail in the image browser cache.  Is it  
possible to change embedded thumbnails with ImageIO?


--
Adam
___

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]


IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Florian Soenens

Hi list,

i have an IKImageBrwoserView bound to an NSArrayController of objects.
The objects all conform to the IKImagebrowserItem protocol.

When running my application, all the images display correctly in the  
browser view, this al works fine, BUT:


In the IKImageBrowserDelegate, i implemented  
imageBrowserSelectionDidChange like this for testing purposes:

(I also have an IBOutlet to my NSArrayController)

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser
{
NSLog([[arrayController selectedIndex] description]);
}

The problem is that the NSArrayController always logs the same index,  
no mather what item i select in de BrowserView.

I assumed that it would always reflect the currently selected index.

I can fix it by doing this but i am not sure if this is the right way  
to go, or is it just a bug in IKImageBrowserView?


- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser
{
[arrayController setSelectionIndexes:[aBrower selectionIndexes]];
NSLog([[arrayController selectedIndex] description]);
}

Help would be much appreciated.
Thanks,
Florian.




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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]


IKImageBrowserView and mouseDragged event

2008-11-27 Thread Sandeep Chayapathi
Greetings,
 In my app I have an IKImageBrowserView, and I want to make this an drag
source. I have followed thedragging source
docs<http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976>
but
to no avail. In my view class the mouseDragged never gets called. Any help
on making the IKImageBrowserView a drag source or making it respond to
mouseDragged even is appreciated. Thanks.


-- Sandeep
___

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: IKImageBrowserView Dragging outside

2009-10-23 Thread Thomas Goossens
Hi Jordan,

imageBrowser:writeItemsAtIndexes:toPasteboard: is indeed the way to go.

Implement this method in your datasource and just fill the pasteboard with the 
info you want (Images, paths, urls, data...) for the indexes passed in 
arguments.
Also if you feed the imageBrowser with paths or urls 
(IKImageBrowserPathRepresentationType, 
IKImageBrowserNSURLRepresentationType...) , you don't have to do anything, the 
pasteboard is filled automatically (i.e you don't need to implement 
imageBrowser:writeItemsAtIndexes:toPasteboard:).

-- Thomas


On Oct 22, 2009, at 2:30 PM, TFS - Tobias Jordan wrote:

> Hi all,
> 
> I've been wondering on how to implement dragging out of the view in the 
> IKImageBrowserView. I am pretty sure this is where I have to start: 
> -imageBrowser:writeItemsAtIndexes:toPasteboard: but I don't have a clue what 
> to do next. It's not a real File Promise, I just need the folder (in most 
> cases the Desktop) dragged to and the indexes that have been dragged.
> The class seems to be quite different to the NSTableView in which I am using 
> '-tableView:writeRowsWithIndexes:toPasteboard' and 
> '-tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:'.
> 
> What's the method I am missing?
> 
> Best regards & thanks.
> Tobias Jordan.
> ___
> 
> 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/tgoossens%40mac.com
> 
> This email sent to tgooss...@mac.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: IKImageBrowserView Dragging outside

2009-10-23 Thread TFS - Tobias Jordan
Thanks for that, Thomas. The Problem I'm having is that the  
IKImageBrowserView is just representing previews. So it's a file  
preview and there's a path behind the preview to be copied when  
dragging out.
With the standard settings of the view, I'll get the preview image  
copied to the location instead of the file behind the image. That's  
why I have to implement everything on my own, I know this sounds  
confusing. ;-)


I dunno know what to declare in the pasteboard when it is about  
NSIndexSets. And what to do next after implementing  
writeItemsAtIndexes:toPasteboard:…?

Thanks so much for your help, I really appreciate it.

On Oct 23, 2009, at 6:49 PM, Thomas Goossens wrote:


Hi Jordan,

imageBrowser:writeItemsAtIndexes:toPasteboard: is indeed the way to  
go.


Implement this method in your datasource and just fill the  
pasteboard with the info you want (Images, paths, urls, data...) for  
the indexes passed in arguments.
Also if you feed the imageBrowser with paths or urls  
(IKImageBrowserPathRepresentationType,  
IKImageBrowserNSURLRepresentationType...) , you don't have to do  
anything, the pasteboard is filled automatically (i.e you don't need  
to implement imageBrowser:writeItemsAtIndexes:toPasteboard:).


-- Thomas


On Oct 22, 2009, at 2:30 PM, TFS - Tobias Jordan wrote:


Hi all,

I've been wondering on how to implement dragging out of the view in  
the IKImageBrowserView. I am pretty sure this is where I have to  
start: -imageBrowser:writeItemsAtIndexes:toPasteboard: but I don't  
have a clue what to do next. It's not a real File Promise, I just  
need the folder (in most cases the Desktop) dragged to and the  
indexes that have been dragged.
The class seems to be quite different to the NSTableView in which I  
am using '-tableView:writeRowsWithIndexes:toPasteboard' and '- 
tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes 
:'.


What's the method I am missing?

Best regards & thanks.
Tobias Jordan.
___

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/tgoossens%40mac.com

This email sent to tgooss...@mac.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: IKImageBrowserView Dragging outside

2009-10-23 Thread Thomas Goossens

On Oct 23, 2009, at 9:15 PM, TFS - Tobias Jordan wrote:

> Thanks for that, Thomas. The Problem I'm having is that the 
> IKImageBrowserView is just representing previews. So it's a file preview and 
> there's a path behind the preview to be copied when dragging out.
> With the standard settings of the view, I'll get the preview image copied to 
> the location instead of the file behind the image. That's why I have to 
> implement everything on my own, I know this sounds confusing. ;-)

ok that makes sense.

> I dunno know what to declare in the pasteboard when it is about NSIndexSets. 
> And what to do next after implementing writeItemsAtIndexes:toPasteboard:…?
> Thanks so much for your help, I really appreciate it.

This is not something specific to the IKImageBrowserView here so the pasteboard 
programming guide should help: 
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PasteboardGuide106/Introduction/Introduction.html

Typically you will have to do something like this:

- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser 
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard 
*)pasteboard
{
NSUinteger index;

//instantiate an array to store paths
filesArray = [NSMutableArray array];

//for each index...
for(index = [itemIndexes firstIndex]; index != NSNotFound; index = 
[itemIndexes indexGreaterThanIndex:index]){

//...get the path you want to add to the pasteboard
id myDatasourceItem = [_myDatasourceArray objectAtIndex:index];
NSString *path = [myDatasourceItem myLargeImageFilePath];

//add it to your array
[filesArray addObject:path];
}

//declare the pasteboard will contain paths
[pasteboard declareTypes:[NSArray 
arrayWithObjects:NSFilenamesPboardType,nil] owner:self];

//set the paths
[pasteboard setPropertyList:filesArray forType:NSFilenamesPboardType];

 //return the number of items added to the pasteboard
 return [filesArray count];
}

-- Thomas



> On Oct 23, 2009, at 6:49 PM, Thomas Goossens wrote:
> 
>> Hi Jordan,
>> 
>> imageBrowser:writeItemsAtIndexes:toPasteboard: is indeed the way to go.
>> 
>> Implement this method in your datasource and just fill the pasteboard with 
>> the info you want (Images, paths, urls, data...) for the indexes passed in 
>> arguments.
>> Also if you feed the imageBrowser with paths or urls 
>> (IKImageBrowserPathRepresentationType, 
>> IKImageBrowserNSURLRepresentationType...) , you don't have to do anything, 
>> the pasteboard is filled automatically (i.e you don't need to implement 
>> imageBrowser:writeItemsAtIndexes:toPasteboard:).
>> 
>> -- Thomas
>> 
>> 
>> On Oct 22, 2009, at 2:30 PM, TFS - Tobias Jordan wrote:
>> 
>>> Hi all,
>>> 
>>> I've been wondering on how to implement dragging out of the view in the 
>>> IKImageBrowserView. I am pretty sure this is where I have to start: 
>>> -imageBrowser:writeItemsAtIndexes:toPasteboard: but I don't have a clue 
>>> what to do next. It's not a real File Promise, I just need the folder (in 
>>> most cases the Desktop) dragged to and the indexes that have been dragged.
>>> The class seems to be quite different to the NSTableView in which I am 
>>> using '-tableView:writeRowsWithIndexes:toPasteboard' and 
>>> '-tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:'.
>>> 
>>> What's the method I am missing?
>>> 
>>> Best regards & thanks.
>>> Tobias Jordan.
>>> ___
>>> 
>>> 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/tgoossens%40mac.com
>>> 
>>> This email sent to tgooss...@mac.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/tgoossens%40mac.com
> 
> This email sent to tgooss...@mac.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: IKImageBrowserView Dragging outside

2009-10-24 Thread TFS - Tobias Jordan
Thanks again Thomas and Jonathan. What you've written, Thomas, is  
indeed working as it should however I can't use it for my project  
since I am creating special folder structures when copying the files,  
e.g. Adobe Photoshop Files -> 2008-10-20 -> MyPSFile.psd.


Isn't there a way to get the folder dropped to and then do the copy  
operation myself? I am having an NSTableView that does pretty much the  
same thing, look:


- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet  
*)rowIndexes toPasteboard:(NSPasteboard *)pboard

{
if (NSNotFound != [rowIndexes firstIndex])
{
[array setSelectionIndexes:rowIndexes];
[pboard declareTypes:[self types] owner:self];
		[pboard setPropertyList:[NSArray  
arrayWithObject:@"ESPFilePromiseType"]  
forType:NSFilesPromisePboardType];

}
return YES;
}

- (NSArray *)tableView:(NSTableView *)tv  
namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination  
forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes

{
	[self restoreManagedObjects:[array selectedObjects]  
withDestinationFolder:[dropDestination path]];

return nil;
}

Since the method 'tableView:namesOfPromisedFilesDroppedAtDestination: 
…' doesn't exist I am currently out of luck.


Tobias.

On Oct 23, 2009, at 10:24 PM, jonat...@mugginsoft.com wrote:


Tobias

Not sure if this will help.
In the example GoodThing is a core data subclass which stores the  
image as NSData.

As such it implements the IKImageBrowserItem informal protocol methods
-imageRepresentation, -imageRepresentationType (==  
IKImageBrowserNSDataRepresentationType) and - imageUID;


/*

write images to paste board

need for dragging of non path represented images

*/
- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser  
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard

{
NSInteger   index;
NSInteger itemsWritten = 0;
		for (index = [itemIndexes lastIndex]; index != NSNotFound; index =  
[itemIndexes indexLessThanIndex:index])

{
// get image data.
GoodThing *goodThing = [imageBrowser  
itemAtIndex:index];
NSData *imageData = goodThing.imageRepresentation;

// get a tiff representation and write to pasteboard
NSImage *image = [[NSImage alloc] 
initWithData:imageData];
if (image) {
NSData *tiffData = [image TIFFRepresentation];	// may raise an  
exception

if (tiffData) {

// prepare the pasteboard
if (itemsWritten == 0) {
		[pasteboard declareTypes:[NSArray  
arrayWithObject:NSTIFFPboardType] owner:nil];

}

// write to the pasteboard
[pasteboard setData:tiffData 
forType:NSTIFFPboardType];
itemsWritten++;
}
}
}

return itemsWritten;
}

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com


On Oct 23, 2009, at 11:44 PM, Thomas Goossens wrote:



On Oct 23, 2009, at 9:15 PM, TFS - Tobias Jordan wrote:

Thanks for that, Thomas. The Problem I'm having is that the  
IKImageBrowserView is just representing previews. So it's a file  
preview and there's a path behind the preview to be copied when  
dragging out.
With the standard settings of the view, I'll get the preview image  
copied to the location instead of the file behind the image. That's  
why I have to implement everything on my own, I know this sounds  
confusing. ;-)


ok that makes sense.

I dunno know what to declare in the pasteboard when it is about  
NSIndexSets. And what to do next after implementing  
writeItemsAtIndexes:toPasteboard:…?

Thanks so much for your help, I really appreciate it.


This is not something specific to the IKImageBrowserView here so the  
pasteboard programming guide should help: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/PasteboardGuide106/Introduction/Introduction.html


Typically you will have to do something like this:

- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser  
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard

{
NSUinteger index;

//instantiate an array to store paths
filesArray = [NSMutableArray array];

//for each index...
	for(index = [itemIndexes firstIndex]; index != NSNotFound; index =  
[itemIndexes indexGreaterThanIndex:index]){


   

Re: IKImageBrowserView Dragging outside

2009-10-25 Thread jonat...@mugginsoft.com


On 24 Oct 2009, at 16:36, TFS - Tobias Jordan wrote:

Thanks again Thomas and Jonathan. What you've written, Thomas, is  
indeed working as it should however I can't use it for my project  
since I am creating special folder structures when copying the  
files, e.g. Adobe Photoshop Files -> 2008-10-20 -> MyPSFile.psd.


Isn't there a way to get the folder dropped to and then do the copy  
operation myself? I am having an NSTableView that does pretty much  
the same thing, look:


- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet  
*)rowIndexes toPasteboard:(NSPasteboard *)pboard

{
if (NSNotFound != [rowIndexes firstIndex])
{
[array setSelectionIndexes:rowIndexes];
[pboard declareTypes:[self types] owner:self];
		[pboard setPropertyList:[NSArray  
arrayWithObject:@"ESPFilePromiseType"]  
forType:NSFilesPromisePboardType];

}
return YES;
}

- (NSArray *)tableView:(NSTableView *)tv  
namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination  
forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes

{
	[self restoreManagedObjects:[array selectedObjects]  
withDestinationFolder:[dropDestination path]];

return nil;
}

Since the method 'tableView:namesOfPromisedFilesDroppedAtDestination: 
…' doesn't exist I am currently out of luck.



That might prove to be the case.
Others think the same: 
http://www.cocoabuilder.com/archive/message/cocoa/2009/7/29/241852

An approach might be to use an NSTableView instance as a drag source  
proxy.
When your IKImageBrowserView instance gets a drag request pass it on  
to the tableview which can deliver on the promise.

You would have to keep the datasources synchronised of course.
Either that or populate the tableview with just the items to be  
dragged when the IKImageBrowserView

 drag begins.

Just an idea. Might be tricky to pull off in practice.

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com

Tobias.

On Oct 23, 2009, at 10:24 PM, jonat...@mugginsoft.com wrote:


Tobias

Not sure if this will help.
In the example GoodThing is a core data subclass which stores the  
image as NSData.
As such it implements the IKImageBrowserItem informal protocol  
methods
-imageRepresentation, -imageRepresentationType (==  
IKImageBrowserNSDataRepresentationType) and - imageUID;


/*

write images to paste board

need for dragging of non path represented images

*/
- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser  
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard

{
NSInteger   index;
NSInteger itemsWritten = 0;
		for (index = [itemIndexes lastIndex]; index != NSNotFound; index  
= [itemIndexes indexLessThanIndex:index])

{
// get image data.
GoodThing *goodThing = [imageBrowser  
itemAtIndex:index];
NSData *imageData = goodThing.imageRepresentation;

// get a tiff representation and write to pasteboard
NSImage *image = [[NSImage alloc] 
initWithData:imageData];
if (image) {
NSData *tiffData = [image TIFFRepresentation];	// may raise an  
exception

if (tiffData) {

// prepare the pasteboard
if (itemsWritten == 0) {
		[pasteboard declareTypes:[NSArray  
arrayWithObject:NSTIFFPboardType] owner:nil];

}

// write to the pasteboard
[pasteboard setData:tiffData 
forType:NSTIFFPboardType];
itemsWritten++;
}
}
}

return itemsWritten;
}

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com


On Oct 23, 2009, at 11:44 PM, Thomas Goossens wrote:



On Oct 23, 2009, at 9:15 PM, TFS - Tobias Jordan wrote:

Thanks for that, Thomas. The Problem I'm having is that the  
IKImageBrowserView is just representing previews. So it's a file  
preview and there's a path behind the preview to be copied when  
dragging out.
With the standard settings of the view, I'll get the preview image  
copied to the location instead of the file behind the image.  
That's why I have to implement everything on my own, I know this  
sounds confusing. ;-)


ok that makes sense.

I dunno know what to declare in the pasteboard when it is about  
NSIndexSets. And what to do next after implementing  
writeItemsAtIndexes:toPasteboard:…?

Thanks so much for your help, I really appreciate it.


This is not something specific to the IK

Re: IKImageBrowserView Dragging outside

2009-10-26 Thread Tobias Jordan

Hey Jonathan & Thomas,

it's finally working and even more easier than I've thought: So I made  
a subclass of my IKImageBrowserView and added a new delegate method,  
the one's missing:


//  
---

// -browserView:droppedIndexes:atDestination:
//  
---
- (void)browserView:(ESPImageBrowserView *)bv droppedIndexes: 
(NSIndexSet *)indexSet atDestination:(NSURL *)dropDestination

{
if (self.delegate)
{
		if ([self.delegate  
respondsToSelector 
:@selector(browserView:droppedIndexes:atDestination:)])

{
			[self.delegate browserView:bv droppedIndexes:indexSet  
atDestination:dropDestination];

}
}
}

it's called from:

//  
---

// -namesOfPromisedFilesDroppedAtDestination:
//  
---
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL  
*)dropDestination

{
	[self browserView:self droppedIndexes:[self selectionIndexes]  
atDestination:dropDestination];

return nil;
}

No need to implement :mouseDown- or -mouseDragged: :-)

Thank you for your help!

Best regards,
Tobias Jordan.

On Oct 25, 2009, at 12:41 PM, jonat...@mugginsoft.com wrote:


That might prove to be the case.
Others think the same: 
http://www.cocoabuilder.com/archive/message/cocoa/2009/7/29/241852

An approach might be to use an NSTableView instance as a drag source  
proxy.
When your IKImageBrowserView instance gets a drag request pass it on  
to the tableview which can deliver on the promise.

You would have to keep the datasources synchronised of course.
Either that or populate the tableview with just the items to be  
dragged when the IKImageBrowserView

drag begins.

Just an idea. Might be tricky to pull off in practice.

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com




On Oct 25, 2009, at 3:41 PM, Thomas Goossens wrote:


Ok, I didn't catch you need to create special folder structures.
So you can only do that with promised files and since there is no  
equivalent to "tableView:namesOfPromisedFilesDroppedAtDestination"  
in the IKImageBrowseView, you will have to do everything at the  
NSView level using  
"dragPromisedFilesOfTypes:fromRect:source:slideBack:event:" and  
"namesOfPromisedFilesDroppedAtDestination:".
But that means you will have to detect when the drag should start  
(with mouseDown/mouseDragged + IK's indexOfItemAtPoint) and setup  
your drag image yourself.


-- Thomas


___

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: IKImageBrowserView selection notification

2009-11-24 Thread Nick Zitzmann

On Nov 24, 2009, at 1:21 AM, Charles Burnstagger wrote:

> How do I detect when the selection changes in a IKImageBrowserView? I didn't 
> see anything in the docs on that.

<http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/IKImageBrowserDelegate_Protocol/IKImageBrowserDelegate_Reference.html#//apple_ref/doc/uid/TP40004710-CH3-DontLinkElementID_5>

Nick Zitzmann
<http://www.chronosnet.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


IKImageBrowserView only horizontal scrolling

2008-10-27 Thread Ralph Manns
Hello,
is there a away to limit the number of rows to 1, so that IKImageBrowserView
scrolls only horizontal ?

Ralph
___

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]


Scrolling Title in IKImageBrowserView?

2009-01-25 Thread Brad Gibbs
Is it possible to set the title of an image in an IKImageBrowserView  
to scroll when the item is selected?


Thanks.
___

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: IKImageBrowserView - multiline labels

2009-02-07 Thread Rob Keniger


On 08/02/2009, at 11:40 AM, Eric Gorr wrote:

I was wondering if anyone has used this control. I have a situation  
which it may be perfect for, but the three things I am not certain  
it is capable of is:


1. supporting in-place editing of the labels
2. supporting multi-line labels
3. using a smaller font in the labels

I have tried to figure out how to get it to do these things, but  
have been unable.


If it cannot, I intend to file bugs, but wanted to first verify  
these things weren't possible.



You can't do #1 and #2. Well, you can have a title and a subtitle on  
separate lines, but that's not the same thing as a multi-line title.


You can definitely do #3. To do this you have to give the image  
browser view an attributed string dictionary:


//set up the string attributes any way you like
NSDictionary* titleAttributes = [NSDictionary  
dictionaryWithObjectsAndKeys:
	 [NSFont systemFontOfSize:[NSFont  
smallSystemFontSize]], NSFontAttributeName,
	 [NSColor whiteColor],  
NSForegroundColorAttributeName,

 nil];

//tell the image browser to use your attributes
[myIKImageBrowserView setValue:titleAttributes  
forKey:IKImageBrowserCellsTitleAttributesKey];


I agree that this is poorly documented. I also wonder why we have to  
use setValue:forKey: for many IKImageBrowserView settings instead of  
calling a method like -setTitleAttributes:, which would be the  
"normal" way to set these kinds of options.


--
Rob Keniger



___

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


IKImageBrowserView setSelectionIndex not selecting

2009-06-22 Thread Richard Gutierrez
I have been researching extensively on how to set an IKImageBrowserView's 
initial selection upon load to 0 index. Here is the call I am making:

[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] 
byExtendingSelection:NO];

 Seems like the IKImageBrowserView is not fully loaded when the call is made, 
however, I do have an IKImageView which is selecting and loading the first 
object in the ImageBrowserView's object list correctly mat the same time I am 
calling the same time. Here is the entire call:

- (void)updateDatasource {
[images addObjectsFromArray:importedImages];
[importedImages removeAllObjects];
[imageBrowser reloadData];
NSString *firstImagePath = [[images objectAtIndex:0] imageUID];
NSURL *firstImageURL = [NSURL fileURLWithPath:firstImagePath];
[previewImageStatic setImageWithURL:firstImageURL];
[pathTextField setStringValue:firstImagePath];
[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] 
byExtendingSelection:NO];
}

I am not sure how I can get this call to select the object at index 0. I even 
created an IBAction connected to a test button using the following code:

- (IBAction)selectImageBrowserFirstObject:(id)sender {
[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] 
byExtendingSelection:NO];
}

And that works perfectly (since the IKImageBrowserView is already completely 
loaded. Any ideas on how to work this out? Thank you in advance.
___

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


IKImageBrowserView reload data broken

2009-07-01 Thread Richard Gutierrez
Hello... I have an IKImageBrowserView that is not refreshing it's data 
correctly. I have an NSPopUpButton which has a list of directories in its 
array, when a directory is selected, it changes the contents of my 
IKImageBrowserView to display all image files contained in the said directory.

Unfortunately, I have encountered an issue with the IKImageBrowserView's 
"reloadData" call. When I have no objects selected in the IKImageBrowserView, 
the reloadData call works as expected. The problem is, I have set 
IKImageBrowserView's "setAllowsEmptySelection" to "NO" and (thanks to you all's 
help) set the IKImageBrowserView to "setSelectionIndexes:[NSIndexSet 
indexSetWithIndex:0] byExtendingSelection:NO];", so there is always a selection.

When my IKImageBrowserView has an object selected, the "reloadData" call gives 
me the following error: "2009-07-01 14:28:43.453 ImageBrowser[17020:813] *** 
-[NSCFArray objectAtIndex:]: index (2147483647( or possibly larger)) beyond 
bounds (0)" and I have been unable to resolve this issue. Here is my call when 
the NSPopUpButton's selection is changed which causes the problem at 
"[imageBrowser reloadData]" on both the "if" and "else" statements:

- (IBAction) pubSelectionChanged:(id)sender {
NSString *selectedPUBItem = [[selectCategoryPUB selectedItem]title];
NSString *selectedCategoryPath = [NSString 
stringWithFormat:@"/Users/richardg/Desktop/Demetras_Images/Thank You_Referral 
Cards/%@", selectedPUBItem];
NSArray *categoryPath = [NSArray arrayWithObject:selectedCategoryPath];
if ([selectedPUBItem isEqualToString:@"All Images"]) {
NSString *allImagesPUBSelection = 
@"/Users/richardg/Desktop/Demetras_Images/Thank You_Referral Cards/";
NSArray *allImagesPath = [NSArray 
arrayWithObject:allImagesPUBSelection];
[images removeAllObjects];
[importedImages removeAllObjects];
[imageBrowser reloadData];
[NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) 
toTarget:self withObject:allImagesPath];
}
else {
[images removeAllObjects];
[importedImages removeAllObjects];
[imageBrowser reloadData];
[NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) 
toTarget:self withObject:categoryPath];
}
}

Any help here would be greatly appreciated. I looked extensively online and 
came up with many dead ends. Thank you AGAIN in advance! You guys are always a 
HUGE help!
___

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


2 IKImageBrowserView behaving differently

2009-07-16 Thread Eric Boo
Hi all,

I have 2 tabs, with an IKImageBrowserView in each tab.

I have implemented imageBrowser:writeItemsAtIndexes:toPasteboard: so I
can drag images from one IKImageBrowserView to another, and have also
implemented imageBrowser:removeItemsAtIndexes: so images can be
removed.

However, reordering doesn't work:
- (BOOL) imageBrowser:(IKImageBrowserView *) view moveItemsAtIndexes:
(NSIndexSet *)indexes toIndex:(NSUInteger)destinationIndex
{
NSLog(@"we are moving items");
return YES;
}

This method isn't even called when I drag to reorder. There's also no
cursor that shows up when I move the images to a position.

Any idea what I can be doing wrong?
___

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: Crash using IKImageBrowserView

2010-01-17 Thread Ashley Clark
Were these crashes under Leopard or Snow Leopard. I was seeing similar crashes 
in GLEngine under GC/Leopard but so far haven't been able to reproduce any of 
them under Snow Leopard.

On Apr 9, 2009, at 10:32 AM, Bill Bumgarner wrote:

> On Apr 8, 2009, at 12:36 PM, Ashley Clark wrote:
>> Thread 0 Crashed:
>> 0   GLEngine0x1e4daf17 glDeleteTextures_Exec + 23
>> 1   libGL.dylib 0x941cc476 glDeleteTextures + 38
>> 2   com.apple.imageKit  0x93aa4684 
>> _deleteTextureForIKGLImageInfo + 105
>> 3   com.apple.imageKit  0x93aa46da _removeOwners + 53
>> 4   com.apple.CoreFoundation0x942bcb29 CFDictionaryApplyFunction 
>> + 169
>> 5   com.apple.imageKit  0x93aa528a 
>> -[IKGLSharedContextRegistry removeOwner:] + 141
>> 6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29
> 
> Known bug.  It has been fixed.
> 
> If you (or anyone else) need more information about when the fix might be 
> available, etc, please contact Apple's Developer Tech Support.


Ashley


On Dec 28, 2009, at 10:13 PM, Dan Treiman wrote:

> I'm seeing a recurring but intermittent crash in my GC-enabled app, which 
> uses multiple IKImageBrowserViews.
> 
> Has anybody seen anything like this?  Have any insight as to why its crashing 
> here?
> 
> Stack:
> 
> Thread 0 Crashed:
> 0   GLEngine  0x00011b051940 glGetError_Exec + 16
> 1   com.apple.imageKit0x000100cc81b4 -[IKTexturePacker 
> releaseTexturePackerAtIndex:] + 309
> 2   com.apple.imageKit0x000100cd71e3 -[IKVRamManager 
> _unbind:notifyDelegate:] + 471
> 3   com.apple.imageKit0x000100cd7d10 -[IKVRamManager 
> removeEntriedOlderThanSessionID:] + 404
> 4   com.apple.imageKit0x000100cd23b5 -[IKCacheManager 
> removeEntriedOlderThanSessionID:] + 47
> 5   com.apple.imageKit0x000100cd2ba1 -[IKCacheManager 
> IKCleanTimedOutCache] + 174
> 6   com.apple.Foundation  0x7fff84081ca3 
> __NSFireDelayedPerform + 307
> 7   com.apple.CoreFoundation  0x7fff83f33245 CFRunLoopRunSpecific 
> + 3797
> 8   com.apple.HIToolbox   0x7fff83b8bd0e 
> RunCurrentEventLoopInMode + 278
> 9   com.apple.HIToolbox   0x7fff83b8bb44 
> ReceiveNextEventCommon + 322
> 10  com.apple.HIToolbox   0x7fff83b8b9ef 
> BlockUntilNextEventMatchingListInMode + 79
> 11  com.apple.AppKit  0x7fff82ff2e70 _DPSNextEvent + 603
> 12  com.apple.AppKit  0x7fff82ff27b1 -[NSApplication 
> nextEventMatchingMask:untilDate:inMode:dequeue:] + 136
> 13  com.apple.AppKit  0x7fff82fec523 -[NSApplication run] 
> + 434
> 14  com.apple.AppKit  0x7fff82fb92f0 NSApplicationMain + 
> 373
> 15  com.gendaigames.GameSalad 0x00012290 start + 52

___

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: IKImageBrowserView Title & Subtitle Woes

2008-04-13 Thread thomas goossens

Hi Thaddeus,

To change the title attributes,  use setValue:forKey with the key  
"IKImageBrowserCellsTitleAttributesKey" and pass a dictionary that  
contains the text attributes.
To get the list of keys for the attribute dictionary see the section  
"standard attributes" of the following page:


http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/Reference/Reference.html

With attributes you can set the text alignment, line break mode, font,  
color...


NSMutableParagraphStyle *paragraphStyle = [[[NSMutableParagraphStyle  
alloc] init] autorelease];

[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
[paragraphStyle setAlignment:NSCenterTextAlignment];

NSMutableDictionary attributes = [[NSMutableDictionary alloc]  
initWithCapacity:3];	


[attributes setObject:[NSFont fontWithName:@"Lucida Grande" size:12]  
forKey:NSFontAttributeName];
[attributes setObject:paragraphStyle  
forKey:NSParagraphStyleAttributeName];	
[attributes setObject:[NSColor colorWithDeviceRed:0 green:0 blue:0  
alpha:1] forKey:NSForegroundColorAttributeName];
[_imageBrowser setValue:attributes  
forKey:IKImageBrowserCellsTitleAttributesKey];

[attributes release];

If you just want to change the color and keep other settings unchanged  
you can do this: (I never tried it but that should work ;)


NSDictionary *oldAttributes = [_imageBrowser valueForKey:  
IKImageBrowserCellsTitleAttributesKey];

NSMutableDictionary *newAttributres = [oldAttributes mutableCopy];
[attributes setObject:[NSColor colorWithDeviceRed:1 green:0 blue:0  
alpha:1] forKey:NSForegroundColorAttributeName];
[_imageBrowser setValue: newAttributres  
forKey:IKImageBrowserCellsTitleAttributesKey];

[newAttributres release];

-- Thomas.

On Apr 13, 2008, at 10:01 PM, Thaddeus Cooper wrote:


Hello all.

I am trying to set the color of the title and subtitle in an  
IKImageBrowserView. From what I see in the documentation I need to  
set up a dictionary with key-value pairs that describe the  
attributes of what I want to set it to. I have the snippet of code  
that I'm trying to use below:


		NSDictionary *titleTextInfo = [NSDictionary dictionaryWithObject: 
[CIColor colorWithRed:0.0 green:1.0 blue:0.0] forKey:@"titleColor"];
		[myBrowserView setValue:titleTextInfo  
forKey:IKImageBrowserCellsTitleAttributesKey];


What I can't figure out is what is the magic key for setting the  
color of the title and subtitle. I've tried: foregroundColor,  
ForegroundColor, color, Color, titleColor, TitleColor and probably a  
few others. I've also tried using both CIColor (as shown above) and  
NSColor. As far as I can tell from a search of the documentation the  
actual keys are not documented.


Any help would be greatly appreciated.

Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]


___

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: IKImageBrowserView Title & Subtitle Woes

2008-04-13 Thread Thaddeus Cooper

Thanks very much Thomas -- it works now :-)

Thaddeus O. Cooper
([EMAIL PROTECTED])



On Apr 13, 2008, at 1:50 PM, thomas goossens wrote:

Hi Thaddeus,

To change the title attributes,  use setValue:forKey with the key  
"IKImageBrowserCellsTitleAttributesKey" and pass a dictionary that  
contains the text attributes.
To get the list of keys for the attribute dictionary see the section  
"standard attributes" of the following page:


http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/Reference/Reference.html

With attributes you can set the text alignment, line break mode,  
font, color...


NSMutableParagraphStyle *paragraphStyle = [[[NSMutableParagraphStyle  
alloc] init] autorelease];

[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
[paragraphStyle setAlignment:NSCenterTextAlignment];

NSMutableDictionary attributes = [[NSMutableDictionary alloc]  
initWithCapacity:3];	


[attributes setObject:[NSFont fontWithName:@"Lucida Grande" size:12]  
forKey:NSFontAttributeName];
[attributes setObject:paragraphStyle  
forKey:NSParagraphStyleAttributeName];	
[attributes setObject:[NSColor colorWithDeviceRed:0 green:0 blue:0  
alpha:1] forKey:NSForegroundColorAttributeName];
[_imageBrowser setValue:attributes  
forKey:IKImageBrowserCellsTitleAttributesKey];

[attributes release];

If you just want to change the color and keep other settings  
unchanged you can do this: (I never tried it but that should work ;)


NSDictionary *oldAttributes = [_imageBrowser valueForKey:  
IKImageBrowserCellsTitleAttributesKey];

NSMutableDictionary *newAttributres = [oldAttributes mutableCopy];
[attributes setObject:[NSColor colorWithDeviceRed:1 green:0 blue:0  
alpha:1] forKey:NSForegroundColorAttributeName];
[_imageBrowser setValue: newAttributres  
forKey:IKImageBrowserCellsTitleAttributesKey];

[newAttributres release];

-- Thomas.

On Apr 13, 2008, at 10:01 PM, Thaddeus Cooper wrote:

Hello all.

I am trying to set the color of the title and subtitle in an  
IKImageBrowserView. From what I see in the documentation I need to  
set up a dictionary with key-value pairs that describe the  
attributes of what I want to set it to. I have the snippet of code  
that I'm trying to use below:


		NSDictionary *titleTextInfo = [NSDictionary dictionaryWithObject: 
[CIColor colorWithRed:0.0 green:1.0 blue:0.0] forKey:@"titleColor"];
		[myBrowserView setValue:titleTextInfo  
forKey:IKImageBrowserCellsTitleAttributesKey];


What I can't figure out is what is the magic key for setting the  
color of the title and subtitle. I've tried: foregroundColor,  
ForegroundColor, color, Color, titleColor, TitleColor and probably  
a few others. I've also tried using both CIColor (as shown above)  
and NSColor. As far as I can tell from a search of the  
documentation the actual keys are not documented.


Any help would be greatly appreciated.

Thanks very much.

Thaddeus O. Cooper
([EMAIL PROTECTED])



___

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/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]




___

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]


Updating IKImageBrowserView with Edited Image

2008-04-15 Thread Jamie Phelps
Hi, all. Does anyone know how I could go about updating the content of  
my IKImageBrowserView after editing an image in an IKImageView? So...


1) User has some images in an IKImageBrowserView.
2) User selects an image.
3) The selected image shows in an IKImageView
4) User edits the image (Adjust color, resize, crop, rotate, etc.)
5) User selects another image.
6) Edited image replaces old version in IKImageBrowserView
7) New image shows in IKImageView
8) Repeat 4-7

The idea is that the user would edit several images and then save them  
all when they've made all the edits. Currently, I have steps 1-5  
working, but when the selection changes, the edits are lost.


So far I don't see a delegate for the IKImageEditPanel to call when it  
is dismissed or any way to bind the image of the IKImageView to the  
selected item in the IKImageBrowserView. Does anyone have an idea how  
I could accomplish what I want to do? Am I missing something obvious  
or should I file this as an enhancement request?


Thanks,
Jamie
___

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]


IKImageBrowserView spacing and contextual menus

2008-04-19 Thread Yann Disser
Is there a way to change the spacing of the images in an  
IKImageBrowserView? In InterfaceBuilder?


How can I assign a right-click menu/contextual menu to an image  
browser view? Connection a NSMenu with the menu-outlet in  
InterfaceBuilder works for all of my views except the  
IKImageBrowserView.


Thanks,
Yann
___

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: Image reflection in IKImageBrowserView

2008-05-02 Thread Jens Alfke


On 1 May '08, at 11:57 PM, Aby wrote:

   How to implement Image reflection for all the images in  
IKImageBrowserView.


You can't make the view draw reflections; it's not very customizable  
at all.


The best you can do is give it images that already have reflections in  
them. Take each of your images, draw it into a larger image, draw the  
reflection below (using a y-flip transform and a mask with an alpha  
gradient), then put the larger image in the browser.


—Jens

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 [EMAIL PROTECTED]

Troubles with CollectionView and IKImageBrowserView

2008-06-11 Thread Manuel

Hello Macprogrammers

I've a problem with my IKImageBrowser in combination with a  
CollectionViewItem.


I have a NSWindow with a NSCollectionView and a NSArrayController. I  
extended the NSCollectionViewItem to reference the IKImageBrowserView  
in an outlet and use the NSCollectionViewItem as a Datasource for the  
IKImageBrowser (Connected together in Interface Builder):


NSWindows -> NSCollectionView (With NSArrayController) ->  
MYNSCollectionViewItem (as ControllerItem) -> NSViewItem ->  
IKImageBrowserView



In MyNSCollectionViewItem I've implemented following 2 Datasource  
Methods:


- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index

But the IKImageBrowserView doesn't call these methods. I setup a  
testmethod in the MYNSCollectionViewItem like the following code, to  
verify that the imagebrowser outlet is set and to set again the  
datasource:


- (IBAction)refreshView:(id)sender {
Album *representedObject = [self representedObject];
NSLog(@"UniqueData per row: %@", [representedObject uniqueData]);
[imageBrowser setDataSource:self];
[imageBrowser reloadData];
}

But even if i explicit set the IKImageBrowser DataSource to the  
MYNSCollectionViewItem the DataSource methods wouldn't be called by  
the IKImageViewBrowser. Do you know this problem? Outside the new  
CollectionView with a simple implementation, this code works very well.


Kind regards from Lucerne (Switzerland)




___

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]


IKImageBrowserView scrolling with core animation

2008-11-06 Thread Dan Treiman
I'm having some trouble with an IKImageBrowserView in a layer-backed  
NSScrollView.  Everything works fine when the scrollers are hidden,  
but as soon as I have too many images to fit in the view, it gets  
confused.  Specifically, when I scroll all the way to the bottom, I  
see my last row of images just fine.  But as I scroll upwards, more  
and more of the view gets clipped, when I get to the top, the view is  
empty.


I've tried turning off layer-backing, and it works perfectly - I only  
have the problem when layer-backing is on
(I'm calling [view setWantsLayer:YES] on an ancestor of the scroll  
view).  Is there anything I can do to fix this?


thanks,
-Dan Treiman
___

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: IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Florian Soenens
One more thing on this, if i bind an nstableview to my  
NSArrayController (to just display the path to the image object) the  
arrayController does reflect the changes, like so:


- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
NSLog([[arrayController selectionIndexes] description]);
}

The log displays different indexes like it should, so i assume that  
IKImageBrowserView could have a bug in it's bindings.


PS: is it enough to just bind the IKImageBrowserView to Controller Key  
@"arrangedObject" without a Model Key Path?


On 13 Nov 2008, at 10:29, Florian Soenens wrote:


Hi list,

i have an IKImageBrwoserView bound to an NSArrayController of objects.
The objects all conform to the IKImagebrowserItem protocol.

When running my application, all the images display correctly in the  
browser view, this al works fine, BUT:


In the IKImageBrowserDelegate, i implemented  
imageBrowserSelectionDidChange like this for testing purposes:

(I also have an IBOutlet to my NSArrayController)

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *)  
aBrowser

{
NSLog([[arrayController selectedIndex] description]);
}

The problem is that the NSArrayController always logs the same  
index, no mather what item i select in de BrowserView.

I assumed that it would always reflect the currently selected index.

I can fix it by doing this but i am not sure if this is the right  
way to go, or is it just a bug in IKImageBrowserView?


- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *)  
aBrowser

{
[arrayController setSelectionIndexes:[aBrower selectionIndexes]];
NSLog([[arrayController selectedIndex] description]);
}

Help would be much appreciated.
Thanks,
Florian.




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use  
by the addressee(s) named herein and may contain legally privileged  
and/or confidential information and/or information protected by  
intellectual property rights.
If you are not the intended recipient, please note that any review,  
dissemination, disclosure, alteration, printing, copying or  
transmission of this e-mail and/or any file transmitted with it, is  
strictly prohibited and may be unlawful.
If you have received this e-mail by mistake, please immediately  
notify the sender and permanently delete the original as well as any  
copy of any e-mail and any printout thereof.

We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem  
Belgium___


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/florian.soenens%40nss.be

This email sent to [EMAIL PROTECTED]




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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: IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Matt Gough


On 13 Nov 2008, at 11:25, Florian Soenens wrote:


NSLog([[arrayController selectionIndexes] description]);


Not related to your problem, but this style of NSLog has a potential  
pitfall if the description method were to return a string with any of  
the supported formatting sequences in it. It would be expecting other  
parameters to fill in the details.


The usual and simpler version would be:

NSLog(@"%@",  [arrayController selectionIndexes]);

(The %@ get replaced by the result of the supplied object's  
description method)


Matt Gough
___

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: IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Quincey Morris

On Nov 13, 2008, at 01:29, Florian Soenens wrote:

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *)  
aBrowser

{
NSLog([[arrayController selectedIndex] description]);
}

The problem is that the NSArrayController always logs the same  
index, no mather what item i select in de BrowserView.

I assumed that it would always reflect the currently selected index.


NSArrayController doesn't respond to 'selectedIndex' -- I think you  
mean 'selectionIndex'.


You should have got a compilation error for this. IAC, the index is an  
integer, not an object, so you couldn't have usefully sent a  
'description' message to it either.



___

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: IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Florian Soenens

I'm sorry, i was typing this out of my head in mail. Here's what i did:

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser
{
[arrayController setSelectionIndexes:[aBrower selectionIndexes]];
NSLog([[arrayController selectionIndexes] description]);
}

Any ideas?



On 13 Nov 2008, at 11:10, Quincey Morris wrote:


On Nov 13, 2008, at 01:29, Florian Soenens wrote:

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *)  
aBrowser

{
NSLog([[arrayController selectedIndex] description]);
}

The problem is that the NSArrayController always logs the same  
index, no mather what item i select in de BrowserView.

I assumed that it would always reflect the currently selected index.


NSArrayController doesn't respond to 'selectedIndex' -- I think you  
mean 'selectionIndex'.


You should have got a compilation error for this. IAC, the index is  
an integer, not an object, so you couldn't have usefully sent a  
'description' message to it either.



___

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/florian.soenens%40nss.be

This email sent to [EMAIL PROTECTED]




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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: IKImageBrowserView and mouseDragged event

2008-11-28 Thread douglas welton

Sandeep,

Did you set the dragging destination delegate using - 
setDraggingDestinationDelegate:?


more info here:

<http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_7.html#//apple_ref/doc/uid/TP40004907-CH5-SW8 
>


regards,

douglas

On Nov 28, 2008, at 1:12 AM, Sandeep Chayapathi wrote:


Greetings,
In my app I have an IKImageBrowserView, and I want to make this an  
drag

source. I have followed thedragging source
docs<http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976 
>

but
to no avail. In my view class the mouseDragged never gets called.  
Any help

on making the IKImageBrowserView a drag source or making it respond to
mouseDragged even is appreciated. Thanks.


-- Sandeep

___

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: IKImageBrowserView and mouseDragged event

2008-11-28 Thread Sandeep Chayapathi
I did try the  -setDraggingDestinationDelegate: , but it is meant for a drag
destination and not drag source. From the  documentation (here:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976-CJBFBADF
 )
I have to implement draggingSourceOperationMaskForLocal and invoke
dragImage:at:offset:event:pasteboard:source:slideBack:  in mouseDown: or
mouseDragged: methodto make it a drag source. I have a NSView subclass,
that is a delegate of the IKImageBrowserView view and have implemented the
methods above, yet these never get called.

Also I tried setting the class of the IKImageBrowserView object to my custom
class, only then would the - mouseDragged: even would work, but I lost a
bunch of other IKImageBrowserView features (such as cell selection etc).

-- Sandeep


On Fri, Nov 28, 2008 at 11:27 AM, douglas welton <
[EMAIL PROTECTED]> wrote:

> Sandeep,
>
> Did you set the dragging destination delegate using
> -setDraggingDestinationDelegate:?
>
> more info here:
>
> <
> http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_7.html#//apple_ref/doc/uid/TP40004907-CH5-SW8
> >
>
> regards,
>
> douglas
>
> On Nov 28, 2008, at 1:12 AM, Sandeep Chayapathi wrote:
>
>  Greetings,
>> In my app I have an IKImageBrowserView, and I want to make this an drag
>> source. I have followed thedragging source
>> docs<
>> http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976
>> >
>> but
>> to no avail. In my view class the mouseDragged never gets called. Any help
>> on making the IKImageBrowserView a drag source or making it respond to
>> mouseDragged even is appreciated. Thanks.
>>
>>
>> -- Sandeep
>>
>
___

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: IKImageBrowserView and mouseDragged event

2008-11-28 Thread Thomas Goossens

Sandeep,

If your datasource returns paths, your view should be automatically a  
drag source.
If your datasource returns images, I think the only thing you have to  
do is to implement


- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser  
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard;


in your datasource and fill the pasteboard with the info you want for  
the specified indexes.


more info here:
http://developer.apple.com/documentation/GraphicsImaging/Reference/IKImageBrowserDataSource_Protocol/IKImageBrowserDataSource_Reference.html#//apple_ref/occ/instm/NSObject/imageBrowser:writeItemsAtIndexes:toPasteboard:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_6.html

-- Thomas.


On Nov 28, 2008, at 11:57 AM, Sandeep Chayapathi wrote:

I did try the  -setDraggingDestinationDelegate: , but it is meant  
for a drag

destination and not drag source. From the  documentation (here:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976-CJBFBADF
)
I have to implement draggingSourceOperationMaskForLocal and invoke
dragImage:at:offset:event:pasteboard:source:slideBack:  in  
mouseDown: or
mouseDragged: methodto make it a drag source. I have a NSView  
subclass,
that is a delegate of the IKImageBrowserView view and have  
implemented the

methods above, yet these never get called.

Also I tried setting the class of the IKImageBrowserView object to  
my custom
class, only then would the - mouseDragged: even would work, but I  
lost a
bunch of other IKImageBrowserView features (such as cell selection  
etc).


-- Sandeep


On Fri, Nov 28, 2008 at 11:27 AM, douglas welton <
[EMAIL PROTECTED]> wrote:


Sandeep,

Did you set the dragging destination delegate using
-setDraggingDestinationDelegate:?

more info here:

<
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_7.html#//apple_ref/doc/uid/TP40004907-CH5-SW8




regards,

douglas

On Nov 28, 2008, at 1:12 AM, Sandeep Chayapathi wrote:

Greetings,
In my app I have an IKImageBrowserView, and I want to make this an  
drag

source. I have followed thedragging source
docs<
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/2976



but
to no avail. In my view class the mouseDragged never gets called.  
Any help
on making the IKImageBrowserView a drag source or making it  
respond to

mouseDragged even is appreciated. Thanks.


-- Sandeep




___

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/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]


___

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: IKImageBrowserView and mouseDragged event

2008-11-28 Thread douglas welton

Sandeep,

Sorry, I misread your question.

I have an application that implements dragging from an  
IKImageBrowserView and when I was testing it initially, I experienced  
a similar issue (no dragging being initiated on mouse down) when I  
forgot to connect the datasource outlet on my IKImageBrowserView.


regards,

douglas

On Nov 28, 2008, at 11:57 AM, Sandeep Chayapathi wrote:

I did try the  -setDraggingDestinationDelegate: , but it is meant  
for a drag

destination and not drag source. From the  documentation (here:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#/ 
/apple_ref/doc/uid/2976-CJBFBADF

)
I have to implement draggingSourceOperationMaskForLocal and invoke
dragImage:at:offset:event:pasteboard:source:slideBack:  in  
mouseDown: or
mouseDragged: methodto make it a drag source. I have a NSView  
subclass,
that is a delegate of the IKImageBrowserView view and have  
implemented the

methods above, yet these never get called.

Also I tried setting the class of the IKImageBrowserView object to  
my custom
class, only then would the - mouseDragged: even would work, but I  
lost a
bunch of other IKImageBrowserView features (such as cell selection  
etc).


-- Sandeep


On Fri, Nov 28, 2008 at 11:27 AM, douglas welton <
[EMAIL PROTECTED]> wrote:


Sandeep,

Did you set the dragging destination delegate using
-setDraggingDestinationDelegate:?

more info here:

<
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_7.html#/ 
/apple_ref/doc/uid/TP40004907-CH5-SW8




regards,

douglas

On Nov 28, 2008, at 1:12 AM, Sandeep Chayapathi wrote:

Greetings,
In my app I have an IKImageBrowserView, and I want to make this an  
drag

source. I have followed thedragging source
docs<
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#/ 
/apple_ref/doc/uid/2976



but
to no avail. In my view class the mouseDragged never gets called.  
Any help
on making the IKImageBrowserView a drag source or making it  
respond to

mouseDragged even is appreciated. Thanks.


-- Sandeep




___

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/douglas_welton%40earthlink.net

This email sent to [EMAIL PROTECTED]


___

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]


IKImageBrowserView and the View Hierarchy

2008-12-28 Thread Jeffrey J. Early
I have had a number of troubles with IKImageBrowserView not respecting  
other views trying to draw over the top of it. I have worked around  
some of the issues, but this latest I can't seem to resolve.


I am trying to "dim" several of the views in my window by simply  
placing a translucent view over the top of them. This works as  
expected, *except* for the IKImageBrowserView... it always "shines  
through" and appears to be the top-most view.


I did find that if I force the translucent view to be layer backed by - 
setWantLayer:YES, then the *background* of the IKImageBrowserView  
becomes appropriately dimmed, but the loaded images just disappear!


This is *almost* repeatable with zero lines of code just using  
Interface Builder. You can drag an instance of IKImageBrowserView on a  
new window, then try to overlay another view, like an ImageWell or  
something. You'll see that the ImageWell is always below the  
IKImageBrowserView unless you tell it to be layer backed (although the  
layer-backing trick doesn't work in the simulator).


What's going on here? IKImageBrowserView is clearly doing something  
fancy -- any ideas what that is and how I can get it to behave like a  
normal NSView?


Thanks,
Jeffrey
___

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


Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Florian Soenens
Hi list,

i'm trying to override an IKImageBrowserView to do some custom drawing but i'm 
stuck.
What i try to accomplish is that when the view contains zero items, some custom 
drawing happens like drawing an NSAttributedString that says "Drop items 
here..."
Problem is that my drawing code gets never called.

Here's the drawRect method of my IKImageBrowserView:

- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];

NSUInteger numItems = [[self dataSource] 
numberOfItemsInImageBrowser:self];

if(numItems <= 0)
{
NSLog(@"No items in me"); // This gets called, so i'm sure the 
above code works

NSRect bounds = [self bounds];
bounds.size.width = 200;
bounds.size.height = 200;
bounds.origin.x += 200;
bounds.origin.y += 200;

//[NSGraphicsContext saveGraphicsState];

[[NSColor yellowColor] set]; // Just for testing purposes
NSRectFill(bounds);

//[NSGraphicsContext restoreGraphicsState];
}
}

Uncommenting the NSGrahicsContext doesn't help either.

Anyone has any ideas or workarounds for this?
Thanks in advance,
Florian
___

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


Animation layer conflict w/ IKImageBrowserView

2008-08-14 Thread Robert McCullough
Does anyone know why an IKImageBrowserView won't draw if its SUPERVIEW  
has a Core Animation layer? NOTHING appears in the image browser view  
-- not even a white background.


I'm enabling the CA layer on the superview using "setWantsLayer:YES".  
As soon as I remove that line, the image browser starts working  
correctly. I'm guessing that the IKImageBrowserView has its own  
animation layer that's conflicting with the super's animation layer(?)


Any ideas how to get around this conflict?
___

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: IKImageBrowserView only horizontal scrolling

2008-10-27 Thread Thomas Goossens

Hi Ralph,

Use setContentResizingMask: with NSViewWidthSizable so that the  
IKImageBrowserView resizes its content horizontally when zooming/ 
resizing...


-- Thomas

On Oct 27, 2008, at 2:06 PM, Ralph Manns wrote:


Hello,
is there a away to limit the number of rows to 1, so that  
IKImageBrowserView

scrolls only horizontal ?

Ralph
___

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/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]


___

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: IKImageBrowserView only horizontal scrolling

2008-10-27 Thread Ralph Manns
Hello Thomas,
thanks you, works great.
The documentation says setContentResizingMask determines how the receiver
resize its content when zooming...

Thanks, Ralph.

2008/10/27 Thomas Goossens <[EMAIL PROTECTED]>

> Hi Ralph,
>
> Use setContentResizingMask: with NSViewWidthSizable so that the
> IKImageBrowserView resizes its content horizontally when zooming/resizing...
> -- Thomas
>
> On Oct 27, 2008, at 2:06 PM, Ralph Manns wrote:
>
> Hello,
> is there a away to limit the number of rows to 1, so that
> IKImageBrowserView
> scrolls only horizontal ?
>
> Ralph
> ___
>
> 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/tgoossens%40mac.com
>
> This email sent to [EMAIL PROTECTED]
>
>
>
___

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]


reloading IKImageBrowserView in an IBAction

2009-02-23 Thread Claus Guttesen
Hi.

I followed the excellent article 'Image Kit Programming Guide' at
http://developer.apple.com/documentation/graphicsimaging/Conceptual/ImageKitProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004907-CH1-SW1
and have my ImageBrowser working. I want to use it as the basis of an
image-uploader and would like to visualize the upload-progress by
removing the first image. I have connected a button to an IBAction and
can remove the images one by one.

- (IBAction)listImagesButtonClicked:(id)sender {
NSUInteger n;
NSArray *myArray;

if ( [mImages count] > 0 ) {
myArray = [mImages objectAtIndex:0];
NSLog(@"%@", [myArray description]);
[mImages removeObjectAtIndex:0];
[mImageBrowser reloadData];
n = [mImages count];
[numberOfImagesOutputField setIntValue:n];
//  sleep(1);
}
}

[mImages removeObjectAtIndex:0] removes the first image and
[mImageBrowser reloadData] animates it.

I changed the 'if' to a 'while' but it doesn't animate removals one by
one but is waiting with [mImageBrowser reloadData] until all images
are removed (perhaps IBAction blocks it?) and remove all images at
once.

How can I make the [mImageBrowser reloadData] refresh within the while-loop?

-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare
___

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


reloading IKImageBrowserView in an IBAction

2009-03-01 Thread Claus Guttesen
Hi.

I read the excellent article 'Image Kit Programming Guide' at
http://developer.apple.com/documentation/graphicsimaging/Conceptual/ImageKitProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004907-CH1-SW1
and have my ImageBrowser working. I want to use it as the basis of an
image-uploader and would like to visualize the upload-progress by
removing the first image. I have connected a button to an IBAction and
can remove the images one by one.

- (IBAction)listImagesButtonClicked:(id)sender {
       NSUInteger n;
       NSArray *myArray;

       if ( [mImages count] > 0 ) {
               myArray = [mImages objectAtIndex:0];
               NSLog(@"%@", [myArray description]);
               [mImages removeObjectAtIndex:0];
               [mImageBrowser reloadData];
               n = [mImages count];
               [numberOfImagesOutputField setIntValue:n];
//              sleep(1);
       }
}

[mImages removeObjectAtIndex:0] removes the first image and
[mImageBrowser reloadData] animates it.

I changed the 'if' to a 'while' but it doesn't animate removals one by
one but is waiting with [mImageBrowser reloadData] until all images
are removed (perhaps IBAction blocks it?) and remove all images at
once.

How can I make the [mImageBrowser reloadData] refresh within the while-loop?

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare



-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare
___

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


IKImageBrowserView is not reloading data.

2009-05-11 Thread Kenny Carruthers

Hi,

Given an IKImageBrowserView that is populated with valid  
IKImageBrowserItem, calling 'reloadData' on the image browser view  
does not actually reload the data for me. The documentation says that  
it "Marks the receiver as needing its data reloaded" but how and when  
does the reload actually take place?


My application is a Core Data application and I initially thought the  
problem was related to bindings and updating of the managed object  
behind the image views back, but then I came across the sample code at  
apple.dev and realized that the problem still existed:


http://developer.apple.com/samplecode/IKImageBrowserViewWithCoreData

So then I boiled it down to the most basic scenario I could think of  
and the problem still exists. I can trigger this "bug" with something  
as simple as an image view backed by data source that just returns  
IKImageBrowserItem, who's imageRepresentationType is  
IKImageBrowserPathRepresentationType and who's imageRepresentation is  
just a path on the local file system.


The following is reproducible for me. Hopefully I'm just missing  
something obvious. Comments are welcome.


1. Launch application
2. Populate image browser view with two items who return 'nil' when  
asked for their imageRepresentation. (ImageBrowser will correctly show  
the empty box for each.)
3. Click on a button that simply calls a method that assigns a valid  
path to each item. (The path represents an image on the disk.)
4. Call reloadData on the image browser and the empty boxes will  
correctly be replaced with the appropriate images.
5. Now, replace each items path with another valid path on the  
filesystem that points to a different photo.

6. Call reloadData.
7. This time, the images are not updated.

In fact, no matter what I seem to do, the only time I can actually get  
the image browser to reload the data is when the items don't return a  
valid imageRepresentation. All other times, the image browser view  
seems to ignore my requests for a reload, and doesn't even call any of  
the IKImageBrowserItem methods at all. (Though it does if the items  
are initially nill).


So, if the image browser view is already populated with valid items,  
the reload appears to fail for me. If the image browser view is  
populated with items that have an invalid imageRepresentation, the  
reload appears to work.


Thoughts?

Sincerely,
Kenny
___

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: IKImageBrowserView setSelectionIndex not selecting

2009-06-22 Thread Graham Cox


On 23/06/2009, at 10:08 AM, Richard Gutierrez wrote:

I have been researching extensively on how to set an  
IKImageBrowserView's initial selection upon load to 0 index. Here is  
the call I am making:


[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0]  
byExtendingSelection:NO];


Seems like the IKImageBrowserView is not fully loaded when the call  
is made, however, I do have an IKImageView which is selecting and  
loading the first object in the ImageBrowserView's object list  
correctly mat the same time I am calling the same time. Here is the  
entire call:


- (void)updateDatasource



Where do you call this from?

You'll need to call it from -awakeFromNib to ensure the view is loaded.

--Graham


___

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: IKImageBrowserView setSelectionIndex not selecting

2009-06-25 Thread Richard Gutierrez
I did place this in the awakeFromNib... I also tried placing it in 
"updateDatasource",  "addImagesWithPath", and "addImagesWithPaths". All of the 
calls do not work. Here is my awakeFromNib code:

- (void)awakeFromNib {
images = [[NSMutableArray alloc] init];
importedImages = [[NSMutableArray alloc] init];

[imageBrowser setAllowsReordering:YES];
[imageBrowser setAnimates:YES];
[imageBrowser setDraggingDestinationDelegate:self];
[imageBrowser setCellsStyleMask:IKCellsStyleOutlined | IKCellsStyleShadowed 
| IKCellsStyleTitled];
[imageBrowser setAllowsMultipleSelection:NO];
[imageBrowser setAllowsEmptySelection:NO];
[self populatePUB:nil];

NSDictionary *dict = [[NSBundle mainBundle] infoDictionary];
NSString *url = [dict objectForKey:@"MPStockImagesURL"];
NSArray* path = [NSArray arrayWithObject:url];
if (path) {
[NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) 
toTarget:self withObject:path];
}
[imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] 
byExtendingSelection:NO];
}

Any ideas??

On 6/22/09 7:51 PM, "Graham Cox"  wrote:



On 23/06/2009, at 10:08 AM, Richard Gutierrez wrote:

> I have been researching extensively on how to set an
> IKImageBrowserView's initial selection upon load to 0 index. Here is
> the call I am making:
>
> [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0]
> byExtendingSelection:NO];
>
> Seems like the IKImageBrowserView is not fully loaded when the call
> is made, however, I do have an IKImageView which is selecting and
> loading the first object in the ImageBrowserView's object list
> correctly mat the same time I am calling the same time. Here is the
> entire call:
>
> - (void)updateDatasource


Where do you call this from?

You'll need to call it from -awakeFromNib to ensure the view is loaded.

--Graham




___

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: IKImageBrowserView setSelectionIndex not selecting

2009-06-25 Thread Ramakrishna Vavilala
You need to call [imageBrowser reloadData]. When you call
setSelectionIndexes there need to be items in the list calling
reloadData will ensure that there are items.

On Thu, Jun 25, 2009 at 12:19 PM, Richard
Gutierrez wrote:
> I did place this in the awakeFromNib... I also tried placing it in 
> "updateDatasource",  "addImagesWithPath", and "addImagesWithPaths". All of 
> the calls do not work. Here is my awakeFromNib code:
>
> - (void)awakeFromNib {
>    images = [[NSMutableArray alloc] init];
>    importedImages = [[NSMutableArray alloc] init];
>
>    [imageBrowser setAllowsReordering:YES];
>    [imageBrowser setAnimates:YES];
>    [imageBrowser setDraggingDestinationDelegate:self];
>    [imageBrowser setCellsStyleMask:IKCellsStyleOutlined | 
> IKCellsStyleShadowed | IKCellsStyleTitled];
>    [imageBrowser setAllowsMultipleSelection:NO];
>    [imageBrowser setAllowsEmptySelection:NO];
>    [self populatePUB:nil];
>
>    NSDictionary *dict = [[NSBundle mainBundle] infoDictionary];
>    NSString *url = [dict objectForKey:@"MPStockImagesURL"];
>    NSArray* path = [NSArray arrayWithObject:url];
>    if (path) {
>        [NSThread detachNewThreadSelector:@selector(addImagesWithPaths:) 
> toTarget:self withObject:path];
>    }
>    [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] 
> byExtendingSelection:NO];
> }
>
> Any ideas??
>
> On 6/22/09 7:51 PM, "Graham Cox"  wrote:
>
>
>
> On 23/06/2009, at 10:08 AM, Richard Gutierrez wrote:
>
>> I have been researching extensively on how to set an
>> IKImageBrowserView's initial selection upon load to 0 index. Here is
>> the call I am making:
>>
>> [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0]
>> byExtendingSelection:NO];
>>
>> Seems like the IKImageBrowserView is not fully loaded when the call
>> is made, however, I do have an IKImageView which is selecting and
>> loading the first object in the ImageBrowserView's object list
>> correctly mat the same time I am calling the same time. Here is the
>> entire call:
>>
>> - (void)updateDatasource
>
>
> Where do you call this from?
>
> You'll need to call it from -awakeFromNib to ensure the view is loaded.
>
> --Graham
>
>
>
>
> ___
>
> 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/vrk.lists%40gmail.com
>
> This email sent to vrk.li...@gmail.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: IKImageBrowserView setSelectionIndex not selecting

2009-06-25 Thread Graham Cox


On 26/06/2009, at 2:19 AM, Richard Gutierrez wrote:


 NSArray* path = [NSArray arrayWithObject:url];
   if (path) {
   [NSThread  
detachNewThreadSelector:@selector(addImagesWithPaths:) toTarget:self  
withObject:path];

   }
   [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex: 
0] byExtendingSelection:NO];



My guess is that there's nothing to select, because you are loading  
images in a second thread, and at the time setSelectionIndexes is  
called, the thread hasn't managed to load even the first image yet.


You'll need to arrange for the thread to tell the main thread when it  
has done some work so that the first thread can perform the selection.


--Graham


___

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: IKImageBrowserView only horizontal scrolling

2009-07-15 Thread arri
Hi,

This tip looks simple enough, and it works to a certain extent.
But moving the scaling-slider or resizing the window, results in very
buggy display for me.

This is both the case with my own prototype app, as with apple's Image
Browser example code (set to use NSViewWidthSizable).

Two screenshots:

- normal, seems to work: http://arri.pulsecode.org/dump/IKImageBrowserView1.png
- after moving the scale-slider or window resizing:
http://arri.pulsecode.org/dump/IKImageBrowserView2.png

Am i doing something wrong? or is this a bug?



thanks,
arri


On Mon, Oct 27, 2008 at 4:41 PM, Ralph Manns wrote:
> Hello Thomas,
> thanks you, works great.
> The documentation says setContentResizingMask determines how the receiver
> resize its content when zooming...
>
> Thanks, Ralph.
>
> 2008/10/27 Thomas Goossens 
>
>> Hi Ralph,
>>
>> Use setContentResizingMask: with NSViewWidthSizable so that the
>> IKImageBrowserView resizes its content horizontally when zooming/resizing...
>> -- Thomas
>>
>> On Oct 27, 2008, at 2:06 PM, Ralph Manns wrote:
>>
>> Hello,
>> is there a away to limit the number of rows to 1, so that
>> IKImageBrowserView
>> scrolls only horizontal ?
>>
>> Ralph
>> ___
>>
>> 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/tgoossens%40mac.com
>>
>> This email sent to tgooss...@mac.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/arritjeparretjenof%40gmail.com
>
> This email sent to arritjeparretje...@gmail.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: IKImageBrowserView only horizontal scrolling

2009-07-15 Thread Thomas Goossens

Hi Arri,

This is a bug (fixed on SnowLeopard).
On Leopard, when the content resizing mask is set to  
NSViewWidthSizable (for banners typically) only layouts with a single  
row are supported.


-- Thomas


On Jul 15, 2009, at 7:05 PM, arri wrote:


Hi,

This tip looks simple enough, and it works to a certain extent.
But moving the scaling-slider or resizing the window, results in very
buggy display for me.

This is both the case with my own prototype app, as with apple's Image
Browser example code (set to use NSViewWidthSizable).

Two screenshots:

- normal, seems to work: http://arri.pulsecode.org/dump/IKImageBrowserView1.png
- after moving the scale-slider or window resizing:
http://arri.pulsecode.org/dump/IKImageBrowserView2.png

Am i doing something wrong? or is this a bug?



thanks,
arri


On Mon, Oct 27, 2008 at 4:41 PM, Ralph Manns wrote:

Hello Thomas,
thanks you, works great.
The documentation says setContentResizingMask determines how the  
receiver

resize its content when zooming...

Thanks, Ralph.

2008/10/27 Thomas Goossens 


Hi Ralph,

Use setContentResizingMask: with NSViewWidthSizable so that the
IKImageBrowserView resizes its content horizontally when zooming/ 
resizing...

-- Thomas

On Oct 27, 2008, at 2:06 PM, Ralph Manns wrote:

Hello,
is there a away to limit the number of rows to 1, so that
IKImageBrowserView
scrolls only horizontal ?

Ralph
___

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/tgoossens%40mac.com

This email sent to tgooss...@mac.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/arritjeparretjenof%40gmail.com

This email sent to arritjeparretje...@gmail.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/tgoossens%40mac.com

This email sent to tgooss...@mac.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: IKImageBrowserView only horizontal scrolling

2009-07-15 Thread arri
Thomas,

Thanks for the fast respons!
Saves a lot of headaches.

.arri

On Wed, Jul 15, 2009 at 7:23 PM, Thomas Goossens wrote:
> Hi Arri,
>
> This is a bug (fixed on SnowLeopard).
> On Leopard, when the content resizing mask is set to NSViewWidthSizable (for
> banners typically) only layouts with a single row are supported.
>
> -- Thomas
>
>
> On Jul 15, 2009, at 7:05 PM, arri wrote:
>
>> Hi,
>>
>> This tip looks simple enough, and it works to a certain extent.
>> But moving the scaling-slider or resizing the window, results in very
>> buggy display for me.
>>
>> This is both the case with my own prototype app, as with apple's Image
>> Browser example code (set to use NSViewWidthSizable).
>>
>> Two screenshots:
>>
>> - normal, seems to work:
>> http://arri.pulsecode.org/dump/IKImageBrowserView1.png
>> - after moving the scale-slider or window resizing:
>> http://arri.pulsecode.org/dump/IKImageBrowserView2.png
>>
>> Am i doing something wrong? or is this a bug?
>>
>>
>>
>> thanks,
>> arri
>>
>>
>> On Mon, Oct 27, 2008 at 4:41 PM, Ralph Manns wrote:
>>>
>>> Hello Thomas,
>>> thanks you, works great.
>>> The documentation says setContentResizingMask determines how the receiver
>>> resize its content when zooming...
>>>
>>> Thanks, Ralph.
>>>
>>> 2008/10/27 Thomas Goossens 
>>>
>>>> Hi Ralph,
>>>>
>>>> Use setContentResizingMask: with NSViewWidthSizable so that the
>>>> IKImageBrowserView resizes its content horizontally when
>>>> zooming/resizing...
>>>> -- Thomas
>>>>
>>>> On Oct 27, 2008, at 2:06 PM, Ralph Manns wrote:
>>>>
>>>> Hello,
>>>> is there a away to limit the number of rows to 1, so that
>>>> IKImageBrowserView
>>>> scrolls only horizontal ?
>>>>
>>>> Ralph
>>>> ___
>>>>
>>>> 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/tgoossens%40mac.com
>>>>
>>>> This email sent to tgooss...@mac.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/arritjeparretjenof%40gmail.com
>>>
>>> This email sent to arritjeparretje...@gmail.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/tgoossens%40mac.com
>>
>> This email sent to tgooss...@mac.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


Weird issues with IKImageBrowserView reloaddata

2009-08-18 Thread Alexander Griekspoor
Hi,

I'm seeing some weird things reloading the data in my
IKImageBrowserView in my GC collected, Leopard app. Basically
depending on how I change the contents of my "filteredItems"
NSMutableArray I get a different loading behaviour.

If I refresh the contents like this the IKImageBrowserView seems to
ignore the imageUID and reload everything again:

[self.filteredItems setArray: self.prefilteredItems];
[imageBrowserView reloadData];

while if I do the much more elaborat following it seems to reuse
everything properly and doesn't do the weird reloading of everything:

NSMutableArray *array = [NSMutableArray arrayWithCapacity:
[self.filteredItems count]];
for(id obj in self.filteredItems){
if(![self.prefilteredItems containsObject: obj])[array 
addObject: obj];
}
[self.filteredItems removeObjectsInArray: array];

for(id obj in self.prefilteredItems){
if(![self.filteredItems containsObject: obj])[self.filteredItems
addObject: obj];
}

Any idea why this is? How come the imagebrowserview seems to monitor
my mutablearray?
Also, any tips on how to solve the issue, or a workaround? The above
one is (too) slow.

I have done everything accoding to the ImageKit demo, including
implementing imageUID in my model object, and implementing the
delegates as follows:

- (NSInteger)numberOfItemsInImageFlow:(IKImageFlowView*)view{
return [filteredItems count];
}

- (id)imageFlow:(IKImageFlowView *) view itemAtIndex:(NSInteger) index{ 
return [filteredItems objectAtIndex:index];
}

Thanks,
Alex
-- 


 ** Alexander Griekspoor  PhD **

  mekentosj.com

 Papers - Your Personal Library of Science
 2007 Winner of the Apple Design Awards
 Best Mac OS X Scientific Solution
 http://www.mekentosj.com/papers

___

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


IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Dear All,

Im using a IKImageBrowserView and trying to implement D&D. The image object I'm 
using is of IKImageBrowserNSDataRepresentationType. If I use 
IKImageBrowserPathRepresentationType D&D works fine.

But with IKImageBrowserNSDataRepresentationType none of the delegates methods 
gets called:

- (NSDragOperation)draggingEntered:(id )sender
- (NSDragOperation)draggingUpdated:(id )sender
- (BOOL) performDragOperation:(id )sender

I've tried 

IKImageBrowserView  -> registerForDraggedTypes:[NSArray arrayWithObject: 
NSFilesPromisePboardType]

To no avail. Any help as to which direction to take would be great.

Thanks
___

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


Odd issue causing IKImageBrowserView to crash?

2008-03-14 Thread Scott.D.R

Greetings everyone.
I am writing an application using IKImageBrowserView. I wrote a  
NSMutableArray object to hold the source images which reaches about  
500-700 regularly in number.
First, I used some code to generate the images. Then I told the  
IKImagebrowserView to reload the datasource, my application crashed.  
And the console ouputed:
 *** -[IKImageCellDatasourceProxy copyWithZone:]: unrecognized  
selector sent to instance 0x11558400
 *** -[IKImageCellDatasourceProxy copyWithZone:]: unrecognized  
selector sent to instance 0x11558400


I tried to reduce the number of images to 30-50, the application run  
perfectly. After restored to 500-700, it crashed again.


Can anyone tell me what is the source of this issue, and how to solve  
it?

Thank you very much for any guidance.

Best regards.

___

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]


How to use bindings with IKImageBrowserView?

2008-04-03 Thread Steve Weller


I am attempting to use bindings to supply an IKImageBrowserView with  
data. I have successfully used IKImageBrowserView with a data source,  
but cannot get bindings to work. Should it work with bindings?


The array controller's contentArray is hooked up to an NSMutableArray  
called storedImages. That contains instances of storedImage. And those  
have a method browserObject that returns instances of an object that  
implements the IKBrowerItem protocol to fetch and display an image  
(uid, path, etc).


The Image Kit browser is bound to the array controller's arranged  
objects with the model key path browserObject. It is set to  
automatically prepare content.


I get no images displayed even though there are plenty in the  
storedImages array. I am telling the browser view to reload its data.


If I set a breakpoint at browserObject, it is never hit. So it looks  
like the array controller is never attempting to read my model. I get  
no errors when loading my nib.



--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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 [EMAIL PROTECTED]


Re: IKImageBrowserView spacing and contextual menus

2008-04-19 Thread thomas goossens

Hi Yann,

On Apr 19, 2008, at 10:51 AM, Yann Disser wrote:

Is there a way to change the spacing of the images in an  
IKImageBrowserView? In InterfaceBuilder?


No, the only thing you can do to impact the cell-spacing is to use  
setCellSize and give a non square size (a size taller than larger=>  
more vertical spacing, a size larger than taller => more horizontal  
spacing).


How can I assign a right-click menu/contextual menu to an image  
browser view? Connection a NSMenu with the menu-outlet in  
InterfaceBuilder works for all of my views except the  
IKImageBrowserView.


I don't know using InterfaceBuilder but programmatically I'm using the  
optional delegate methods :


- (void) imageBrowser:(IKImageBrowserView *) aBrowser  
cellWasRightClickedAtIndex:(NSUInteger) index withEvent:(NSEvent *)  
event

and
- (void) imageBrowser:(IKImageBrowserView *) aBrowser  
backgroundWasRightClickedWithEvent:(NSEvent *) event


to manage contextual menus.

For instance to add a contextual menu on a given item:

- (void) imageBrowser:(IKImageBrowserView *) aBrowser  
cellWasRightClickedAtIndex:(NSUInteger) index withEvent:(NSEvent *)  
event

{
//contextual menu for item index
NSMenu* menu;

menu = [[NSMenu alloc] initWithTitle:@"menu"];
[menu setAutoenablesItems:NO];

	[menu addItemWithTitle:[NSString stringWithFormat:@"Open"] action: 
[...] keyEquivalent:@""];
	[menu addItemWithTitle:[NSString stringWithFormat:@"Get Info"] action: 
[...] keyEquivalent:@""];


[NSMenu popUpContextMenu:menu withEvent:event forView:aBrowser];

[menu release];
}


-- Thomas.





Thanks,
Yann
___

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/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]


___

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: Troubles with CollectionView and IKImageBrowserView

2008-06-11 Thread Jens Alfke


On 11 Jun '08, at 1:14 PM, Manuel wrote:

But the IKImageBrowserView doesn't call these methods. I setup a  
testmethod in the MYNSCollectionViewItem like the following code, to  
verify that the imagebrowser outlet is set and to set again the  
datasource:


Hm, I don't have any exact ideas, but I wonder if something's going  
wrong because CollectionViewItems get copied. (The one you wire up in  
the nib is a prototype, and the view makes a copy of it for every item  
it needs.) Perhaps the item is getting set as the image-browser's data  
source before the copy, so the instance being displayed isn't actually  
the one that's the data source?


—Jens

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 [EMAIL PROTECTED]

Re: Troubles with CollectionView and IKImageBrowserView

2008-06-11 Thread Manuel
Thank you for your response...Hmmm..I'm astonished about the  
IKImageBrowserView outlet wich seems to be set correctly. And I  
explicitly setted the datasource to self and reload the data. So the  
object reference should be setted correctly...I have no ideas anymore.  
I programm my own view with less magic..;-)


Manu


On Jun 12, 2008, at 00:25 , Jens Alfke wrote:



On 11 Jun '08, at 1:14 PM, Manuel wrote:

But the IKImageBrowserView doesn't call these methods. I setup a  
testmethod in the MYNSCollectionViewItem like the following code,  
to verify that the imagebrowser outlet is set and to set again the  
datasource:


Hm, I don't have any exact ideas, but I wonder if something's going  
wrong because CollectionViewItems get copied. (The one you wire up  
in the nib is a prototype, and the view makes a copy of it for every  
item it needs.) Perhaps the item is getting set as the image- 
browser's data source before the copy, so the instance being  
displayed isn't actually the one that's the data source?


—Jens


___

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: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Daniel Vollmer


On Jun 12, 2008, at 00:25, Jens Alfke wrote:



On 11 Jun '08, at 1:14 PM, Manuel wrote:

But the IKImageBrowserView doesn't call these methods. I setup a  
testmethod in the MYNSCollectionViewItem like the following code,  
to verify that the imagebrowser outlet is set and to set again the  
datasource:


Hm, I don't have any exact ideas, but I wonder if something's going  
wrong because CollectionViewItems get copied. (The one you wire up  
in the nib is a prototype, and the view makes a copy of it for every  
item it needs.) Perhaps the item is getting set as the image- 
browser's data source before the copy, so the instance being  
displayed isn't actually the one that's the data source?


Jens is right in that copying the collection view is often a problem,  
as NSView does not support the NSCopying protocol. There's some more  
information on the way that NSCollectionView copies the view here:http://www.cocoadev.com/index.pl?NSCollectionView 
 (near the bottom).


I got it working like this:
- put your custom view initialisation in initWithCoder: (as that is  
the one used to copy the original instance / unarchive your nib)
- in your view, have an IBOutlet that's connected to the  
NSCollectionViewItem instance (called cvItem in my case)
- in awakeFromNib bind the properties you're interested in (as these  
get restored / set correctly in the cloning process), e.g.

- (void)awakeFromNib
{
	[self bind:@"plotRoot" toObject:cvItem  
withKeyPath:@"representedObject" options:nil];
	[self bind:@"isSelected" toObject:cvItem withKeyPath:@"selected"  
options:nil];

}

This setup works fine for me (ignoring the other known bugs and  
documentation deficiencies of NSCollectionView — it's slightly  
disheartening when you file a bug on it, get a dup back and realise  
it's been known long enough for 1094954 other bugs to be filled..).


HTH,
Daniel.___

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: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Jens Alfke



Begin forwarded message:


From: Daniel Vollmer <[EMAIL PROTECTED]>
Date: 12 June, 2008 12:18:41 AM PDT
To: Jens Alfke <[EMAIL PROTECTED]>
Subject: Re: Troubles with CollectionView and IKImageBrowserView


On Jun 12, 2008, at 00:25, Jens Alfke wrote:



On 11 Jun '08, at 1:14 PM, Manuel wrote:

But the IKImageBrowserView doesn't call these methods. I setup a  
testmethod in the MYNSCollectionViewItem like the following code,  
to verify that the imagebrowser outlet is set and to set again the  
datasource:


Hm, I don't have any exact ideas, but I wonder if something's going  
wrong because CollectionViewItems get copied. (The one you wire up  
in the nib is a prototype, and the view makes a copy of it for  
every item it needs.) Perhaps the item is getting set as the image- 
browser's data source before the copy, so the instance being  
displayed isn't actually the one that's the data source?


Jens is right in that copying the collection view is often a  
problem, as NSView does not support the NSCopying protocol. There's  
some more information on the way that NSCollectionView copies the  
view here: http://www.cocoadev.com/index.pl?NSCollectionView (near  
the bottom).


I got it working like this:
- put your custom view initialisation in initWithCoder: (as that is  
the one used to copy the original instance / unarchive your nib)
- in your view, have an IBOutlet that's connected to the  
NSCollectionViewItem instance (called cvItem in my case)
- in awakeFromNib bind the properties you're interested in (as these  
get restored / set correctly in the cloning process), e.g.

- (void)awakeFromNib
{
	[self bind:@"plotRoot" toObject:cvItem  
withKeyPath:@"representedObject" options:nil];
	[self bind:@"isSelected" toObject:cvItem withKeyPath:@"selected"  
options:nil];

}

This setup works fine for me (ignoring the other known bugs and  
documentation deficiencies of NSCollectionView — it's slightly  
disheartening when you file a bug on it, get a dup back and realise  
it's been known long enough for 1094954 other bugs to be filled..).


HTH,
Daniel.




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 [EMAIL PROTECTED]

Re: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Manuel
Thank you for your tips! But I didn't understand everything. Do you  
tried this in a sampleproject which you can send me?


If I initialize the imageBrowser in my MYNSCollectionViewItem and set  
the datasource, the datasource methods will now be called correctly.  
Thank you. But it seems that the IKImageBrowserView which is displayed  
will not display anything, even if I reload the imageBrowser data  
manually:


- (id)initWithCoder:(NSCoder *)decoder {
imageBrowser = [[IKImageBrowserView alloc] init];
[imageBrowser setDataSource:self];  
return self;
}


//  
-

//  numberOfItemsInImageBrowser:view
//  
-

- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
MyObject *representedObject = [self representedObject];
return [representedObject.myImages count];
}

//  
-

//  imageBrowser:view:index:
//  
-

- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
MyObject *representedObject = [self representedObject];
return [representedObject.myImages objectAtIndex:index];
}

- (IBAction)refreshView:(id)sender {
[imageBrowser reloadData];
}

Regards...Manu


On Jun 12, 2008, at 16:32 , Jens Alfke wrote:


I got it working like this:
- put your custom view initialisation in initWithCoder: (as that is  
the one used to copy the original instance / unarchive your nib)

You mean my customized NSCollectionView, didn't you?


- in your view, have an IBOutlet that's connected to the  
NSCollectionViewItem instance (called cvItem in my case)
- in awakeFromNib bind the properties you're interested in (as  
these get restored / set correctly in the cloning process), e.g.

- (void)awakeFromNib

-I don't need this do I?



{
	[self bind:@"plotRoot" toObject:cvItem  
withKeyPath:@"representedObject" options:nil];


	[self bind:@"isSelected" toObject:cvItem withKeyPath:@"selected"  
options:nil];

}


___

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: IKImageBrowserView and the View Hierarchy

2009-01-10 Thread Jeffrey J . Early
I finally came up with a simple work around to this problem, one which  
actually works better for my purposes:
	instead of adding a view to the window's view hierarchy, add a new  
child window to the window.


The view ordering then works as expected and doesn't break (or get  
broken by) IKImageBrowserView.


Hope that helps someone else,
Jeffrey

On Dec 28, 2008, at 11:02 PM, Jeffrey J. Early wrote:

I have had a number of troubles with IKImageBrowserView not  
respecting other views trying to draw over the top of it. I have  
worked around some of the issues, but this latest I can't seem to  
resolve.


I am trying to "dim" several of the views in my window by simply  
placing a translucent view over the top of them. This works as  
expected, *except* for the IKImageBrowserView... it always "shines  
through" and appears to be the top-most view.


I did find that if I force the translucent view to be layer backed  
by -setWantLayer:YES, then the *background* of the  
IKImageBrowserView becomes appropriately dimmed, but the loaded  
images just disappear!


This is *almost* repeatable with zero lines of code just using  
Interface Builder. You can drag an instance of IKImageBrowserView on  
a new window, then try to overlay another view, like an ImageWell or  
something. You'll see that the ImageWell is always below the  
IKImageBrowserView unless you tell it to be layer backed (although  
the layer-backing trick doesn't work in the simulator).


What's going on here? IKImageBrowserView is clearly doing something  
fancy -- any ideas what that is and how I can get it to behave like  
a normal NSView?


Thanks,
Jeffrey
___

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/jeffrey%40jeffreyearly.com

This email sent to jeff...@jeffreyearly.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


How to make single-row IKImageBrowserView?

2009-11-10 Thread John Fox
Hello Nice Cocoa People:

I'd like to be able to create an IKImageBrowserView that only displays a single 
row of items that scrolls horizontally as needed. I didn't find any public API 
for doing this, even though (from what I understand at least) 
IKImageBrowserView uses NSCollectionView which has the setMaxiumumNumberOfRows: 
method. Is there some public way of accessing an IKImageBrowserViews's 
underlying NSCollectionView instance? Otherwise, is there some trick I'm 
missing? Someone suggested that I could programmatically set the size of by 
image browser view based on the cell size and the number of items, which I 
imagine would work, but I'm wondering if there's an easier way.

Any help greatly appreciated.

Best regards, 

John

___

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: Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Thomas Goossens
Hi Florian,

You can't do custom drawing this way (because the IKImageBrowserView renders 
into an openGL surface, so AppKit or CoreGraphics calls won't do anything).
So to do what you want you can either:
- make the view layer backed and add a sub-layer
- add an overlay transparent window on top of the image browser view
- add an overlay layer with setForegroundLayer: (that's the easiest solution 
but it is SnowLeopard only).

-- Thomas


On Nov 25, 2009, at 2:34 PM, Florian Soenens wrote:

> Hi list,
> 
> i'm trying to override an IKImageBrowserView to do some custom drawing but 
> i'm stuck.
> What i try to accomplish is that when the view contains zero items, some 
> custom drawing happens like drawing an NSAttributedString that says "Drop 
> items here..."
> Problem is that my drawing code gets never called.
> 
> Here's the drawRect method of my IKImageBrowserView:
> 
> - (void)drawRect:(NSRect)rect
> {
>   [super drawRect:rect];
>   
>   NSUInteger numItems = [[self dataSource] 
> numberOfItemsInImageBrowser:self];
>   
>   if(numItems <= 0)
>   {
>   NSLog(@"No items in me"); // This gets called, so i'm sure the 
> above code works
>   
>   NSRect bounds = [self bounds];
>   bounds.size.width = 200;
>   bounds.size.height = 200;
>   bounds.origin.x += 200;
>   bounds.origin.y += 200;
>   
>   //[NSGraphicsContext saveGraphicsState];
>   
>   [[NSColor yellowColor] set]; // Just for testing purposes
>   NSRectFill(bounds);
>   
>   //[NSGraphicsContext restoreGraphicsState];
>   }
> }
> 
> Uncommenting the NSGrahicsContext doesn't help either.
> 
> Anyone has any ideas or workarounds for this?
> Thanks in advance,
> Florian
> ___
> 
> 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/tgoossens%40mac.com
> 
> This email sent to tgooss...@mac.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: Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Mike Abdullah
Also, you could try swapping out the image browser (or making it hidden) when 
it is empty, and display an alternative placeholder view in its place.

Also, file a bug report requesting the ability to do this built-in.

On 25 Nov 2009, at 13:44, Thomas Goossens wrote:

> Hi Florian,
> 
> You can't do custom drawing this way (because the IKImageBrowserView renders 
> into an openGL surface, so AppKit or CoreGraphics calls won't do anything).
> So to do what you want you can either:
> - make the view layer backed and add a sub-layer
> - add an overlay transparent window on top of the image browser view
> - add an overlay layer with setForegroundLayer: (that's the easiest solution 
> but it is SnowLeopard only).
> 
> -- Thomas
> 
> 
> On Nov 25, 2009, at 2:34 PM, Florian Soenens wrote:
> 
>> Hi list,
>> 
>> i'm trying to override an IKImageBrowserView to do some custom drawing but 
>> i'm stuck.
>> What i try to accomplish is that when the view contains zero items, some 
>> custom drawing happens like drawing an NSAttributedString that says "Drop 
>> items here..."
>> Problem is that my drawing code gets never called.
>> 
>> Here's the drawRect method of my IKImageBrowserView:
>> 
>> - (void)drawRect:(NSRect)rect
>> {
>>  [super drawRect:rect];
>>  
>>  NSUInteger numItems = [[self dataSource] 
>> numberOfItemsInImageBrowser:self];
>>  
>>  if(numItems <= 0)
>>  {
>>  NSLog(@"No items in me"); // This gets called, so i'm sure the 
>> above code works
>>  
>>  NSRect bounds = [self bounds];
>>  bounds.size.width = 200;
>>  bounds.size.height = 200;
>>  bounds.origin.x += 200;
>>  bounds.origin.y += 200;
>>  
>>  //[NSGraphicsContext saveGraphicsState];
>>  
>>  [[NSColor yellowColor] set]; // Just for testing purposes
>>  NSRectFill(bounds);
>>  
>>  //[NSGraphicsContext restoreGraphicsState];
>>  }
>> }
>> 
>> Uncommenting the NSGrahicsContext doesn't help either.
>> 
>> Anyone has any ideas or workarounds for this?
>> Thanks in advance,
>> Florian
>> ___
>> 
>> 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/tgoossens%40mac.com
>> 
>> This email sent to tgooss...@mac.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/cocoadev%40mikeabdullah.net
> 
> This email sent to cocoa...@mikeabdullah.net

___

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: Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Florian Soenens

Hi Thomas,

thanks for the reply, i did try the first method you suggest with  
adding a layer but it didn't work either.
I also tought of the second method but how would i make sure that my  
IKImageBrowserView still receives drop event?


I ned to be compatible with 10.5 so method 3 is out of the question.

Thanks anyway!

Florian.

On 25 Nov 2009, at 14:44, Thomas Goossens wrote:


Hi Florian,

You can't do custom drawing this way (because the IKImageBrowserView  
renders into an openGL surface, so AppKit or CoreGraphics calls  
won't do anything).

So to do what you want you can either:
- make the view layer backed and add a sub-layer
- add an overlay transparent window on top of the image browser view
- add an overlay layer with setForegroundLayer: (that's the easiest  
solution but it is SnowLeopard only).


-- Thomas


On Nov 25, 2009, at 2:34 PM, Florian Soenens wrote:


Hi list,

i'm trying to override an IKImageBrowserView to do some custom  
drawing but i'm stuck.
What i try to accomplish is that when the view contains zero items,  
some custom drawing happens like drawing an NSAttributedString that  
says "Drop items here..."

Problem is that my drawing code gets never called.

Here's the drawRect method of my IKImageBrowserView:

- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];

	NSUInteger numItems = [[self dataSource]  
numberOfItemsInImageBrowser:self];


if(numItems <= 0)
{
		NSLog(@"No items in me"); // This gets called, so i'm sure the  
above code works


NSRect bounds = [self bounds];
bounds.size.width = 200;
bounds.size.height = 200;
bounds.origin.x += 200;
bounds.origin.y += 200;

//[NSGraphicsContext saveGraphicsState];

[[NSColor yellowColor] set]; // Just for testing purposes
NSRectFill(bounds);

//[NSGraphicsContext restoreGraphicsState];
}
}

Uncommenting the NSGrahicsContext doesn't help either.

Anyone has any ideas or workarounds for this?
Thanks in advance,
Florian
___

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/tgoossens%40mac.com

This email sent to tgooss...@mac.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/florian.soenens%40nss.be

This email sent to florian.soen...@nss.be




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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: Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Mike Abdullah

On 25 Nov 2009, at 14:06, Florian Soenens wrote:

> Hi Thomas,
> 
> thanks for the reply, i did try the first method you suggest with adding a 
> layer but it didn't work either.
> I also tought of the second method but how would i make sure that my 
> IKImageBrowserView still receives drop event?

You should be able to set the overlay to be invisible to mouse events etc. 
quite easily.
> 
> I ned to be compatible with 10.5 so method 3 is out of the question.
> 
> Thanks anyway!
> 
> Florian.
> 
> On 25 Nov 2009, at 14:44, Thomas Goossens wrote:
> 
>> Hi Florian,
>> 
>> You can't do custom drawing this way (because the IKImageBrowserView renders 
>> into an openGL surface, so AppKit or CoreGraphics calls won't do anything).
>> So to do what you want you can either:
>> - make the view layer backed and add a sub-layer
>> - add an overlay transparent window on top of the image browser view
>> - add an overlay layer with setForegroundLayer: (that's the easiest solution 
>> but it is SnowLeopard only).
>> 
>> -- Thomas
>> 
>> 
>> On Nov 25, 2009, at 2:34 PM, Florian Soenens wrote:
>> 
>>> Hi list,
>>> 
>>> i'm trying to override an IKImageBrowserView to do some custom drawing but 
>>> i'm stuck.
>>> What i try to accomplish is that when the view contains zero items, some 
>>> custom drawing happens like drawing an NSAttributedString that says "Drop 
>>> items here..."
>>> Problem is that my drawing code gets never called.
>>> 
>>> Here's the drawRect method of my IKImageBrowserView:
>>> 
>>> - (void)drawRect:(NSRect)rect
>>> {
>>> [super drawRect:rect];
>>> 
>>> NSUInteger numItems = [[self dataSource] 
>>> numberOfItemsInImageBrowser:self];
>>> 
>>> if(numItems <= 0)
>>> {
>>> NSLog(@"No items in me"); // This gets called, so i'm sure the 
>>> above code works
>>> 
>>> NSRect bounds = [self bounds];
>>> bounds.size.width = 200;
>>> bounds.size.height = 200;
>>> bounds.origin.x += 200;
>>> bounds.origin.y += 200;
>>> 
>>> //[NSGraphicsContext saveGraphicsState];
>>> 
>>> [[NSColor yellowColor] set]; // Just for testing purposes
>>> NSRectFill(bounds);
>>> 
>>> //[NSGraphicsContext restoreGraphicsState];
>>> }
>>> }
>>> 
>>> Uncommenting the NSGrahicsContext doesn't help either.
>>> 
>>> Anyone has any ideas or workarounds for this?
>>> Thanks in advance,
>>> Florian
>>> ___
>>> 
>>> 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/tgoossens%40mac.com
>>> 
>>> This email sent to tgooss...@mac.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/florian.soenens%40nss.be
>> 
>> This email sent to florian.soen...@nss.be
> 
> 
> 
> Looking for Web-to-Print Solutions?
> Visit our website :   http://www.vit2print.com
> 
> 
> This e-mail, and any attachments thereto, is intended only for use by the 
> addressee(s) named herein and may contain legally privileged and/or 
> confidential information and/or information protected by intellectual 
> property rights.
> If you are not the intended recipient, please note that any review, 
> dissemination, disclosure, alteration, printing, copying or transmission of 
> this e-mail and/or any file transmitted with it, is strictly prohibited and 
> may be unlawful.
> If you have received this e-mail by mistake, please immediately notify the 
> sender and permanently delete the original as well as any copy of any e-mail 
> and any printout thereof.
> We may monitor e-mail to and from our 

Re: Custom drawing in IKImageBrowserView fails

2009-11-25 Thread Florian Soenens
 Thanks to all for the help.

i went with Mike's solution of swapping view.
I wrapped the IKImageBrowserView into a Tabless NSTabview with in the second 
tab my "dropview".

I will also file the bug report as Mike suggested.

Thanks!

On Wednesday, November 25, 2009, at 03:34PM, "Mike Abdullah" 
 wrote:
>
>On 25 Nov 2009, at 14:06, Florian Soenens wrote:
>
>> Hi Thomas,
>> 
>> thanks for the reply, i did try the first method you suggest with adding a 
>> layer but it didn't work either.
>> I also tought of the second method but how would i make sure that my 
>> IKImageBrowserView still receives drop event?
>
>You should be able to set the overlay to be invisible to mouse events etc. 
>quite easily.
>> 
>> I ned to be compatible with 10.5 so method 3 is out of the question.
>> 
>> Thanks anyway!
>> 
>> Florian.
>> 
>> On 25 Nov 2009, at 14:44, Thomas Goossens wrote:
>> 
>>> Hi Florian,
>>> 
>>> You can't do custom drawing this way (because the IKImageBrowserView 
>>> renders into an openGL surface, so AppKit or CoreGraphics calls won't do 
>>> anything).
>>> So to do what you want you can either:
>>> - make the view layer backed and add a sub-layer
>>> - add an overlay transparent window on top of the image browser view
>>> - add an overlay layer with setForegroundLayer: (that's the easiest 
>>> solution but it is SnowLeopard only).
>>> 
>>> -- Thomas
>>> 
>>> 
>>> On Nov 25, 2009, at 2:34 PM, Florian Soenens wrote:
>>> 
>>>> Hi list,
>>>> 
>>>> i'm trying to override an IKImageBrowserView to do some custom drawing but 
>>>> i'm stuck.
>>>> What i try to accomplish is that when the view contains zero items, some 
>>>> custom drawing happens like drawing an NSAttributedString that says "Drop 
>>>> items here..."
>>>> Problem is that my drawing code gets never called.
>>>> 
>>>> Here's the drawRect method of my IKImageBrowserView:
>>>> 
>>>> - (void)drawRect:(NSRect)rect
>>>> {
>>>>[super drawRect:rect];
>>>>
>>>>NSUInteger numItems = [[self dataSource] 
>>>> numberOfItemsInImageBrowser:self];
>>>>
>>>>if(numItems <= 0)
>>>>{
>>>>NSLog(@"No items in me"); // This gets called, so i'm sure the 
>>>> above code works
>>>>
>>>>NSRect bounds = [self bounds];
>>>>bounds.size.width = 200;
>>>>bounds.size.height = 200;
>>>>bounds.origin.x += 200;
>>>>bounds.origin.y += 200;
>>>>
>>>>//[NSGraphicsContext saveGraphicsState];
>>>>
>>>>[[NSColor yellowColor] set]; // Just for testing purposes
>>>>NSRectFill(bounds);
>>>>
>>>>//[NSGraphicsContext restoreGraphicsState];
>>>>}
>>>> }
>>>> 
>>>> Uncommenting the NSGrahicsContext doesn't help either.
>>>> 
>>>> Anyone has any ideas or workarounds for this?
>>>> Thanks in advance,
>>>> Florian
>>>> ___
>>>> 
>>>> 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/tgoossens%40mac.com
>>>> 
>>>> This email sent to tgooss...@mac.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/florian.soenens%40nss.be
>>> 
>>> This email sent to florian.soen...@nss.be
>> 
>> 
>> 
>> Looking for Web-to-Print Solutions?
>> Visit our website :   http://www.vit2print.com
>> 
>

Re: reloading IKImageBrowserView in an IBAction

2009-03-03 Thread Claus Guttesen
> I read the excellent article 'Image Kit Programming Guide' at
> http://developer.apple.com/documentation/graphicsimaging/Conceptual/ImageKitProgrammingGuide/Introduction/chapter_1_section_1.html#//apple_ref/doc/uid/TP40004907-CH1-SW1
> and have my ImageBrowser working. I want to use it as the basis of an
> image-uploader and would like to visualize the upload-progress by
> removing the first image. I have connected a button to an IBAction and
> can remove the images one by one.
>
> I changed the 'if' to a 'while' but it doesn't animate removals one by
> one but is waiting with [mImageBrowser reloadData] until all images
> are removed (perhaps IBAction blocks it?) and remove all images at
> once.
>
> How can I make the [mImageBrowser reloadData] refresh within the while-loop?

Answering my own question! :-)

Another thread (regarding nstimer) put me on the right track. Reading
about nstimer suggested the use of nsthread, so wrapping the removal
of images into a thread solved my issue:

-(void)removeImages:(id)sender {
while ( more images to remove ) {
[mImages removeObjectAtIndex:0];
[mImageBrowser reloadData];
etc.
}
}

- (IBAction)listImagesButtonClicked:(id)sender {
NSThread *myThread = [[NSThread alloc] initWithTarget:self
selector:@selector(removeImages:) object:nil];
[myThread start];
}

-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare
___

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: IKImageBrowserView is not reloading data.

2009-05-12 Thread peter . schols

Hi Kenny,

In your IKImageBrowserItem, you could implement:
- (NSUInteger)imageVersion;

Increasing this version and then calling IKImageBrowserView's  
reloadData should do the trick.


Best wishes,

Peter

Peter Schols
Orbicule
http://www.macnification.com/




Date: Mon, 11 May 2009 01:25:58 -0700
From: Kenny Carruthers 
Subject: IKImageBrowserView is not reloading data.
To: cocoa-dev@lists.apple.com
Message-ID: <32a26af6-fb7b-48d0-af68-dd2ee8627...@gmail.com>
Content-Type: text/plain;   charset=US-ASCII;   format=flowed;  
delsp=yes

Hi,

Given an IKImageBrowserView that is populated with valid
IKImageBrowserItem, calling 'reloadData' on the image browser view
does not actually reload the data for me. The documentation says that
it "Marks the receiver as needing its data reloaded" but how and when
does the reload actually take place?

My application is a Core Data application and I initially thought the
problem was related to bindings and updating of the managed object
behind the image views back, but then I came across the sample code at
apple.dev and realized that the problem still existed:

http://developer.apple.com/samplecode/IKImageBrowserViewWithCoreData

So then I boiled it down to the most basic scenario I could think of
and the problem still exists. I can trigger this "bug" with something
as simple as an image view backed by data source that just returns
IKImageBrowserItem, who's imageRepresentationType is
IKImageBrowserPathRepresentationType and who's imageRepresentation is
just a path on the local file system.

The following is reproducible for me. Hopefully I'm just missing
something obvious. Comments are welcome.

1. Launch application
2. Populate image browser view with two items who return 'nil' when
asked for their imageRepresentation. (ImageBrowser will correctly show
the empty box for each.)
3. Click on a button that simply calls a method that assigns a valid
path to each item. (The path represents an image on the disk.)
4. Call reloadData on the image browser and the empty boxes will
correctly be replaced with the appropriate images.
5. Now, replace each items path with another valid path on the
filesystem that points to a different photo.
6. Call reloadData.
7. This time, the images are not updated.

In fact, no matter what I seem to do, the only time I can actually get
the image browser to reload the data is when the items don't return a
valid imageRepresentation. All other times, the image browser view
seems to ignore my requests for a reload, and doesn't even call any of
the IKImageBrowserItem methods at all. (Though it does if the items
are initially nill).

So, if the image browser view is already populated with valid items,
the reload appears to fail for me. If the image browser view is
populated with items that have an invalid imageRepresentation, the
reload appears to work.

Thoughts?

Sincerely,
Kenny

--

___

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

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

http://lists.apple.com/mailman/listinfo/cocoa-dev


End of Cocoa-dev Digest, Vol 6, Issue 717
*


___

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: IKImageBrowserView is not reloading data.

2009-05-12 Thread Kenny Carruthers

Peter,

Excellent, that solved the issue. Much appreciated.

Sincerely,
Kenny

On May 12, 2009, at 1:27 AM, peter.sch...@mac.com wrote:


Hi Kenny,

In your IKImageBrowserItem, you could implement:
- (NSUInteger)imageVersion;

Increasing this version and then calling IKImageBrowserView's  
reloadData should do the trick.


Best wishes,

Peter

Peter Schols
Orbicule
http://www.macnification.com/




Date: Mon, 11 May 2009 01:25:58 -0700
From: Kenny Carruthers 
Subject: IKImageBrowserView is not reloading data.
To: cocoa-dev@lists.apple.com
Message-ID: <32a26af6-fb7b-48d0-af68-dd2ee8627...@gmail.com>
Content-Type: text/plain;   charset=US-ASCII;   format=flowed;  
delsp=yes

Hi,

Given an IKImageBrowserView that is populated with valid
IKImageBrowserItem, calling 'reloadData' on the image browser view
does not actually reload the data for me. The documentation says that
it "Marks the receiver as needing its data reloaded" but how and when
does the reload actually take place?

My application is a Core Data application and I initially thought the
problem was related to bindings and updating of the managed object
behind the image views back, but then I came across the sample code  
at

apple.dev and realized that the problem still existed:

http://developer.apple.com/samplecode/IKImageBrowserViewWithCoreData

So then I boiled it down to the most basic scenario I could think of
and the problem still exists. I can trigger this "bug" with something
as simple as an image view backed by data source that just returns
IKImageBrowserItem, who's imageRepresentationType is
IKImageBrowserPathRepresentationType and who's imageRepresentation is
just a path on the local file system.

The following is reproducible for me. Hopefully I'm just missing
something obvious. Comments are welcome.

1. Launch application
2. Populate image browser view with two items who return 'nil' when
asked for their imageRepresentation. (ImageBrowser will correctly  
show

the empty box for each.)
3. Click on a button that simply calls a method that assigns a valid
path to each item. (The path represents an image on the disk.)
4. Call reloadData on the image browser and the empty boxes will
correctly be replaced with the appropriate images.
5. Now, replace each items path with another valid path on the
filesystem that points to a different photo.
6. Call reloadData.
7. This time, the images are not updated.

In fact, no matter what I seem to do, the only time I can actually  
get

the image browser to reload the data is when the items don't return a
valid imageRepresentation. All other times, the image browser view
seems to ignore my requests for a reload, and doesn't even call any  
of

the IKImageBrowserItem methods at all. (Though it does if the items
are initially nill).

So, if the image browser view is already populated with valid items,
the reload appears to fail for me. If the image browser view is
populated with items that have an invalid imageRepresentation, the
reload appears to work.

Thoughts?

Sincerely,
Kenny

--

___

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

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins (at) lists.apple.com

http://lists.apple.com/mailman/listinfo/cocoa-dev


End of Cocoa-dev Digest, Vol 6, Issue 717
*




___

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: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Thomas Goossens
Hi Micha,

Are you trying to drag from the IKImageBrowserView or into the 
IKImageBrowserView ?

if from: you need to fill the pasteboard by implementing the datasource method:
- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser 
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard 
*)pasteboard;

if into: there should be no difference between 
IKImageBrowserNSDataRepresentationType and IKImageBrowserPathRepresentationType.

--Thomas

On Dec 4, 2009, at 2:41 PM, Micha Fuhrmann wrote:

> Dear All,
> 
> Im using a IKImageBrowserView and trying to implement D&D. The image object 
> I'm using is of IKImageBrowserNSDataRepresentationType. If I use 
> IKImageBrowserPathRepresentationType D&D works fine.
> 
> But with IKImageBrowserNSDataRepresentationType none of the delegates methods 
> gets called:
> 
> - (NSDragOperation)draggingEntered:(id )sender
> - (NSDragOperation)draggingUpdated:(id )sender
> - (BOOL) performDragOperation:(id )sender
> 
> I've tried 
> 
> IKImageBrowserView  -> registerForDraggedTypes:[NSArray arrayWithObject: 
> NSFilesPromisePboardType]
> 
> To no avail. Any help as to which direction to take would be great.
> 
> Thanks
> ___
> 
> 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/tgoossens%40mac.com
> 
> This email sent to tgooss...@mac.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: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Ha yes,

I'm doing a from only. Now I've filled the pasteboard with my NSData objects 
for NSFilesPromisePboardType. Which methods should I implement if I don't want 
any drops enabled within the image browser but only to the finder?

Any direction appreciated.

On 4 déc. 2009, at 14:48, Thomas Goossens wrote:

> Hi Micha,
> 
> Are you trying to drag from the IKImageBrowserView or into the 
> IKImageBrowserView ?
> 
> if from: you need to fill the pasteboard by implementing the datasource 
> method:
> - (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser 
> writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard 
> *)pasteboard;
> 
> if into: there should be no difference between 
> IKImageBrowserNSDataRepresentationType and 
> IKImageBrowserPathRepresentationType.
> 
> --Thomas
> 
> On Dec 4, 2009, at 2:41 PM, Micha Fuhrmann wrote:
> 
>> Dear All,
>> 
>> Im using a IKImageBrowserView and trying to implement D&D. The image object 
>> I'm using is of IKImageBrowserNSDataRepresentationType. If I use 
>> IKImageBrowserPathRepresentationType D&D works fine.
>> 
>> But with IKImageBrowserNSDataRepresentationType none of the delegates 
>> methods gets called:
>> 
>> - (NSDragOperation)draggingEntered:(id )sender
>> - (NSDragOperation)draggingUpdated:(id )sender
>> - (BOOL) performDragOperation:(id )sender
>> 
>> I've tried 
>> 
>> IKImageBrowserView  -> registerForDraggedTypes:[NSArray arrayWithObject: 
>> NSFilesPromisePboardType]
>> 
>> To no avail. Any help as to which direction to take would be great.
>> 
>> Thanks
>> ___
>> 
>> 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/tgoossens%40mac.com
>> 
>> This email sent to tgooss...@mac.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: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Thomas Goossens
return NSDragOperationNone in the two methods below:

- (NSDragOperation)draggingEntered:(id )sender
- (NSDragOperation)draggingUpdated:(id )sender

or invoke this during the setup of your IKImageBrowserView:

registerForDraggedTypes:nil

-- Thomas

On Dec 4, 2009, at 3:44 PM, Micha Fuhrmann wrote:

> Ha yes,
> 
> I'm doing a from only. Now I've filled the pasteboard with my NSData objects 
> for NSFilesPromisePboardType. Which methods should I implement if I don't 
> want any drops enabled within the image browser but only to the finder?
> 
> Any direction appreciated.
> 
> On 4 déc. 2009, at 14:48, Thomas Goossens wrote:
> 
>> Hi Micha,
>> 
>> Are you trying to drag from the IKImageBrowserView or into the 
>> IKImageBrowserView ?
>> 
>> if from: you need to fill the pasteboard by implementing the datasource 
>> method:
>> - (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser 
>> writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard 
>> *)pasteboard;
>> 
>> if into: there should be no difference between 
>> IKImageBrowserNSDataRepresentationType and 
>> IKImageBrowserPathRepresentationType.
>> 
>> --Thomas
>> 
>> On Dec 4, 2009, at 2:41 PM, Micha Fuhrmann wrote:
>> 
>>> Dear All,
>>> 
>>> Im using a IKImageBrowserView and trying to implement D&D. The image object 
>>> I'm using is of IKImageBrowserNSDataRepresentationType. If I use 
>>> IKImageBrowserPathRepresentationType D&D works fine.
>>> 
>>> But with IKImageBrowserNSDataRepresentationType none of the delegates 
>>> methods gets called:
>>> 
>>> - (NSDragOperation)draggingEntered:(id )sender
>>> - (NSDragOperation)draggingUpdated:(id )sender
>>> - (BOOL) performDragOperation:(id )sender
>>> 
>>> I've tried 
>>> 
>>> IKImageBrowserView  -> registerForDraggedTypes:[NSArray arrayWithObject: 
>>> NSFilesPromisePboardType]
>>> 
>>> To no avail. Any help as to which direction to take would be great.
>>> 
>>> Thanks
>>> ___
>>> 
>>> 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/tgoossens%40mac.com
>>> 
>>> This email sent to tgooss...@mac.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: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Ok, thanks again, so far so good.

Now as I drag an image or multiple images it creates a thumb of the dragged 
item(s), but as I drag to the desktop there's no plus sign badge on the dragged 
items and as a drop on the desktop it doesn't accept. I guess what I need to 
get is a 

- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination{

And then perform the paste from my end. But I'm not receiving 
namesOfPromisedFilesDroppedAtDestination. I've looked in the sample code and 
the last example is from 2003.

Micha
On 4 déc. 2009, at 15:55, Thomas Goossens wrote:

> return NSDragOperationNone in the two methods below:
> 
> - (NSDragOperation)draggingEntered:(id )sender
> - (NSDragOperation)draggingUpdated:(id )sender
> 
> or invoke this during the setup of your IKImageBrowserView:
> 
> registerForDraggedTypes:nil
> 
> -- Thomas
> 
> On Dec 4, 2009, at 3:44 PM, Micha Fuhrmann wrote:
> 
>> Ha yes,
>> 
>> I'm doing a from only. Now I've filled the pasteboard with my NSData objects 
>> for NSFilesPromisePboardType. Which methods should I implement if I don't 
>> want any drops enabled within the image browser but only to the finder?
>> 
>> Any direction appreciated.
>> 
>> On 4 déc. 2009, at 14:48, Thomas Goossens wrote:
>> 
>>> Hi Micha,
>>> 
>>> Are you trying to drag from the IKImageBrowserView or into the 
>>> IKImageBrowserView ?
>>> 
>>> if from: you need to fill the pasteboard by implementing the datasource 
>>> method:
>>> - (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser 
>>> writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard 
>>> *)pasteboard;
>>> 
>>> if into: there should be no difference between 
>>> IKImageBrowserNSDataRepresentationType and 
>>> IKImageBrowserPathRepresentationType.
>>> 
>>> --Thomas
>>> 
>>> On Dec 4, 2009, at 2:41 PM, Micha Fuhrmann wrote:
>>> 
>>>> Dear All,
>>>> 
>>>> Im using a IKImageBrowserView and trying to implement D&D. The image 
>>>> object I'm using is of IKImageBrowserNSDataRepresentationType. If I use 
>>>> IKImageBrowserPathRepresentationType D&D works fine.
>>>> 
>>>> But with IKImageBrowserNSDataRepresentationType none of the delegates 
>>>> methods gets called:
>>>> 
>>>> - (NSDragOperation)draggingEntered:(id )sender
>>>> - (NSDragOperation)draggingUpdated:(id )sender
>>>> - (BOOL) performDragOperation:(id )sender
>>>> 
>>>> I've tried 
>>>> 
>>>> IKImageBrowserView  -> registerForDraggedTypes:[NSArray arrayWithObject: 
>>>> NSFilesPromisePboardType]
>>>> 
>>>> To no avail. Any help as to which direction to take would be great.
>>>> 
>>>> Thanks
>>>> ___
>>>> 
>>>> 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/tgoossens%40mac.com
>>>> 
>>>> This email sent to tgooss...@mac.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


IKImageBrowserView out drag & drop with NSData

2009-12-07 Thread Micha Fuhrmann
Hi everyone,

I'm using an IKImageBrowserView with data rep 
IKImageBrowserNSDataRepresentationType.

I'm using 

- (NSUInteger) imageBrowser:(IKImageBrowserView *)aBrowser 
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard: (NSPasteboard 
*)pasteboard 

and filling the pasteboard with 

[pasteboard declareTypes:[NSArray arrayWithObject:(NSString 
*)kPasteboardTypeFileURLPromise] owner:self];
[pasteboard setPropertyList:imageData forType:(NSString 
*)kPasteboardTypeFileURLPromise];

imageData being an Array with NSData objects containing images.

The drag works fine, A nice red badge appears if I select multiple items, then 
the plus sign appears as I hover above the finder, but as I drop 

- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination

Doesn't get called.

I'm stuck here, everything works fine, but I just need the drop location...

I've tried subclassing IKImageBrowserView  as shown on http://speirs.org/

But then the badge is gone, the thumbs of the first image is gone too, and I've 
got the feeling I will bump into problems with sublclassing all the mouse 
action later on in the project.

Any help greatly appeciated.
___

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


IKImageBrowserView image quality changing with redraw

2009-12-07 Thread Adam Berger
I'm trying to move from a custom view to an IKImageBrowserView in a project,
and running into a somewhat odd problem. Context: my IKImageBrowserItems are
IKImageBrowserNSImageRepresentationType, backed by a relatively
large (~600x800) NSImage.

When first drawn, at any scale factor, this looks great. However, as soon as
a redraw (not a reload!) occurs, the quality goes to hell. For example,
clicking in the browserview will cause this problem instantly. It's as if
it's deciding all of a sudden to fall back to a cached image of much lower
quality. Scrolling seems not to trigger a redraw of this type; so if a large
view containing as-first-drawn high quality images is clicked, only the
currently visible thumbnails will get degraded, and scrolling can then
present a mix of degraded and full-quality images.

Needless to say, this huge a reduction in image quality is not acceptable.
How can this be prevented?

[Side note: I've seen reference to the prefetching behavior
of IKImageBrowserView is particularly gnarly for NSImages as all the preload
must be done on main thread since NSImage is not thread safe. With this in
mind, what's the preferred type for IKImageBrowserItem backings?]

Adam
___

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


IKImageBrowserView & IKImageView subclasses not getting called

2010-02-03 Thread Charles Burnstagger
I subclass IKImageBrowserView & IKImageView overriding initWithFrame: & 
drawRect: and sending the same messages to super in both cases.

I've set them as the classes for the UI objects in my IB file, and as IBOutlets 
in my window's window controller subclass.

But when I run the code, neither of my two subclasses ever get called. What 
gives? Is there anything else I need to do in my subclasses?

If I set the IBOutlets in the contoller subclass and class types in IB back to 
IKImageBrowserView & IKImageView, the code seems to do the same thing as when I 
use my subclasses.

Thanks,

Chuck



  
___

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: How to use bindings with IKImageBrowserView?

2008-04-04 Thread Adam Gerson
It does work. I have defined a core data entity that conforms to
IKBrowerItem protocol and my IKImageBrowserView is working with
bindings. I think you still need to point the delegate and data source
outlets to an object that implements the datasource methods:



// -
//  numberOfItemsInImageBrowser:view
// -
- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
// The item count to display is the datadsource item count.
return [[imageBrowserArrayController arrangedObjects] count];
}

// -
//  imageBrowser:view:index:
// -
- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
return [[imageBrowserArrayController arrangedObjects] objectAtIndex:index];
}


// Implement some optional methods of the image browser  datasource
protocol to allow for removing and reodering items.

// -
//  removeItemsAtIndexes:
//
//  The user wants to delete images, so remove these entries from the
data source.
// -
- (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
(NSIndexSet*)indexes
{
[imageBrowserArrayController 
removeObjectsAtArrangedObjectIndexes:indexes];
}


On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>  I am attempting to use bindings to supply an IKImageBrowserView with data.
> I have successfully used IKImageBrowserView with a data source, but cannot
> get bindings to work. Should it work with bindings?
>
>  The array controller's contentArray is hooked up to an NSMutableArray
> called storedImages. That contains instances of storedImage. And those have
> a method browserObject that returns instances of an object that implements
> the IKBrowerItem protocol to fetch and display an image (uid, path, etc).
>
>  The Image Kit browser is bound to the array controller's arranged objects
> with the model key path browserObject. It is set to automatically prepare
> content.
>
>  I get no images displayed even though there are plenty in the storedImages
> array. I am telling the browser view to reload its data.
>
>  If I set a breakpoint at browserObject, it is never hit. So it looks like
> the array controller is never attempting to read my model. I get no errors
> when loading my nib.
>
>
>  --
>  Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%40gmail.com
>
>  This email sent to [EMAIL PROTECTED]
>
___

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: How to use bindings with IKImageBrowserView?

2008-04-04 Thread Steve Weller


On Apr 4, 2008, at 2:18 PM, Adam Gerson wrote:

It does work. I have defined a core data entity that conforms to
IKBrowerItem protocol and my IKImageBrowserView is working with
bindings. I think you still need to point the delegate and data source
outlets to an object that implements the datasource methods:


Are you doing the below plus bindings? That makes no sense to me.

The code below is using the array controller as its data source. That  
means you have to manually use reloadData I assume. My goal is to  
update a store of images that is KVO/KVC compliant and have the view  
update automatically as images are added and removed.







//  
-

//  numberOfItemsInImageBrowser:view
//  
-

- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
// The item count to display is the datadsource item count.
   return [[imageBrowserArrayController arrangedObjects] count];
}

//  
-

//  imageBrowser:view:index:
//  
-

- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
   return [[imageBrowserArrayController arrangedObjects]  
objectAtIndex:index];

}


// Implement some optional methods of the image browser  datasource
protocol to allow for removing and reodering items.

//  
-

//  removeItemsAtIndexes:
//
//  The user wants to delete images, so remove these entries from the
data source.
//  
-

- (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
(NSIndexSet*)indexes
{
	[imageBrowserArrayController  
removeObjectsAtArrangedObjectIndexes:indexes];

}


On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]>  
wrote:


I am attempting to use bindings to supply an IKImageBrowserView  
with data.
I have successfully used IKImageBrowserView with a data source, but  
cannot

get bindings to work. Should it work with bindings?

The array controller's contentArray is hooked up to an NSMutableArray
called storedImages. That contains instances of storedImage. And  
those have
a method browserObject that returns instances of an object that  
implements
the IKBrowerItem protocol to fetch and display an image (uid, path,  
etc).


The Image Kit browser is bound to the array controller's arranged  
objects
with the model key path browserObject. It is set to automatically  
prepare

content.

I get no images displayed even though there are plenty in the  
storedImages

array. I am telling the browser view to reload its data.

If I set a breakpoint at browserObject, it is never hit. So it  
looks like
the array controller is never attempting to read my model. I get no  
errors

when loading my nib.


--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%40gmail.com

This email sent to [EMAIL PROTECTED]



--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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 [EMAIL PROTECTED]


Re: How to use bindings with IKImageBrowserView?

2008-04-04 Thread Adam Gerson
I know its a hybrid approach, but the upside is I did not have to call
reloadData. As soon as I added an object to the arraycontroller it
became available in the view.

Adam


On Sat, Apr 5, 2008 at 12:28 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>  On Apr 4, 2008, at 2:18 PM, Adam Gerson wrote:
>
> > It does work. I have defined a core data entity that conforms to
> > IKBrowerItem protocol and my IKImageBrowserView is working with
> > bindings. I think you still need to point the delegate and data source
> > outlets to an object that implements the datasource methods:
> >
>
>  Are you doing the below plus bindings? That makes no sense to me.
>
>  The code below is using the array controller as its data source. That means
> you have to manually use reloadData I assume. My goal is to update a store
> of images that is KVO/KVC compliant and have the view update automatically
> as images are added and removed.
>
>
>
> >
> >
> >
> > //
> -
> > //  numberOfItemsInImageBrowser:view
> >
> >
> >
> > //
> -
> > - (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
> > {
> >// The item count to display is the datadsource item count.
> >   return [[imageBrowserArrayController arrangedObjects] count];
> > }
> >
> > //
> -----
> > //  imageBrowser:view:index:
> > //
> -
> > - (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
> > {
> >   return [[imageBrowserArrayController arrangedObjects]
> objectAtIndex:index];
> > }
> >
> >
> > // Implement some optional methods of the image browser  datasource
> > protocol to allow for removing and reodering items.
> >
> > //
> -----
> > //  removeItemsAtIndexes:
> > //
> > //  The user wants to delete images, so remove these entries from the
> > data source.
> > //
> -
> > - (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
> > (NSIndexSet*)indexes
> > {
> >[imageBrowserArrayController
> removeObjectsAtArrangedObjectIndexes:indexes];
> > }
> >
> >
> > On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > I am attempting to use bindings to supply an IKImageBrowserView with
> data.
> > > I have successfully used IKImageBrowserView with a data source, but
> cannot
> > > get bindings to work. Should it work with bindings?
> > >
> > > The array controller's contentArray is hooked up to an NSMutableArray
> > > called storedImages. That contains instances of storedImage. And those
> have
> > > a method browserObject that returns instances of an object that
> implements
> > > the IKBrowerItem protocol to fetch and display an image (uid, path,
> etc).
> > >
> > > The Image Kit browser is bound to the array controller's arranged
> objects
> > > with the model key path browserObject. It is set to automatically
> prepare
> > > content.
> > >
> > > I get no images displayed even though there are plenty in the
> storedImages
> > > array. I am telling the browser view to reload its data.
> > >
> > > If I set a breakpoint at browserObject, it is never hit. So it looks
> like
> > > the array controller is never attempting to read my model. I get no
> errors
> > > when loading my nib.
> > >
> > >
> > > --
> > > Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%40gmail.com
> > >
> > > This email sent to [EMAIL PROTECTED]
> > >
> > >
> >
>
>
>  --
>  Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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 [EMAIL PROTECTED]


Re: How to use bindings with IKImageBrowserView?

2008-04-27 Thread Adam Gerson
My IKImageBrowserView bound to an ArrayController is now spitting out
this error when the program launches

--ImageKit Error: reloadData called in non main thread

When I unbind it the error goes away along with the content no longer
being displayed. Any idea what could cause this?

Adam


On Sat, Apr 5, 2008 at 11:16 AM, Adam Knight <[EMAIL PROTECTED]> wrote:
> I can second this approach as working.  I used an array of objects and then
> pointed the delegate and dataSource to the view controller that holds the
> array as well as bound the content to it.  While the methods are called
> (silly design) to get the count, etc. the view does update when the array is
> changed.
>
> I've come to the conclusion that this object isn't finished yet.  Please
> file bugs to duplicate the ones I've filed. :)  This object has a lot of
> potential, but like many other new Image Kit items, it's buggy as heck.
>
> Adam Knight
> Co-founder; CTO
> [EMAIL PROTECTED]
>
>
> On Apr 4, 2008, at 11:39 PM, Adam Gerson wrote:
>
>
> I know its a hybrid approach, but the upside is I did not have to call
> reloadData. As soon as I added an object to the arraycontroller it
> became available in the view.
>
> Adam
>
>
> On Sat, Apr 5, 2008 at 12:28 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>  On Apr 4, 2008, at 2:18 PM, Adam Gerson wrote:
>
>
> It does work. I have defined a core data entity that conforms to
>
> IKBrowerItem protocol and my IKImageBrowserView is working with
>
> bindings. I think you still need to point the delegate and data source
>
> outlets to an object that implements the datasource methods:
>
>
>
>  Are you doing the below plus bindings? That makes no sense to me.
>
>  The code below is using the array controller as its data source. That means
> you have to manually use reloadData I assume. My goal is to update a store
> of images that is KVO/KVC compliant and have the view update automatically
> as images are added and removed.
>
>
>
>
>
>
>
>
>
>
> //
> -----
>
> //  numberOfItemsInImageBrowser:view
>
>
>
>
>
>
>
> //
> -
>
> - (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
>
> {
>
>// The item count to display is the datadsource item count.
>
>   return [[imageBrowserArrayController arrangedObjects] count];
>
> }
>
>
>
> //
> -
>
> //  imageBrowser:view:index:
>
> //
> -
>
> - (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
>
> {
>
>   return [[imageBrowserArrayController arrangedObjects]
> objectAtIndex:index];
>
> }
>
>
>
>
>
> // Implement some optional methods of the image browser  datasource
>
> protocol to allow for removing and reodering items.
>
>
>
> //
> -
>
> //  removeItemsAtIndexes:
>
> //
>
> //  The user wants to delete images, so remove these entries from the
>
> data source.
>
> //
> -----
>
> - (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
>
> (NSIndexSet*)indexes
>
> {
>
>[imageBrowserArrayController
> removeObjectsAtArrangedObjectIndexes:indexes];
>
> }
>
>
>
>
>
> On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> I am attempting to use bindings to supply an IKImageBrowserView with
> data.
>
> I have successfully used IKImageBrowserView with a data source, but
> cannot
>
> get bindings to work. Should it work with bindings?
>
>
>
> The array controller's contentArray is hooked up to an NSMutableArray
>
> called storedImages. That contains instances of storedImage. And those
> have
>
> a method browserObject that returns instances of an object that
> implements
>
> the IKBrowerItem protocol to fetch and display an image (uid, path,
> etc).
>
>
>
> The Image Kit browser is bound to the array controller's arranged
> objects
>
> with the model key path browserObject. It is set to automatically
> prepare
>
> content.
>
>
>
> I get no images displayed even though there are plenty in the
> storedImages
>
> array. I am telling the browser view to reload its data.
>
>
>
> 

Re: How to make single-row IKImageBrowserView?

2009-11-17 Thread Ashley Clark
On Nov 10, 2009, at 4:55 PM, John Fox wrote:

> Hello Nice Cocoa People:
> 
> I'd like to be able to create an IKImageBrowserView that only displays a 
> single row of items that scrolls horizontally as needed. I didn't find any 
> public API for doing this, even though (from what I understand at least) 
> IKImageBrowserView uses NSCollectionView which has the 
> setMaxiumumNumberOfRows: method. Is there some public way of accessing an 
> IKImageBrowserViews's underlying NSCollectionView instance? Otherwise, is 
> there some trick I'm missing? Someone suggested that I could programmatically 
> set the size of by image browser view based on the cell size and the number 
> of items, which I imagine would work, but I'm wondering if there's an easier 
> way.
> 
> Any help greatly appreciated.


Set the height of your browser view to whatever you'd like that will contain a 
single row of your image cells. Then in your controller's -awakeFromNib use 
[imageBrowser setContentResizingMask:NSViewWidthSizable] to tell it you only 
want it to expand horizontally. Apparently the default is NSViewHeightSizable 
and I see no way to override that via IB.

The normal autosizing springs/struts in IB don't seem to affect the 
contentResizingMask at all for an IKImageBrowserView.


Ashley



___

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


How to drag file promises from IKImageBrowserView?

2009-07-29 Thread Matt Rajca

Hi!

I'm using IKImageBrowserView to display a collection files that reside  
on Bluetooth devices. From the documentation, it looks like the only  
method you have to override to support dragging is:


- (NSUInteger)imageBrowser:(IKImageBrowserView *)aBrowser  
writeItemsAtIndexes:(NSIndexSet *)itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard


I can't seem to be able to get the Finder to accept file promises  
placed on the dragging pasteboard from IKImageBrowserView. Here is my  
code:


- (NSUInteger)imageBrowser:(IKImageBrowserView *)aBrowser  
writeItemsAtIndexes:(NSIndexSet *)itemIndexes toPasteboard: 
(NSPasteboard *)pasteboard {


NSArray *fileExtensions ... ; // Get extensions of the dragged files

	[pasteboard declareTypes:[NSArray  
arrayWithObject:NSFilesPromisePboardType] owner:self];
	[pasteboard setPropertyList:fileExtensions  
forType:NSFilesPromisePboardType];


return [fileExtensions count];
}

Is there any way to support the dragging of file promises from  
IKImageBrowserView so I could later save the actual data to disk  
asynchronously?


Thanks,

Matt
___

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: IKImageBrowserView image quality changing with redraw

2009-12-08 Thread Mike Abdullah

On 8 Dec 2009, at 00:01, Adam Berger wrote:

> I'm trying to move from a custom view to an IKImageBrowserView in a project,
> and running into a somewhat odd problem. Context: my IKImageBrowserItems are
> IKImageBrowserNSImageRepresentationType, backed by a relatively
> large (~600x800) NSImage.
> 
> When first drawn, at any scale factor, this looks great. However, as soon as
> a redraw (not a reload!) occurs, the quality goes to hell. For example,
> clicking in the browserview will cause this problem instantly. It's as if
> it's deciding all of a sudden to fall back to a cached image of much lower
> quality. Scrolling seems not to trigger a redraw of this type; so if a large
> view containing as-first-drawn high quality images is clicked, only the
> currently visible thumbnails will get degraded, and scrolling can then
> present a mix of degraded and full-quality images.
> 
> Needless to say, this huge a reduction in image quality is not acceptable.
> How can this be prevented?
> 
> [Side note: I've seen reference to the prefetching behavior
> of IKImageBrowserView is particularly gnarly for NSImages as all the preload
> must be done on main thread since NSImage is not thread safe. With this in
> mind, what's the preferred type for IKImageBrowserItem backings?]

NSImage is threadsafe as long as you're not mutating it.

http://developer.apple.com/mac/library/releasenotes/cocoa/AppKit.html
"NSImage: Clarifying the contract for 
threading"___

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: IKImageBrowserView image quality changing with redraw

2009-12-08 Thread Thomas Goossens
Hi Adam,

Is this on Leopard or Snowleopard ?
I just tried to load images from /System/Library/Desktop Pictures in an 
IKImageBrowserView using the NSImage representation. They appears just fine for 
me (SnowLeopard).

> [Side note: I've seen reference to the prefetching behavior
> of IKImageBrowserView is particularly gnarly for NSImages as all the preload
> must be done on main thread since NSImage is not thread safe. ?]

This is true on Leopard, but not on SnowLeopard.

> With this in
> mind, what's the preferred type for IKImageBrowserItem backings

If you images exists on the filesystem, it is preferable to use a path or url 
based representation.
Otherwise, there is no preferred representation.

-- Thomas


On Dec 8, 2009, at 1:01 AM, Adam Berger wrote:

> I'm trying to move from a custom view to an IKImageBrowserView in a project,
> and running into a somewhat odd problem. Context: my IKImageBrowserItems are
> IKImageBrowserNSImageRepresentationType, backed by a relatively
> large (~600x800) NSImage.
> 
> When first drawn, at any scale factor, this looks great. However, as soon as
> a redraw (not a reload!) occurs, the quality goes to hell. For example,
> clicking in the browserview will cause this problem instantly. It's as if
> it's deciding all of a sudden to fall back to a cached image of much lower
> quality. Scrolling seems not to trigger a redraw of this type; so if a large
> view containing as-first-drawn high quality images is clicked, only the
> currently visible thumbnails will get degraded, and scrolling can then
> present a mix of degraded and full-quality images.
> 
> Needless to say, this huge a reduction in image quality is not acceptable.
> How can this be prevented?
> 
> [Side note: I've seen reference to the prefetching behavior
> of IKImageBrowserView is particularly gnarly for NSImages as all the preload
> must be done on main thread since NSImage is not thread safe. With this in
> mind, what's the preferred type for IKImageBrowserItem backings?]
> 
> Adam
> ___
> 
> 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/tgoossens%40mac.com
> 
> This email sent to tgooss...@mac.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: IKImageBrowserView image quality changing with redraw

2009-12-08 Thread Adam Berger
This has so far only been tested on SnowLeopard.

I'm going to divide this into two issues, since I'm not 100% sure they're
related.

1) On redraw, a filtering is applied that changes the image quality. Are you
seeing this change on first redraw from a large NSImage (rather than from a
url to an image)?

2) The filtering applied may actually be appropriate for photographs, but
I'm dealing with line drawings, which become completely unusable when scaled
in this way. Even zero antialiasing would be greatly preferred

3) (Not an issue, but a possible solution that didn't work.) If providing an
NSImage with multiple NSImageReps that only vary in resolution, icon style,
IKImageBrowserView seems to always work with the first/largest. If I could
make this work, I'd just generate multiple thumbnails. (I suppose I could
throw away all thumbnails on bump the version number on scale change...
expensive, though.)

I've put up three screenshots:

• http://www.addaon.com/IKImageBrowserView_scaling_A.png
is a manually-scaled high-quality image (about half the size of the
original; just for comparison)

• http://www.addaon.com/IKImageBrowserView_scaling_B.png
is how it appears initially (before redraw); this is marginally acceptable

• http://www.addaon.com/IKImageBrowserView_scaling_C.png
is the over-filtered form

Again, the transition between B and C happens whenever I cause a redraw, for
example by clicking on the background.

Hard to overstate this problem.

Adam

On Tue, Dec 8, 2009 at 5:59 AM, Thomas Goossens  wrote:

> Hi Adam,
>
> Is this on Leopard or Snowleopard ?
> I just tried to load images from /System/Library/Desktop Pictures in an
> IKImageBrowserView using the NSImage representation. They appears just fine
> for me (SnowLeopard).
>
> > I'm trying to move from a custom view to an IKImageBrowserView in a
> project,
> > and running into a somewhat odd problem. Context: my IKImageBrowserItems
> are
> > IKImageBrowserNSImageRepresentationType, backed by a relatively
> > large (~600x800) NSImage.
> >
> > When first drawn, at any scale factor, this looks great. However, as soon
> as
> > a redraw (not a reload!) occurs, the quality goes to hell. For example,
> > clicking in the browserview will cause this problem instantly. It's as if
> > it's deciding all of a sudden to fall back to a cached image of much
> lower
> > quality. Scrolling seems not to trigger a redraw of this type; so if a
> large
> > view containing as-first-drawn high quality images is clicked, only the
> > currently visible thumbnails will get degraded, and scrolling can then
> > present a mix of degraded and full-quality images.
> >
> > Needless to say, this huge a reduction in image quality is not
> acceptable.
> > How can this be prevented?
>
___

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


  1   2   >