Forum: FXRuby Not receiving FXTopWindow events

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
E2104f9c9fb7e00e38d098ff6d0fa658?d=identicon&s=25 Leslie V. (leslieviljoen)
on 2009-11-11 18:35
I am trying to listen for the FXTopWindow events SEL_CLOSE,
SEL_MINIMIZE, SEL_MAXIMIZE, SEL_RESTORE because I want to execute some
code when a person presses the X button to close the window, etc.

None of my code gets executed though. Can anyone help?

class TextDialog
  def initialize(parent)
    init if respond_to? 'init'

  def construct_widget_tree(parent)
    @topwin =, 'title')
    @topwin.width = 300
    @topwin.height = 200

  attr_reader :topwin

if __FILE__==$0
  require 'fox16'
  include Fox

  w.topwin.connect(SEL_CLOSE) { app.exit }
  w.topwin.connect(SEL_MINIMIZE) { puts "MIN" }
  w.topwin.connect(SEL_MAXIMIZE) { puts "MAX" }
  w.topwin.connect(SEL_RESTORE) { puts "RESTORE" }
E2104f9c9fb7e00e38d098ff6d0fa658?d=identicon&s=25 Leslie V. (leslieviljoen)
on 2009-11-11 21:17
This forum looks dead so I am cross-posting to:

I apologize for that.
This topic is locked and can not be replied to.