Hi MadHias :-)

Hi,

i want to create a little stack, which just opens a pdf file from an url and refreshes this window every 30 seconds to keep track of a possible modification of that pdf.

This is quite simply.

I tried "Browser Sampler.rev" in examples. But that example is over my head at the moment. I do not need any buttons like back, stop, forward and so on, because there is only one pdf file to be displayed.

The buttons are definitvely not compulsory!

But the most important thing is, how can i refresh the browser windows automatically without pressing a button and without locking the app when using a loop or a wait.

OK, here we go:

1. Create a stack in the desired size for the PDF.
2. Create an empty image object in that stack in the same size.
This can even be invisible since it is only needed as a reference for the dimensons of the browser overlay.

3. Put this into the script of your stack:
###############################

local tRefresh_msg
## Will hold the number of the pending message that will refresh your browser as described below..

on openstack

  ## Open/create a new browser:
  put revbrowseropen(the windowID of this stack, empty) into tBrowserID
  set the cBrowserID of this stack to tBrowserID
  ## Could also be a global variable, but I prefer custom props.

  ## Set the dimensions of the newly created browser
revbrowserset the cBrowserID of this stack, "rect", the rect of img "your empty image here, see Nr. 2 above..."

  ## Now load and display your PDF file:
revbrowserset the cBrowserID of this stack, "url", "http://path to your PDF..." ## Could also be a local file then use: "file:///path to your PDF..."

   send "refresh_display" to this stack in 30 secs
   put the result into tRefresh_msg
   ...
end openstack

## Custom handler to refresh the display of the PDF file (reload)
command refresh_display
   revbrowserrefresh the cBrowserID of this stack
   send "refresh_display" to this stack in 30 secs

## Store the number of the pending message, so we can cancel it on "closestack"!
   put the result into tRefresh_msg
end refresh_display

on closestack
  ## Cancel the pending message
  cancel tRefresh_msg
end closestack

## You could also add a "resizestack" handler, if needed,
## then you should just set the rect of that "browser" image to the rect of cd 1

###############################

That's it :-)

Hope that helps.

Regards,

Matthias

Best from germanski

Klaus Major
[EMAIL PROTECTED]
http://www.major-k.de


_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to