Rich text - inject html

Just starting out? Need help? Post your questions and find answers here.
mdp
Posts: 31
Joined: Fri Oct 06, 2017 10:37 am

Rich text - inject html

Post by mdp »

Which gadgets allow for displaying rich text? Preferably not 2DDrawing: selectable text.
In PB, I think of at least the Console (the colors and position) and the ScintillaGadget (everything but making coffee).

As a possible way: can SetGadgetText inject HTML?
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Rich text - inject html

Post by falsam »

mdp wrote:As a possible way: can SetGadgetText inject HTML?
You're talking about HTML injection, so I'll assume you know the subject.

Code: Select all

Define Buffer.s
OpenWindow(0, 0, 0, 0, 0, "", #PB_Window_Background)
TextGadget(1, 10, 10, 400, 500, "")

Buffer = "<h1>can SetGadgetText inject HTML?</h1>"
Buffer + "<h1 style='color:blue;'><em>Yes you can<em></h1>"
Buffer + "<br>" 
Buffer + "<p style='border:2px solid powderblue;padding: 30px;'>"
Buffer + "This is a paragraph.</p>"
SetGadgetText(1, Buffer)

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
mdp
Posts: 31
Joined: Fri Oct 06, 2017 10:37 am

Re: Rich text - inject html

Post by mdp »

Excellent, this should be enough to provide the flexibility.

Do you happen to know what the "code area" of the "SB online example showcase" is? I would guess a TextGadget with html content through a "rich" SetGadgetText.
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Rich text - inject html

Post by falsam »


➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
Post Reply