Gtk_FileSelection



Hello.

I am making a gtk-- app that uses Gtk_FileSelection to open a file (wow,
a new idea). The way I do it, is a store a pointer to gtkfilesel in a
struct (window->open_filesel).  When "Open" is selected from the menu, it
checks if the window->open_filesel is null (first time called); if it is,
make a new one; if not, show the old one (which I call hide() on after
OK/Cancel is pressed in the filesel).

But the problem arrises when someone kills the fileselection with a
destroy/delete event (like clicking on an "X" button in the titlebar).
When this happens, the filesel is deleted and the next time around it
shows up as a black box.

My question is how can I override the delete/destroy events to make it
just hide() the filesel?  I tried using
  connect_to_method(open_filesel->destroy, this, open_hide);

  void open_hide(void) { open_filesel->hide(); }
but it still seems to destroy the widget.

Thanks.
---
Matt Perry [guy@mikepery.linuxos.org]

"The programming model I'm promoting is that the network is broken all the
time. People design their software so that if you can communicate at all,
it's a miracle."
               -- Microsoft Vice President Jim Allchin when asked about
                  the future of OS development.
---



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]