PHP-GTK
Monday, September 01, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkScrolledWindow::set_hadjustment
GtkScrolledWindow::set_policynext

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

GtkScrolledWindow::set_placement

Determines the location of the child widget with respect to the scrollbars.

The default is Gtk::CORNER_TOP_LEFT, meaning the child is in the top left, with the scrollbars underneath and to the right. Other values in GtkCornerType are Gtk::CORNER_TOP_RIGHT, Gtk::CORNER_BOTTOM_LEFT, and Gtk::CORNER_BOTTOM_RIGHT.

Example 112. Placement types

<?php
//This examples shows what the different
// corner types look like
 
//Create first scrolled window
$scr_tl = new GtkScrolledWindow();
//Add a label on top of a viewport that is
// child of the scrolled window
$scr_tl->add_with_viewport(
    new GtkLabel('Gtk::CORNER_TOP_LEFT')
);
//Set the children placement to top+left
$scr_tl->set_placement(Gtk::CORNER_TOP_LEFT);
 
 
//Create the second scrolled window
$scr_bl = new GtkScrolledWindow();
//Again, a viewport with a label as child
$scr_bl->add_with_viewport(
    new GtkLabel('Gtk::CORNER_BOTTOM_LEFT')
);
//Now, we set the placement to bottom+left
$scr_bl->set_placement(Gtk::CORNER_BOTTOM_LEFT);
 
 
//Third for top+right
$scr_tr = new GtkScrolledWindow();
$scr_tr->add_with_viewport(
    new GtkLabel('Gtk::CORNER_TOP_RIGHT')
);
$scr_tr->set_placement(Gtk::CORNER_TOP_RIGHT);
 
 
//And the last: child at bottom+right
$scr_br = new GtkScrolledWindow();
$scr_br->add_with_viewport(
    new GtkLabel('Gtk::CORNER_BOTTOM_RIGHT')
);
$scr_br->set_placement(Gtk::CORNER_BOTTOM_RIGHT);
 
 
//Add all the scrolled windows to a table
$tbl = new GtkTable(3, 3);
$tbl->attach($scr_tl, 0, 1, 0, 1);
$tbl->attach($scr_tr, 2, 3, 0, 1);
$tbl->attach($scr_bl, 0, 1, 2, 3);
$tbl->attach($scr_br, 2, 3, 2, 3);
 
 
//Standard window creation stuff
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
$wnd->add($tbl);
$wnd->show_all();
Gtk::main();
?>

See also: get_placement()


User Contributed Notes
gtk.gtkscrolledwindow.method.set_placement.php
add a note about notes
There are no user contributed notes for this page.


previousGtkScrolledWindow::set_hadjustment
GtkScrolledWindow::set_policynext

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