gnope php gtk gui gnope.org  

hide_on_delete()

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
ssiwek



Joined: 15 May 2006
Posts: 20

PostPosted: Thu Jul 20, 2006 3:01 pm    Post subject: hide_on_delete() Reply with quote

Hi!

Does someone have a working programm with that setting?

I have some GtkWindows loaded via GladeXML.

Now I want to to set hide_on_delete.
It should hide the window instead of beeing destroyed(deleted). But it does not work for me.

App1 is the example class from gtk.php.net http://gtk.php.net/wiki/CodeSnippets/FastStartingWithGlade

Code:

[....]

function init(){
  $this->get_widget('WIN1')->hide_on_delete();
  $this->get_widget('WIN2')->hide_on_delete();
}

$a=new App1();
$a->load_glade("app_glade.glade");
$a->init();
gtk::main();

[...]

When I call the window more than once I do get :

PHP Fatal error: Call to a member function present() on a non-object


The other way via connecting to the signal does work....
Code:

   function on_WIN1__delete_event(){
         $aktwindow = $this->get_widget('WIN1');
         $aktwindow->hide();
         return true;
        }


May be I am doing something wrong ?
Sven
P.S. I do have the latest gnope version installed.
Back to top
leon_pegg



Joined: 12 Jun 2006
Posts: 113
Location: hemel / UK

PostPosted: Thu Jul 20, 2006 4:23 pm    Post subject: Reply with quote

try this

Code:


[....]

$a new GladeXML("app_glade.glade");
$a->get_widget('WIN1')->hide_on_delete();
$a->get_widget('WIN2')->hide_on_delete();
gtk::main();

[...]
Back to top
ssiwek



Joined: 15 May 2006
Posts: 20

PostPosted: Fri Jul 21, 2006 8:38 am    Post subject: Reply with quote

Hi!

I've tried that - but it does not work. Well at last it works the other way...

Sven

P.S.: May be it's a bug? I am very unsure about that....
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.