local file browsing with revBrowserOpenCEF

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

local file browsing with revBrowserOpenCEF

Post by [-hh] » Thu Oct 16, 2014 5:43 am

The new CEF browser (Mac+Win only) can be used as a local file system browser that can display images and plain text; PDF on Win only, not on Mac (yes, I have installed also the AdobePDFViewerNPAPI plugin in a correct place).

Simply use the "file://"-protocol with a folder path, for example

Code: Select all

on mouseUp
  put revBrowserOpenCEF(the windowId of this stack) into brID 
  revBrowserSet brID, "url", ("file://" & the defaultfolder) # <-- folder path
  revBrowserSet brID, "rect", (the rect of img 1)
  revBrowserRedraw brID -- sometimes needed after resetting rect and/or url
end mouseUp
shiftLock happens

Post Reply

Return to “Talking LiveCode”