tags:

views:

89

answers:

1

Hi, I load a single instance of a window on php-gtk, I have a button named "Cancel" that hide(); the window, so when the window is needed again I just show();.

But when I click on the close button instead of the cancel button the window is destroyed. Even when I redirect the event (I'm not sure if i'm doing it right) it calls the first(just hide() function) and then the destroy method.

Any idea?

PD: I wouldn't want to destroy and recreate the windows because of php's crappy garbage collector and to be able to maintain previous data without having to refill the whole window(after all is supposed to be a desktop app).

A: 

Following the advice here: delete-event.

I changed my code to return TRUE:

function on_multipleCancelButton_activate()
{
  global $GladeMultiple;

  $MultipleWindow = $GladeMultiple->get_widget('multipleWindow');
  $MultipleWindow->hide();

  return TRUE;
}

On the GTK designer I linked the delete-event to this function.

levhita