PHP-GTK
Saturday, November 22, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkSizeGroup
GtkSizeGroup::add_widgetnext

Last updated: Sun, 12 May 2013
view this page in English

GtkSizeGroup Constructor

A GtkSizeGroup is not a widget taking up any space, rather providing additional bindings between widgets.

At first, create your application as you would do normally: Instantiate widgets, add them to containers and so. After that, create a GtkSizeGroup and add widgets to it with add_widget() and the widgets will magically have the same size.

Example 114. Using a GtkSizeGroup

<?php
//we create two buttons:
// one has two lines, being higher than the second
$oh = new GtkButton("Oh!\nOh!");
// the other has a longer text, making it wider
// than the first
$longer = new GtkButton('This is a longer text');
 
$box = new GtkHBox();
$box->pack_start($oh);
$box->pack_start($longer);
 
//but GtkSizeGroup saves the day:
// both buttons get the same height and width!
$group = new GtkSizeGroup(Gtk::SIZE_GROUP_BOTH);
$group->add_widget($oh);
$group->add_widget($longer);
 
$wnd = new GtkWindow();
$wnd->set_border_width(10);
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->add($box);
$wnd->show_all();
Gtk::main();
?>

User Contributed Notes
gtk.gtksizegroup.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkSizeGroup
GtkSizeGroup::add_widgetnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:00 2013 CEST