Re: A windows creating a modal window

From: Date: Thu, 13 Nov 2003 05:38:43 +0000
Subject: Re: A windows creating a modal window
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4147@lists.php.net to get a copy of this message
Hmm.. I've never tried that. Modal always (ok, usually) works for me. (w32) As for a new gtk loop, how do you get return values? Do you just modify existing [class/object] vars? Well, what I use in this kind of situation is (after setting window in object modal) while ($object (class containing window and contents usually) -> hasReturned !== true) gtk::main_iteration(); It works fairly well :) "Firepages.Com.Au" <fire@firepages.com.au> wrote in message news:012601c3a998$47c56db0$0100a8c0@FIRE1... > You can also use grab::add() , I have had little success with set_modal on > win32 (not that I have tried it for a while!) > > eg > class modal_window extends GtkWindow{ > function modal_window( $title ){ > $this->GtkWindow(); > $this->set_border_width(0); > $this->set_position(GTK_WIN_POS_CENTER); > $this->set_title( $title ); > Gtk::grab_add($this); > //your other stuff// > $this->show_all(); > } > > function modal_close(){ > Gtk::grab_remove( $this ) ; > $this->destroy(); > } > } > > > its not truly modal in the sense that the calling window can still get focus > but you cant do anything in the calling window until you have closed the > 'modal' one > > > ----- Original Message ----- > From: "Frank M. Kromann" <frank@kromann.info> > To: "Fernando Correa da Conceição" <fernando.conceicao@terra.com.br> > Cc: <php-gtk-general@lists.php.net> > Sent: Thursday, November 13, 2003 11:09 AM > Subject: Re: [PHP-GTK] A windows creating a modal window > > > > You can create a new main loop (Gtk::main();) for that window. Your code > > will not continue until the second main loop is terminated by a cal to > > Gtk::main_quit(); > > > > - Frank > > > > > "Steph" <steph.fox@virgin.net> escreveu na mensagem > > > > > > news:NGBBLHCLELOKOAFANNABGEEIDCAA.steph.fox@virgin.net... > > > > > > > > http://gtk.php.net/manual/en/gtk.gtkwindow.method.set_modal.php > > > > > > > > did you try either/both of these methods? > > > > > > Yes, and does not work as I need. The window is modal like I want, so > > the > > > user can´t do anything on the previous window, only in thar I create, > > but > > > the function still runs. I will do a workaround, pass a reference of > > the > > > actual class to the new class and whem I destroy the new window, call a > > > function on the actual class. > > > A more easy exemple of what I need: > > > > > > function on_login_activate( $objPara1) > > > { > > > $lg=new login(); > > > echo("here"); > > > } > > > > > > They create the new window as a modal window and show "here" while this > > new > > > window is open. I need it show "here" only AFTER i close this new > > window. > > > > > > Thanks! > > > > > > > > > > > > > -----Original Message----- > > > > > From: Fernando Correa da Conceição > > > > > [mailto:fernando.conceicao@terra.com.br] > > > > > Sent: 13 November 2003 02:24 > > > > > To: php-gtk-general@lists.php.net > > > > > Subject: [PHP-GTK] A windows creating a modal window > > > > > > > > > > > > > > > Hi! I need some help on this. > > > > > > > > > > function on_login_activate( $objPara1) > > > > > { > > > > > $lg=new login(); > > > > > if ($lg->bt=="ok") { > > > > > $this->arWidgets["notebook"]->show(); > > > > > $this->arWidgets["toolbar1"]->show(); > > > > > $this->arWidgets["barrastatus"]->show(); > > > > > } > > > > > } > > > > > > > > > > $lg=new login(); create and show a modal window, and the > > > > > function continues > > > > > to run. In this new window I get a username/password. I need a way > > to > > > make > > > > > the function stop when it create and show the new window and > > > > > continues after > > > > > the user close this new window, so I can test the usename/password > > he > > > put. > > > > > > > > > > -- > > > > > Fernando Correa da Conceição > > > > > ICQ 168518047 > > > > > > > > > > http://manualphp.sourceforge.net > > > > > Participe da Tradução do Manual do PHP

« previous php.gtk.general (#4147) next »