Stumped by htmlText...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Stumped by htmlText...

Post by bogs » Thu Apr 09, 2020 7:46 pm

So this one got me today, I have a series of buttons (graphics) with very simple representations -
aPic_ourHouse.png
Our house, in the middle of the street...
aPic_ourHouse.png (4.31 KiB) Viewed 4171 times
...and I wanted the house to represent the 'home' button, so I found some html that coughed up that character like this...
🏠
which simply amounts to this...

Code: Select all

<font size="12" color="#000000">&#55356;&#57312;</font>
However, while I could get that to work in a field (which is currently sitting on the graphic), it would not work in a label for the graphic, so now the 2 questions that I have are
why didn't it work ?
and
how can a label be different from a field?

Thanks in advance for any illumination of the above.
Image

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

Re: Stumped by htmlText...

Post by Klaus » Thu Apr 09, 2020 8:10 pm

Not sure, but HTMLTEXT is the property of a field and LABEL is a property, too.
I don't think properties can have properties!? :D

Find a nice UNICODE character and there you go:

Code: Select all

...
set the label of grc 1 to numtocodepoint(0x1F3DB) 
...
Tested and works!

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Stumped by htmlText...

Post by bogs » Thu Apr 09, 2020 8:30 pm

I thought I had plenty of unicode versions, but I couldn't get THAT to work either heh.
aPic_unicodeEh.png
Unicode, eh?
I must just not be holding my jaw right :D
Klaus wrote:
Thu Apr 09, 2020 8:10 pm
HTMLTEXT is the property of a field
See, and here I was, thinking it was a form of styled text, applied to the text itself, wherever the text was sitting. For instance, I can set the bold of the text of a label, I could probably make it a link too (haven't had the need yet, but who knows).

Properties can't have properties I'd agree with, but text no matter where it is should be able to have styles applied to it, seems to me. Maybe I'm just off (more than usual).

Edit - I wonder if your numToCodePoint came after vers. 6.5, which is what I'm currently in heh. NumToChar works, though. Goofy.
Last edited by bogs on Thu Apr 09, 2020 8:38 pm, edited 1 time in total.
Image

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

Re: Stumped by htmlText...

Post by Klaus » Thu Apr 09, 2020 8:35 pm

According to the dictionary HTMLTEXT if a field-only property!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7392
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Stumped by htmlText...

Post by jacque » Fri Apr 10, 2020 6:26 pm

Codepoints, codeunits, etc were introduced after the Great Unicode Change in version 7.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Stumped by htmlText...

Post by bogs » Fri Apr 10, 2020 7:10 pm

That is out for sure then, I've yet to venture beyond 6.5.2 heh. I settled it by putting a field on top of the graphic, but it seems such a kludge to me.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Stumped by htmlText...

Post by richmond62 » Fri Apr 10, 2020 7:50 pm

I've yet to venture beyond 6.5.2
When I get fed up or tired I go and do some stuff with BBC BASIC on my MODEL B and save it onto a cassette tape.
-
BBCMB.jpg
BBCMB.jpg (6.53 KiB) Viewed 4052 times
-
But, when I want to use LiveCode the earliest version I deploy is 8.1.8
[mainly because 8.1.10 does not behave nicely on any of my machines running MacOS 10.7.5],
or 7.0.4 [on MacOS 10.6.8]; occasionally, when I crank up one of my PPC Macs I do use
6.whatever-was-the-last-version-to work-on-a-PPC-Mac.

So: realistically . . .

1. 8.1.8 on my 2006 iMacs running MacOS 10.7.5

2. 9.5.1 on my 2018 Mac Mini, and on my 32-bit Laptop (running LXDE at the mo'),
and on my 64-bit laptop (running Xubuntu 20.04 beta at the mo').

So . . . why do I feel someone is just being bloody-minded?

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Stumped by htmlText...

Post by bogs » Fri Apr 10, 2020 8:13 pm

Well, I still work with alot of old hardware running a lot of old OS'es, which I still program for, so the greater bulk of the (small amount of) free time I have is spent actually in the original Mc, using very old Mc engines. I am also still going through the OSS version of the same when I can spare the time.

When I am actually using Lc, I am most of the time in 1.1 or 2.2., unless I need to do something I just can't do in those (which is very rare). For instance, I had to pull down and look at some https: pages recently. For some reason, that did not work until I hit 6.7.x., even though https was available many versions earlier. Still haven't figured that one out.

The only time I even look at anything past that version is if:
1.) I actually have the time to look for bugs
2.) Someone here asks a question, and I can't figure it out in an older version

The old IDEs are much faster to start and work in and less prone to problems on my setup as well, and I often times just want to get some work done, rather than try to figure out why problem xyz happened.

As I am sure you know, on 'nix the dictionary doesn't exactly work like it does on (I think) every other platform because the browser widget doesn't work like it does on every other platform. At least, I assume it works on Mac and Win, I haven't actually tried it on Mac myself.

The players don't work too well on 'nix either, as far as I can tell, so where would be the joy in my subjecting myself to using a newer version of the IDE? Not to mention that I like the way the older IDEs look and feel, the newest version just looks like a dull, lifeless flat blah to me.

That is an opinion, btw, not a slam on the designer(s), I feel the same way about many OTHER programs that churned out that black and gray and nothing else look.

Bloddy minded? Nah, more like bloody lazy heh.
Image

Post Reply