PHP-GTK2 Newsletter

PHP-GTK2 Tips & Techniques
FREE Newsletter
by kksou




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.

 

Add comment


Security code
Refresh

< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Links - Classes - Social Business - BPM - Web - General
Copyright © 2006-2013. kksou.com. All Rights Reserved