Problem with new window
| From: | difenza2003\@libero\.it | Date: | Tue, 07 Dec 2004 17:17:22 +0000 |
| Subject: | Problem with new window | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5314@lists.php.net to get a copy of this message | ||
I have created a function that create when called open a window for the input of
users.
When i call more time the function to open the window dialog a receive critical
error like this:
This is the code to verify the problem:
<?php
//test.php
$input_client = &new GTkEntry();
$input_computer = &new GTkEntry();
$input_email = &new GTkEntry();
function go_down($window) {
$window->destroy();
return false;
}
function client_data() {
global $clist, $input_client, $input_computer, $input_email;
$window = &new GTkWindow();
$window->set_title('Insert data');
$window->set_policy(false, false, false);
$window->set_border_width(8);
$window->connect_object('destroy', 'go_down', $window);
//Table for accomodate all widget
$table = &new GTkTable(3, 3, false);
$table->set_col_spacings(4);
$table->set_row_spacings(4);
$box = &new GTkVBox(0);
$client = &new GtkLabel('Client:');
$computer = &new GTkLabel('Computer:');
$email = &new GTklabel('E-mail:');
$table->attach($client, 0, 1, 0, 1);
$table->attach($input_client, 1, 2, 0, 1);
$table->attach($computer, 0, 1, 1, 2);
$table->attach($input_computer, 1, 2, 1, 2);
$table->attach($email, 0, 1, 2, 3);
$table->attach($input_email, 1, 2, 2, 3);
$box->pack_start($table);
///Table for update and cancel buttons
$update = &new GTkButton('Start');
$update->set_usize(60, 20);
$update->connect_object('clicked', 'go_down', $window);
$cancel = &new GtkButton('Cancel');
$cancel->connect_object('clicked', 'go_down', $window);
$cancel->set_usize(60, 20);
$table2 = &new GTkTable(1, 2, false);
$table2->set_col_spacings(4);
$table2->attach($update, 0, 1, 0, 1);
$table2->attach($cancel, 1, 2, 0, 1);
$fix_table = &new GTkFixed();
$fix_table->put($table2, 94, 30);
$box->pack_start($fix_table);
$window->add($box);
$window->show_all();
}
$window = &new GTkWindow();
$button = &new GTkButton('Hello GTk');
$button->connect('clicked', 'client_data');
$window->add($button);
$window->show_all();
gtk::main();
?>
Can you explain to fix the problem ?
Thank you so much.
____________________________________________________________
Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
Abbonati subito su http://www.libero.it