Alignment problems
| From: | Diego Feitosa | Date: | Sat, 03 Feb 2007 23:58:48 +0000 |
| Subject: | Alignment problems | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-7651@lists.php.net to get a copy of this message | ||
Hi all,
I'm working at an application and I couldn't figure out why the alignment properties isn't been applied properly...
My code is the following:
<?php
$window1 = new GtkWindow(Gtk::WINDOW_TOPLEVEL);
$window1->set_border_width(50);
$window1->set_title("window1");
$window1->set_modal(false);
$window1->set_resizable(true);
$window1->set_destroy_with_parent(false);
$window1->set_decorated(true);
$window1->set_skip_taskbar_hint(false);
$window1->set_skip_pager_hint(false);
$window1->set_gravity(Gdk::GRAVITY_NORTH_WEST);
$window1->set_focus_on_map(true);
$table1 = new GtkTable(2, 2, false);
//$table1->set_visible(true);
$table1->set_row_spacings(0);
$table1->set_col_spacings(0);
$button2 = new GtkButton();
$button2->set_visible(true);
$button2->set_label("button2");
$button2->set_use_underline(true);
$button2->set_relief(Gtk::RELIEF_NORMAL);
$button2->set_focus_on_click(true);
$table1->attach($button2, 1, 2, 0, 1, Gtk::EXPAND, Gtk::EXPAND);
$button1 = new GtkButton();
$button1->set_visible(true);
$button1->set_label("button1");
$button1->set_use_underline(true);
$button1->set_relief(Gtk::RELIEF_NORMAL);
$button1->set_focus_on_click(true);
$table1->attach($button1, 1, 2, 1, 2, Gtk::EXPAND, Gtk::EXPAND);
$label3 = new GtkLabel("This is a huge label");
/*
$label3->set_visible(true);
$label3->set_use_underline(false);
$label3->set_use_markup(false);
$label3->set_justify(Gtk::JUSTIFY_LEFT);
$label3->set_selectable(false);
$label3->set_ellipsize(Pango::ELLIPSIZE_NONE);
$label3->set_width_chars(-1);
$label3->set_single_line_mode(false);
$label3->set_angle(0);
*/
$table1->attach($label3, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK);
$alignment1 = new GtkAlignment(0.5, 0.5, 0.0, 0.0);
/*
$alignment1->set_visible(true);
$alignment1->set_padding(0, 0, 0, 0);
*/
$label2 = new GtkLabel("Small label");
/*
$label2->set_visible(true);
$label2->set_use_underline(false);
$label2->set_use_markup(false);
$label2->set_justify(Gtk::JUSTIFY_LEFT);
$label2->set_selectable(false);
$label2->set_ellipsize(Pango::ELLIPSIZE_NONE);
$label2->set_width_chars(-1);
$label2->set_single_line_mode(false);
$label2->set_angle(0);
*/
$alignment1->add($label2);
$table1->attach($alignment1, 0, 1, 1, 2, Gtk::EXPAND, Gtk::SHRINK, 1, 1);
$window1->add($table1);
$window1->show_all();
Gtk::main();
?>
What I'm trying to do is align the "Small label" at the left side...
Thanks to all!!
--
Diego Feitosa
www.dnfeitosa.com <http://www.dnfeitosa.com>