Re: if(!ishidden) {

From: Date: Thu, 16 Feb 2006 21:44:55 +0000
Subject: Re: if(!ishidden) {
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-6744@lists.php.net to get a copy of this message
Scott Mattocks wrote: > Brian Stumm wrote: > > Sorry if tthis info is easy to find, I'll admit I didn't search very > > hard. How do you guys go about checking if a GtkWindow (or other widget) > > is hidden or shown? By that I mean the $window->show() and > > $window->hide() functions. Basically if the window is already being > > "shown" then I dont want to call $window->show() again. > > You can check the widget flags and see if the visible flag is set: > > $window = new GtkWindow(); > var_dump($window->flags() & Gtk::VISIBLE); // int(0); > $window->show_all(); > var_dump($window->flags() & Gtk::VISIBLE); // int(256); Just a quick FYI for php-gtk v1 users... use GTK_VISIBLE instead of Gtk::Visible ie: if(!($window->flags() & GTK_VISIBLE)) { $win = $window->window; $win->raise(); // or $window->show(); etc... }

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