2.7 Set the size of button |
|
Written by kksou
|
|
Monday, 24 March 2008 |
Objective
Suppose now you want the button to be exactly of the size 96 x 36.
Overview
Sample Output

Sample Code
1 2 3 4 5 6 7 8 9 10 11
| <?php $window = new GtkWindow(); $window->connect_simple('destroy',array('Gtk','main_quit')); $window->set_size_request(200, 100); $vbox = new GtkVBox(); $window->add($vbox);
$button = new GtkButton('button1'); $button->set_size_request(96,36); // note 1
$hbox = new GtkHBox(); $hbox->pack_start($button, false); // note 2
|
- Note that this is only 70% of the sample code. You have to be a registered member to see the entire sample code. Please login or register.
- Registration is free and immediate.
- Have some doubt about the registration? Please read this forum article.
Explanation
- Set the size of the button.
- Stuff the button in hbox with
expand=false.
- Stuff the hbox in vbox with
expand=false.
|