R: Re: perhapse..
baccheschi at tin.it
baccheschi at tin.it
Tue May 10 10:55:23 EDT 2011
----Messaggio originale----
Da: janschenkel at yahoo.com
Data: 9-mag-
2011 21.20
A: "How to use LiveCode"<use-livecode at lists.runrev.com>
Ogg:
Re: perhapse..
--- On Sat, 5/7/11, J. Landman Gay
<jacque at hyperactivesw.com> wrote:
> On 5/7/11 8:16 AM, baccheschi at tin.
it
> wrote:
> > Perhapse..
> > Has it been a nonsense to ask if it
could be possible
> to
> > perform ON THE WEB a "resizeStack" ?
>
> I
don't think it is possible using LiveCode alone. The
> stack is
presented in a fixed-size window which can't
> change. There might be a
way to do it with some fancy
> javascript and a web page reload but I'm
not sure how.
>
> -- Jacqueline Landman Gay
>
Actually, you can
make a revlet resize based on the width and height of the web browser -
I can't remember where I picked up this trick, but here it goes:
-
create a new stack "ResizableRevlet" and draw an oval graphic on it
-
set the stack script to:
##
on preOpenStack
-- resizeStack isn't sent
to the revlet at startup
-- so we have to trigger it ourselves in
preOpenStack
dispatch "resizeStack" with (the width of me), (the
height of me)
pass preOpenStack
end preOpenStack
on resizeStack
pNewWidth, pNewHeight
set the rectangle of graphic "Oval" to \
10, 10, (pNewWidth - 10), (pNewHeight - 10)
pass resizeStack
end
resizeStack
##
- play around with it first to make sure the resize
works
- perhaps add some color to the oval graphic
- now build it as a
standalone for the Web
- your web browser will open, but no resizing
happens
- modify the file 'test.html' in the build directory
-> change
the block:
##
<embed type="application/x-revolution"
src="
ResizableRevlet.revlet"
width=400 height=400
stack="
ResizableRevlet"
requestedName=""
instanceID=""
></embed>
##
->
to:
##
<embed type="application/x-revolution"
src="ResizableRevlet.
revlet"
width="80%" height="80%"
stack="ResizableRevlet"
requestedName=""
instanceID=""
></embed>
##
- now open the test.html
file again in your web browser
-> the revlet area should occupy 80% of
the browser window and resize as you resize the browser window
-> it
may flicker and/or temporarily show a gray or white area though, so use
this technioque sparingly
However, if you want to resize this based on
other parameters, I wish you the best of luck with JavaScript and HTML
DOM fiddling ;-)
HTH,
Jan Schenkel.
=====
Quartam Reports & PDF
Library for LiveCode
www.quartam.com
=====
"As we grow older, we grow both wiser and more
foolish at the same time." (La Rochefoucauld)
_______________________________________________
use-livecode mailing
list
use-livecode at lists.runrev.com
Please visit this url to subscribe,
unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
many thanks jan
......i have a lot to learn now
mario
More information about the use-livecode
mailing list