iphonecontrolset browser

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

iphonecontrolset browser

Post by teacherguy » Mon Feb 20, 2012 3:50 pm

I see how you can change the background color of the area behind the "bounce" but is there a way to change the standard white background of the browser to say black?

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: iphonecontrolset browser

Post by gpb01 » Mon Feb 20, 2012 4:26 pm

You can use

Code: Select all

iphoneControlSet browserID, "backgroundColor", "R,G,B,A"
... where browserID is the Id of your browser, R,G,B are the color values and the A is the Alpha channel for the transparency.

Guglielmo

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: iphonecontrolset browser

Post by teacherguy » Mon Feb 20, 2012 6:15 pm

But that is for the area behind the bounce, unless I'm not understanding...

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: iphonecontrolset browser

Post by Klaus » Mon Feb 20, 2012 6:45 pm

Hi teacherguy,

looks like you cannot do this directly but only with an appropriate HTML page.
One with its background color set in the html/css source.


Best

Klaus

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: iphonecontrolset browser

Post by gpb01 » Mon Feb 20, 2012 6:45 pm

Sorry teacherguy, maybe is me that not understanding ...
... to be clear ... do you want to change 1) the background color of the html page that you show in the browser window or 2) the background color of the browser window itself ?

Because the first you can do in the html code, the second with the statement that I have shown you ... :)

Guglielmo

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: iphonecontrolset browser

Post by teacherguy » Mon Feb 20, 2012 7:31 pm

I would like to change the white of the actual html page. I am loading an image file into it and I would rather the image have black behind it, not white.

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: iphonecontrolset browser

Post by Klaus » Mon Feb 20, 2012 7:36 pm

Hi teacherguy,

this is ruled by the HTML/CSS code of the page!
So change the HTML/CSS you are going to display if you can! 8)


Best

Klaus

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: iphonecontrolset browser

Post by teacherguy » Mon Feb 20, 2012 7:38 pm

Ah, my latest chapter in being clue-less begins!!

I am loading images from a file stored locally on the iPhone into a browser instance. So.....what html/css is there in that? :shock:

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: iphonecontrolset browser

Post by Klaus » Mon Feb 20, 2012 7:54 pm

Hi teacherguy,

AHA! :D

Well, in that case there is no HTML involved, right.
Then you cannot change the background color of the display 8)

But maybe you can create a (temporary) html source on the fly and "embed"
your image(s) into that page via an <img> html tag...


Best

Klaus

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: iphonecontrolset browser

Post by sturgis » Mon Feb 20, 2012 7:56 pm

EDIT: Klaus is too darn fast. What he said!

So you're just pointing at the image file itself? Then yeah, no way to set any html/css attributes.

However, html as simple as the following should work..
<html><body bgcolor="#000000">
<img src="replace/with/path/to/image.jpg">
</body></html>

I don't think you can set the htmltext of the ios browser control directly, maybe write the file to the temporary folder then load it up from there with <img src= pointing to the image you wish to display.

Could even use merge for this. Put the path to the image into a variable, have the simple html source in a property and change <img src="[[variablename]]"> so that you can: put merge(the htmlthingy of this stack) into url "binfile:path/to/myhtmlpage.html"

teacherguy wrote:Ah, my latest chapter in being clue-less begins!!

I am loading images from a file stored locally on the iPhone into a browser instance. So.....what html/css is there in that? :shock:

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: iphonecontrolset browser

Post by teacherguy » Mon Feb 20, 2012 8:21 pm

Thanks, so first step is to create an html file that is saved locally on the iphone that I will load the merged info to, and then I'm loading that file into the browser instance?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: iphonecontrolset browser

Post by sturgis » Mon Feb 20, 2012 11:46 pm

teacherguy wrote:Thanks, so first step is to create an html file that is saved locally on the iphone that I will load the merged info to, and then I'm loading that file into the browser instance?
Pretty much, yeah. I have no way to actually test on iphone/ipad but as klaus said, a small html file that sets the bgcolor and has an <img.. tag pointing to the image itself should work. (tried it in the desktop, works there but without the ability to test on ios, can't tell you what issues you might have)

Post Reply