Re: Set font size of a label using Pango attributes
- From: oldtechaa <oldtechaa gmail com>
- To: gtk-perl-list gnome org
- Subject: Re: Set font size of a label using Pango attributes
- Date: Sat, 30 Dec 2017 20:46:42 -0500
The final code is:
use strict;
use warnings;
use Gtk3 -init;
use Pango;
my $window = Gtk3::Window->new( 'toplevel' );
$window->signal_connect( destroy => sub { Gtk3->main_quit() } );
my $label = Gtk3::Label->new('Hello world!');
my $attrlist = Pango::AttrList->new();
my $attr = Pango::AttrSize->new(8000);
Pango::AttrList::insert($attrlist, $attr);
Gtk3::Label::set_attributes($label, $attrlist);
$window->add( $label );
$window->set_default_size( 200, 200 );
$window->set_position('center_always');
$window->show_all();
Gtk3->main();
Hope this helps,
oldtechaa
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]