GtkAlignment::set

GtkAlignment::set

This method sets new values for a GtkAlignment's parameters.

Example 1. Resetting GtkAlignment parameters.

<?php

dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));

function change_it($align, &$i) {
  if($i%2) $align->set(1.0, 1.0, 0.4, 0.3);
  elseif($i%3) $align->set(0.0, 0.0, 0.6, 0.2);
  else $align->set(0.0, 1.0, 0.1, 0.2);
  $i++;
  }

$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_CENTER);
$window->set_default_size((gdk::screen_width()-10), 
(gdk::screen_height()-30));
$window->connect_object('destroy', array('gtk', 'main_quit'));

$align = &new GtkAlignment(0.5, 0.5, 1.0, 1.0);
$button = &new GtkButton("Click Here");
$i = 0;
$button->connect_object('enter', 'change_it', $align, &$i);
$align->add($button);
$align->show_all();

$window->add($align);
$window->show_all();

gtk::main();

?>

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.