Greetings,

I'm trying to show previews using QuickLook using the code below. I couldn't 
find an example in the examples folder (I found one about QuickLook but it 
doesn't seem to be what I want).

I'm getting a crash each time.
Here's my code. It is called either when the user presses the space bar 
(open/close the view, then ToggleDisplay is true) or when the selected item 
changes (ToggleDisplay is false); PreviewView is a property of the windows, of 
type QLPreviewViewMBS:
Sub ShowPreview(ForFile As FolderItem,ToggleDisplay As Boolean)
  dim b As Boolean
  
  b=PreviewView=nil
  if b and not ToggleDisplay then Return //View was not open, ignore new 
selection

  if ToggleDisplay then //e.g. space bar pressed
    if b then //Object is nil, so we create it
      PreviewView=new QLPreviewViewMBS
      if PreviewView.Handle=0 then
        System.DebugLog "Can't create QL instance!"
        Return
      end if
      if PreviewView.Available then
        PreviewView.autostarts=True
      end if
    Else //When not nil, we close it
      PreviewView.close
      PreviewView=nil
    end if
  end if
  if (not ToggleDisplay) or b then //For all cases except when the view will be 
closed, set the preview item
    if PreviewView.Available then
      PreviewView.previewItem=ForFile
    end if
  end if
End Sub

I can post the crash log if that's necessary. An idea?
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to