PDA

View Full Version : view & bgcolor


vis
06-10-2003, 08:48 PM
Hello, Laszlo people !

Just find out, that this example does not work:

<canvas>
<view width="100" height="100" bgcolor="#FF0000">
<method event="oninit">
this.tmpview = new LzView(this, { bgcolor : "#00FF00", width : 50, height : 50});
</method>
</view>
</canvas>

It should show a small green box on top of the big red box. Right ? It shows the black box instead of green.

Of course, you can make something like:

<canvas>
<view width="100" height="100" bgcolor="#FF0000">
<method event="oninit">
this.tmpview = new white_box(this, { width : 50, height : 50});
</method>
</view>
<class name="white_box" extends="view" bgcolor="#00FF00">
</class>
</canvas>

But should the first example works ?

antun
06-10-2003, 10:29 PM
I think it's because of the way you're specifiying the color - in tags you can use "red" and #ff00000, but in script you have to use hex notation beginning with 0x, so:


this.tmpview = new LzView(this, { bgcolor : 0x00FF00, width : 50, height : 50});


... should work.

-Antun

vis
06-11-2003, 11:36 AM
Antun,

You are right. This is works! Thanks a lot!
Sometimes you want to think, that Laszlo should work like HTML/JavaScript, but this is wrong... Laszlo is different and better.

-- Igor'