PDFThumbnailView Problem (kind of)

  • Dear Cocoa-gurus,
    I have a typical thumbnailview on a drawer and a pdfview in main window. I have a category that lets me drag and drop a pdf onto the pdfview; it then gets the url and sets a pdfdocument to that url; sets the pdfview and sets the thumbnailview to the pdfview.

    It "seems" to work; but I can't click on the thumbnails; they're there, but not clickable, until I resize the window, then all is well.

    Any idea of what's going on and what I need to do to "liberate" my thumbnailview (I've tried sending a setNeedsDisplay:-- Nada).

    Matthew Weinstein
  • On 23 May 2012, at 03:53, Matthew Weinstein wrote:

    > I have a typical thumbnailview on a drawer and a pdfview in main window. I have a category that lets me drag and drop a pdf onto the pdfview; it then gets the url and sets a pdfdocument to that url; sets the pdfview and sets the thumbnailview to the pdfview.
    >
    > It "seems" to work; but I can't click on the thumbnails; they're there, but not clickable, until I resize the window, then all is well.
    >
    > Any idea of what's going on and what I need to do to "liberate" my thumbnailview (I've tried sending a setNeedsDisplay:-- Nada).

    I've had a similar issue (and there are other issues with PDFThumbnailView that you may or may not run into). This is how I worked around it:
      self.thumbnailView.PDFView = self.previewCanvas;
      dispatch_async(dispatch_get_main_queue(), ^{
      self.thumbnailView.thumbnailSize = self.thumbnailView.thumbnailSize;
      });

    Simply setting the thumbnail size causes the thumbnail view to straighten itself out.

    -António

    ----------------------------------------------------
    There is a world of difference between
    searching for happiness and choosing
    to be happy.
    ----------------------------------------------------
  • You can't believe how easy that was to implement in cocoa:

    [myThumbnailView setThumbnailSize: [myThumbnailView thumbnailSize]];

    That's it; works like a charm.

    On May 22, 2012, at 11:37 PM, Antonio Nunes wrote:

    > On 23 May 2012, at 03:53, Matthew Weinstein wrote:
    >
    >> I have a typical thumbnailview on a drawer and a pdfview in main window. I have a category that lets me drag and drop a pdf onto the pdfview; it then gets the url and sets a pdfdocument to that url; sets the pdfview and sets the thumbnailview to the pdfview.
    >>
    >> It "seems" to work; but I can't click on the thumbnails; they're there, but not clickable, until I resize the window, then all is well.
    >>
    >> Any idea of what's going on and what I need to do to "liberate" my thumbnailview (I've tried sending a setNeedsDisplay:-- Nada).
    >
    > I've had a similar issue (and there are other issues with PDFThumbnailView that you may or may not run into). This is how I worked around it:
    > self.thumbnailView.PDFView = self.previewCanvas;
    > dispatch_async(dispatch_get_main_queue(), ^{
    > self.thumbnailView.thumbnailSize = self.thumbnailView.thumbnailSize;
    > });
    >
    > Simply setting the thumbnail size causes the thumbnail view to straighten itself out.
    >
    > -António
    >
    > ----------------------------------------------------
    > There is a world of difference between
    > searching for happiness and choosing
    > to be happy.
    > ----------------------------------------------------
    >
    >
    >
    >
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today