20. Tooltip and hyperlink

A "tooltip" link type can display a hint with (rich) text, and a "hyperlink" link can open a browser.

mainwindow

use Prima qw(Application Label Buttons);
use Prima::Drawable::Markup q(M);

my $mw = Prima::MainWindow-> create(
	text    => "Tooltip and hyperlink",
	sizeMin => [500, 150],
	sizeMax => [500, 150],
	icon => Prima::Icon-> load('icon.png'),	
);

$::application->set(
	hintBackColor => 0xffffff,
	hintColor => 0x000000,
	hintPause => 0, 
);

$mw-> borderIcons(bi::SystemMenu);

# The text property has the code for tooltip and hyperlink. Notice also the use of \n\n (double line break)
# The content for the two tooltips ('writing' and 'website') is between =pod...=cut at the end of this code
$mw-> insert( 
	Label => 
		origin => [0, 40],
		size   => [500, 140],	  
		linkColor => cl::Yellow,
		font => { size => 12, },
		text => \ "At the time of L<tip://$0/t1|writing> my code snippets for my L<tip://$0/t2|website>, I used Perl 5.36 - 5.38 on ArcoLinux. Click the hyperlink: \n\nL<https://www.arcolinux.com|arcolinux.com>",          
		alignment => ta::Center,	
		wordWrap => 1,
);

$mw-> insert(
	Button =>
		origin => [(500/2)-50, 20],		
		size => [100, 30],
		text => 'Exit', 
		onClick => sub { $::application-> close },
);

run Prima;

=pod
 
=head1 t1
 
started in 2023 (tooltip)

=head1 t2

reiniermaliepaard.nl (tooltip)

=cut