set_justify() not work?
| From: | Alistair Riddell | Date: | Sat, 18 Dec 2004 22:56:48 +0000 |
| Subject: | set_justify() not work? | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5367@lists.php.net to get a copy of this message | ||
Perhaps I'm missing something, but I can't get set_justify() and set_line_wrap() to work properly at the same time on a GtkLabel().
If I do set_justify(GTK_JUSTIFY_FILL) then it works as expected but if I do set_justify(GTK_JUSTIFY_CENTER) or set_justify(GTK_JUSTIFY_RIGHT) then the label is just left aligned.
See below for an example - the text in the window should be centred but instead is left-aligned.
Would be grateful for any pointers if I am doing something stupid!
<?php
dl('php_gtk.so');
$window = new GtkWindow();
$label = new GtkLabel();
$window->add($label);
$label->set_usize(100,100);
$label->set_text('this is a long line of text');
$label->set_line_wrap(TRUE);
$label->set_justify(GTK_JUSTIFY_CENTER);
$window->show_all();
gtk::main();
?>
--
Alistair Riddell - BOFH
IT Manager, George Watson's College, Edinburgh
Tel: +44 131 446 6070 Fax: +44 131 446 6090
Microsoft - because god hates us