I think I figured something out. I used the table view's method for 
tableViewSelectionDidChange and I could set the panel's previewed item as that 
changed. It works but might not be optimal.
Thanks for any replies.
Chris


----- Forwarded Message -----
From: Chris Paveglio <chris_paveg...@yahoo.com>
To: Cocoa Dev List <Cocoa-dev@lists.apple.com>
Cc: 
Sent: Thursday, February 28, 2013 1:57 PM
Subject: Quicklook and changing previewed image from table

I'm building an app that has a table view which holds paths of images. I have 
enabled quicklook so I can press space bar and the preview window will show up. 
I can view 1 image and close the preview and show another image preview. But if 
I have the quicklook preview panel displayed, it won't update the image 
displayed, when I use the arrow key to scroll up/down in the table. I am pretty 
sure I need to call 

[[QLPreviewPanel sharedPreviewPanel] refreshCurrentPreviewItem];
//or the name of the panel instance itself

But where do I do that?
I have a tableView class that intercepts keystrokes to call the panel toggle on 
spacebar, and it will change the table selection too.

//inside of tableView subclass
- (void)keyDown:(NSEvent *)theEvent
{
NSString* key = [theEvent charactersIgnoringModifiers];
    if([key isEqual:@" "]) {
        [[[self window] windowController] togglePreviewPanel];
    } else {
        [super keyDown:theEvent];
    }
}

I tried putting the refresh... call inside of the else block, but that didn't 
do anything. Would something go in my tableView, or the WindowController (which 
is where the panel is created)?

Thanks,
Chris


_______________________________________________

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

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

Reply via email to