Re: Fix the size of the elements
| From: | Benjamin Smith | Date: | Sat, 04 Dec 2004 01:50:33 +0000 |
| Subject: | Re: Fix the size of the elements | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5305@lists.php.net to get a copy of this message | ||
See Set_Usize()
http://gtk.php.net/manual/en/gtk.gtkwidget.method.set_usize.php
-Ben
On Friday 03 December 2004 14:20, difenza2003\@libero\.it wrote:
> I have a created a simple application with PHP-GTk but i don't not more
happy of
> look of any widget.
> The problem is that i not to be able to manage the size of widgets like
buttons.
> This code shows for overview:
> <?php
> //main.php
>
> dl('php_gtk.so');
>
> $window = &new GTkWindow();
> $window->connect_object('destroy', array('gtk', 'main_quit'));
> $window->set_title('kioto');
> $window->set_policy(false, false, false);
> $window->set_border_width(8);
> $table = &new GTkTable(4, 5, false);
> $table->set_row_spacings(6);
> $table->set_col_spacings(6);
> $table->set_border_width(10);
>
> $label1 = &new GTkLabel('Select item');
> $search = &new GTkButton('Search...');
>
> $apply = &new GTkButton('Update');
> $cancel = &new GTkButton('Cancel');
>
> $table->attach($label1, 0, 1, 0, 1);
> $table->attach($search, 4, 5, 0, 1);
> $box = &new GTkVbox(6);
> $footer = &new GTkTable(1, 4);
> $footer->set_col_spacings(4);
> $footer->set_border_width(4);
> $footer->attach($apply, 2, 3, 0, 1);
> $footer->attach($cancel, 3, 4, 0, 1);
>
> $frame = &new GTkFrame('Shareware Folder');
> $frame->add($table);
>
> $align = &new GTKAlignment(1.0, 1.0, 0.0, 0.0);
> $align->add($footer);
>
> $frame2 = &new GTkFrame('General info');
> $table2 = &new GTkTable(3, 5, false);
> $table2->set_col_spacing(3, 15);
> $clist = &new GTkClist(3, array("Client", "Computer",
> "E-mail"));
> $clist->set_column_width(0, 80);
> $clist->set_column_width(1, 80);
> $clist->set_column_width(2, 80);
> $add = &new GTkButton('Add');
> $modify = &new GTkButton('Modify');
> $table2->attach($clist, 0, 3, 0, 2);
> $table2->attach($add, 4, 5, 0, 1);
> $table2->attach($modify, 4, 5, 1, 2);
> $frame2->add($table2);
>
> $frame3 = &new GTkFrame('hour for execution');
> $table3 = &new GTkTable(2, 4, false);
> $table3->set_col_spacings(6);
> $h = &new GTkLabel('hours:');
> $hour = &new GTkAdjustment(0.0, 0.0, 23.0, 1.0, 0.0, 0.0);
> $hours = &new GTkSpinButton($hour, 0, 0);
> $hours->set_wrap(true);
> $m = &new GTkLabel('minutes:');
> $minute = &new GTkAdjustment(0.0, 0.0, 59.0, 1.0, 0.0, 0.0);
> $minutes = &new GTkSpinButton($minute, 0, 0);
> $minutes->set_wrap(true);
>
> $table3->attach($h, 0, 1, 0, 1);
> $table3->attach($hours, 1, 2, 0, 1);
> $table3->attach($m, 2, 3, 0, 1);
> $table3->attach($minutes, 3, 4, 0, 1);
> $frame3->add($table3);
>
> $box->pack_start($frame);
> $box->pack_start($frame3);
> $box->pack_start($frame2);
> $box->pack_start($align);
> $window->add($box);
> $window->show_all();
>
> gtk::main();
> ?>
> The problem is the size of the button that i don't manage : the first button
is
> too much large
> and the button place on the right side of clist is not much large.
> How to define with much more precision the size of this element.
> Thaks so much and sorry for my bad english.
>
>
>
> ____________________________________________________________
> Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
> Abbonati subito su http://www.libero.it
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
"I kept looking around for somebody to solve the problem.
Then I realized I am somebody"
-Anonymous