PHP-GTK
Tuesday, July 29, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkLabel::set_angle
GtkLabel::set_ellipsizenext

Last updated: Sun, 12 May 2013
view this page in English

GtkLabel::set_attributes

Sets the Pango attributes for the label to those defined by list. The attributes set by list will be ignored if either use_underline or user_markup is true.

Example 82. Setting a List of Pango Attributes for a GtkLabel

<?php
// Create a window to hold the label.
$window = new GtkWindow();
// Set up the window to close cleanly.
$window->connect_simple('destroy', array('Gtk', 'main_quit'));
 
// Create a label
$label = new GtkLabel('Bold Label');
 
// Create a Pango attribute list.
$list = new PangoAttrList();
 
// Create a bold Pango weight attribute.
$attr = new PangoAttrInt(Pango::ATTR_WEIGHT, Pango::WEIGHT_BOLD);
 
// Add the attribute to the list.
$list->insert($attr);
 
// Set the attributes for the label.
$label->set_attributes($list);
 
// Add the label to the window.
$window->add($label);
 
// Show the window and start the main loop.
$window->show_all();
Gtk::main();
?>

See also: get_attributes()


User Contributed Notes
gtk.gtklabel.method.set_attributes.php
add a note about notes
There are no user contributed notes for this page.


previousGtkLabel::set_angle
GtkLabel::set_ellipsizenext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:50:59 2013 CEST