Re: Problem with GtkWindow
| From: | Miles Phillips | Date: | Thu, 16 May 2002 00:13:08 +0000 |
| Subject: | Re: Problem with GtkWindow | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1994@lists.php.net to get a copy of this message | ||
I had a problem similiar to this I believe awhile back. Your window that
you are making in the tablas() function, actually needs to be declared above
as a global window, and the tablas() function and the crear() function need
to reference it. I believe this will work for you, if I understand your
delima correctly.
Miles Phillips
----- Original Message -----
From: "epplestun" <epplestun@alaplaya.com>
To: <php-gtk-general@lists.php.net>
Sent: Wednesday, May 15, 2002 5:55 PM
Subject: [PHP-GTK] Problem with GtkWindow
> Hello, I have a problem and ti is when I create a new GtkWindow with
> one function and then when I call to other function since this window
> the consola say me:
>
> <b>Fatal error</b>: Call to a member function on a non-object in
> <b>/root/php-gtk/php-eddi-dev/php/librerias/libreria.php</b> on line
> <b>113</b><br>
>
> I have this code to do:
>
> function crear($widget) {
> global $Gtk_Text,$Gtk_Filas;
> $filas = $Gtk_Filas->get_text();
> $Gtk_Text->insert_text(-1,$filas);
> $window = $widget->get_toplevel(); Gtk::grab_remove($window);
> $window->hide();
> }
>
> function tablas() {
> $tablas = &new gtkwindow();
> Gtk::grab_add($tablas);
> $tablas->set_border_width(10);
> $tablas->set_usize(300,125);
> $tablas->set_policy(FALSE,FALSE,FALSE);
> $tablas->set_position(GTK_WIN_POS_CENTER);
> $tablas->set_title("Insertar tablas");
> $vbox = &new GtkVBox();
> $hbox = &new GtkHBox();
> $hbox2 = &new GtkHBox();
> $titulo_tablas = &new GtkLabel("TABLAS");
> $titulo_tablas->show();
> $label = &new GtkLabel("Filas :");
> $label->show();
> $Gtk_Filas = &new GtkEntry();
> $Gtk_Filas->show();
> $label2 = &new GtkLabel("Columnas :");
> $label2->show();
> $Gtk_Columnas = &new GtkEntry();
> $Gtk_Columnas->show();
> $hbox2->show();
> $hbox->pack_start($label);
> $hbox->pack_start($Gtk_Filas);
> $hbox2->pack_start($label2);
> $hbox2->pack_start($Gtk_Columnas);
> $vbox->pack_start($titulo_tablas);
> $vbox->pack_start($hbox);
> $vbox->pack_start($hbox2);
> $bbox = &new gtkhbuttonbox();
> $button = &new GtkButton('OK');
> $button->set_usize(25,25);
> $button->connect("clicked", 'crear',$tablas);
> $button->show();
> $bbox->pack_start($button,FALSE,FALSE,3);
> $vbox->pack_start($bbox);
> $vbox->show();
> $tablas->add($vbox);
> $tablas->show_all();
> }
>
> The function tablas I call from the mother window with one button, and
> the window is create, but then, when i call other function and when I
> put this window widgets the aplication crused [:-(]
>
> How can I do?¿? help me pls
>
>