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

2.7.gif

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

  1. Set the size of the button.
  2. Stuff the button in hbox with expand=false.
  3. Stuff the hbox in vbox with expand=false.


User reviews

There are no user reviews yet.

Note: You have to be a registered member to leave a comment. Free registration here.

 
< Prev   Next >

Copyright © 2006-2008. kksou.com. All Rights Reserved