2

I'm currently working on a small GUI based application using gWidgets (RGtk2). I've encountered a question which I was unable to solve by myself using the documentation provided in the gWidgets package:

Is it possible to trigger an event, i.e. a function, when the user clicks on the red cross to close the GUI / widgets/ main window? For usability reasons I don't want to have an extra button though it will definitely work.

PS: I don't think an example is necessary here but if any of you insists I will add one.

user1356695
  • 217
  • 1
  • 4
  • 13

1 Answers1

1

Try

addhandlerdestroy( myWidget, handler = f_exit )

where

f_exit <- function( h,...
{
  # your code, maybe simply
  dispose( myWidget )
}
vaettchen
  • 7,299
  • 22
  • 41