cvs: php-gtk-doc /examples/reference/gtk/gtklabel set_attributes.phpw

From: Date: Mon, 10 Apr 2006 20:45:45 +0000
Subject: cvs: php-gtk-doc /examples/reference/gtk/gtklabel set_attributes.phpw
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-2316@lists.php.net to get a copy of this message
scottmattocks Mon Apr 10 20:45:45 2006 UTC Modified files: /php-gtk-doc/examples/reference/gtk/gtklabel set_attributes.phpw Log: Somehow I committed the wrong file as set_attributes. http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw diff -u php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw:1.1 Mon Apr 10 19:48:56 2006 +++ php-gtk-doc/examples/reference/gtk/gtklabel/set_attributes.phpw Mon Apr 10 20:45:45 2006 @@ -1,19 +1,23 @@ <?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 three labels with long text. -$label1 = new GtkLabel('This label has lots of text. It should be ellipsized'); -$label2 = new GtkLabel('This label has lots of text. It should be ellipsized'); -$label3 = new GtkLabel('This label has lots of text. It should be ellipsized'); - -// Set the ellipsization mode for all three labels. -$label1->set_ellipsize(Pango::ELLIPSIZE_START); -$label2->set_ellipsize(Pango::ELLIPSIZE_MIDDLE); -$label3->set_ellipsize(Pango::ELLIPSIZE_END); +// 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); @@ -21,4 +25,4 @@ // Show the window and start the main loop. $window->show_all(); Gtk::main(); -?> \ No newline at end of file +?>

« previous php.gtk.doc (#2316) next »