QB64 Phoenix Edition
putting a clickable hyperlink in your qb64pe program? - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: putting a clickable hyperlink in your qb64pe program? (/showthread.php?tid=4023)



putting a clickable hyperlink in your qb64pe program? - madscijr - 10-21-2025

Is there a way to do this? i.e., put a clickable link on a text screen or a graphic screen, that opens a URL in whatever the user's default browser is? 

Google seems to think there is a LINK command, e.g., 
Code: (Select All)
LINK "http://www.qb64.org"
but that just gets me a syntax error, and I'm not finding anything in the wiki or searching the forums, but maybe I'm doing it wrong.


RE: putting a clickable hyperlink in your qb64pe program? - madscijr - 10-21-2025

Primitive, but that should work. 
Thanks! 

PS Hey, didn't QB64PE get some networking functionality in the last few versions? I vaguely recall someone saying some http or tcpip functions were coming that would let you open a URL, or is that just me hallucinating & confusing dreams with reality?


RE: putting a clickable hyperlink in your qb64pe program? - ahenry3068 - 10-21-2025

(10-21-2025, 11:35 PM)madscijr Wrote: Is there a way to do this? i.e., put a clickable link on a text screen or a graphic screen, that opens a URL in whatever the user's default browser is? 

Google seems to think there is a LINK command, e.g., 
Code: (Select All)
LINK "http://www.qb64.org"
but that just gets me a syntax error, and I'm not finding anything in the wiki or searching the forums, but maybe I'm doing it wrong.
Rho gave you the right answer.    In linux you want to precede the link with xdg-open http://mylink  for the shell target.  I use START also in Windows.   I actually use an OpenCMD$ and set it's value with 
         $IF WINDOWS THEN
                 OpenCmd$ = "START "
           $END IF

           $IF LINUX THEN 
                 OpenCmd$ = "xdg-open  "
           $END IF

           $IF MAC THEN
                 OpenCmd$ = "open "
            $END IF

SHELL OpenCmd$ + "http://mylink.to.here"


RE: putting a clickable hyperlink in your qb64pe program? - madscijr - 10-22-2025

SWEET! 

Thank you, @ahenry3068!


RE: putting a clickable hyperlink in your qb64pe program? - Pete - 10-22-2025

And for you SCREEN 0 fans, a way using hardware acceleration to underline a link...

Code: (Select All)
Palette 7, 63: Color 0, 7: Cls
a$ = "https://qb64phoenix.com"
j = Len(a$)
Color 1: Print a$: Color 0
Print "Pete's tremendous while Steve's just amazing!"
CRed = 0: CGrn = 0: CBlu = 155
t = _NewImage((j + 1) * 8, 2 * 16, 32)
_Dest t
Line (0, _FontHeight * 1 - 3)-(j * _FontWidth, _FontHeight * 1 - 3), _RGB32(CRed, CGrn, CBlu), B
lin = _CopyImage(t, 33)
_FreeImage t
_Dest 0
Do
    _Limit 10
    _PutImage ((1 - 1) * 8, (1 - 1) * 16), lin
    _Display
Loop

Of course this can be expanded to detect links, follow link, as discussed in the posts above, and the underlining part could also be expanded into a sub or function to find the links on the screen and underline them.

Pete

- Helping the QB664 community one boast post at a time.


RE: putting a clickable hyperlink in your qb64pe program? - grymmjack - 10-23-2025

(10-22-2025, 03:49 PM)Pete Wrote: And for you SCREEN 0 fans, a way using hardware acceleration to underline a link...

Code: (Select All)
Palette 7, 63: Color 0, 7: Cls
a$ = "https://qb64phoenix.com"
j = Len(a$)
Color 1: Print a$: Color 0
Print "Pete's tremendous while Steve's just amazing!"
CRed = 0: CGrn = 0: CBlu = 155
t = _NewImage((j + 1) * 8, 2 * 16, 32)
_Dest t
Line (0, _FontHeight * 1 - 3)-(j * _FontWidth, _FontHeight * 1 - 3), _RGB32(CRed, CGrn, CBlu), B
lin = _CopyImage(t, 33)
_FreeImage t
_Dest 0
Do
    _Limit 10
    _PutImage ((1 - 1) * 8, (1 - 1) * 16), lin
    _Display
Loop

Of course this can be expanded to detect links, follow link, as discussed in the posts above, and the underlining part could also be expanded into a sub or function to find the links on the screen and underline them.

Pete

- Helping the QB664 community one boast post at a time.

Whoa, that's so cool @Pete - so like it has textmode then overlays the image on top in the hardware layer?


RE: putting a clickable hyperlink in your qb64pe program? - grymmjack - 10-23-2025

(10-23-2025, 03:47 PM)grymmjack Wrote:
(10-22-2025, 03:49 PM)Pete Wrote: And for you SCREEN 0 fans, a way using hardware acceleration to underline a link...

Code: (Select All)
Palette 7, 63: Color 0, 7: Cls
a$ = "https://qb64phoenix.com"
j = Len(a$)
Color 1: Print a$: Color 0
Print "Pete's tremendous while Steve's just amazing!"
CRed = 0: CGrn = 0: CBlu = 155
t = _NewImage((j + 1) * 8, 2 * 16, 32)
_Dest t
Line (0, _FontHeight * 1 - 3)-(j * _FontWidth, _FontHeight * 1 - 3), _RGB32(CRed, CGrn, CBlu), B
lin = _CopyImage(t, 33)
_FreeImage t
_Dest 0
Do
    _Limit 10
    _PutImage ((1 - 1) * 8, (1 - 1) * 16), lin
    _Display
Loop

Of course this can be expanded to detect links, follow link, as discussed in the posts above, and the underlining part could also be expanded into a sub or function to find the links on the screen and underline them.

Pete

- Helping the QB664 community one boast post at a time.

Whoa, that's so cool @Pete - so like it has textmode then overlays the image on top in the hardware layer?

A fun thing to try would be a markdown parser/reader. Detecting links, making them clickable, formatting headings, bold, italic, etc. Smile

Anyway thanks again for sharing @Pete


RE: putting a clickable hyperlink in your qb64pe program? - Pete - 10-25-2025

Hey Gym, glad you found it useful.

I haven't had the time to code with it yet, but I do have a project I'm adding it to, which will do the things you mentioned.

Pete


RE: putting a clickable hyperlink in your qb64pe program? - SMcNeill - 10-25-2025

https://qb64phoenix.com/forum/showthread.php?tid=2480   <-- Hyperlinks in text and action words.   I don't want to copy resource files and such over again, so kindly take a moment and go to this old post and you'll see a working demo of this.


RE: putting a clickable hyperlink in your qb64pe program? - Pete - 10-29-2025

@grymmjack

Posted my hyperlink demo here: https://qb64phoenix.com/forum/showthread.php?tid=4051&pid=36826#pid36826

Pete