Couple of questions about the browser widget

Terry Judd terry.judd at unimelb.edu.au
Tue Aug 15 22:10:17 EDT 2017


Hi Mike – yeah thanks, the temp file approach for setting the browser widget and getting an image to display works well so maybe easiest to go that way. I’m still steeling myself for a foray into javascript so haven’t tried anything on that front yet. I’ve got some Dropbox library related stuff to distract me first though.

Regards,

Terry...

On 16/08/2017 10:53 am, "use-livecode on behalf of Mike Bonner via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    I haven't managed yet. (can't get it to fire, but hey.. did I mention i'm
    no good at javascript?)
    
    Also I noticed, setting the htmltext of the widget seems to run through a
    urlencode. (I had a sample page in a field and was setting the htmltext to
    it, but it got totally munged.. So I've been creating a temp file and
    setting the url which works..)
    
    To show an image you can use something like this..
    
    <img src="file:///C:/Users/Mike/Desktop/dtstuff/billiewow.jpg">
    
    (windows of course) Getting the javascripthandlers to work might take the
    input of another. I can't seem to make it go. (Note also, I looked in the
    dictionary for the browser widget and used the example code there for the
    "set the javascripthandlers..' part.. but the example needs to be fixed.
    You need to specify the widget.
    set the javascripthandlers of widget "mywidge" to "whatever*
    
    
    
    On Tue, Aug 15, 2017 at 6:34 PM, Terry Judd via use-livecode <
    use-livecode at lists.runrev.com> wrote:
    
    > Thanks for your help Mike – I’m no good at Javascript either ;) but
    > thankfully there is plenty of stuff out there on the web written by people
    > that are. I’ll give it a go and see if I can make it work.
    >
    > Regards,
    >
    > Terry...
    >
    > On 16/08/2017 10:23 am, "use-livecode on behalf of Mike Bonner via
    > use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of
    > use-livecode at lists.runrev.com> wrote:
    >
    >     For the second question, if your htmltext contains a javascript
    > function
    >     that returns document.body.scrollHeight you should be able to get the
    >     height that way.    I'm not any good at javascript, but how it would
    >     probably work would be to have something like this..
    >
    >     window.onload = function(e){
    >          livecode.myHeight('lcHeight",document.body.scrollHeight)
    >      }
    >
    >     Then have an lcHeight handler defined in your stack to receive the
    > message.
    >
    >     command lcHeight pHeight
    >        -- do something with pHeight
    >     end lcheight
    >
    >     Then of course you have to declare the handler..
    >
    >     set the javascripthandlers to "lcHeight"
    >
    >     I haven't actually done this, but think the idea is close enough to
    > get you
    >     there.
    >
    >     On Tue, Aug 15, 2017 at 5:55 PM, Terry Judd via use-livecode <
    >     use-livecode at lists.runrev.com> wrote:
    >
    >     > I’m thinking about replacing a field object that contains text,
    > inline
    >     > images and simple tables with the browser widget but there are a
    > couple of
    >     > issues I’d need to work through first and would welcome any
    > suggestions or
    >     > ideas.
    >     >
    >     > The first one concerns displaying local images – either stored
    >     > (permanently or temporarily) within the stack itself or in the local
    >     > documents/whatever folder. I’d like to set the htmlText of the
    > browser
    >     > rather than a url. If that’s the case, how do I refer to the image
    > in order
    >     > for it to be displayed?
    >     >
    >     > The second one is whether it is possible to get the
    > ‘formattedHeight’ of
    >     > the browser content. I’d ideally like to combine the browser with a
    > couple
    >     > of other grouped controls so that I can scroll them as a single
    > object. Is
    >     > that doable?
    >     >
    >     > Regards,
    >     >
    >     > Terry...
    >     > _______________________________________________
    >     > 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
    >     _______________________________________________
    >     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
    >
    >
    > _______________________________________________
    > 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
    >
    _______________________________________________
    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
    



More information about the Use-livecode mailing list