Warning: file_put_contents(): Only -1 of 58 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
Packing Widgets Prev   Fixed layout Next This container has no own layouting logic; you have to tell where the widget shall be placed. The size of widgets is determined automatically, but can overr...
Forum und email

Fixed layout

This container has no own layouting logic; you have to tell where the widget shall be placed. The size of the widgets is determined automatically, but you can override that by requesting a certain size via set_size_request() .

While it's very simple to place and layout the widgets, they are fixed: Resizing the window doesn't move or resize the widgets. Use it only when it's absolute necessary; dynamic containers are often the better choice.

Example 7.3. Fixed layout with GtkFixed

<?php
$w = new GtkWindow();
$w->set_title('GtkFixed test');
$w->connect_simple('destroy', array('gtk', 'main_quit'));

$btn = new GtkButton('Button');
$txt = new GtkEntry();

$fixed = new GtkFixed();
$w->add($fixed);

$fixed->put($btn, 10, 100);
$fixed->put($txt, 50, 10);
$btn->set_size_request(150, -1);

$w->show_all();
Gtk::main();
?>