[fxruby-users] SEL_CLOSE - win32 event

A.R. a.reith at gmail.com
Thu Sep 28 04:53:38 EDT 2006


Hello FXRuby users !
I have few questions about FX event (i'm on winxp / ruby 1.8.4 (revert
from 1.8.5) / fxruby 1.6.2) :

1. why SEL_CLOSE doesn't work on this example ?? It seems that
SEL_CLOSE never be called ??

require 'fox16'
include Fox

    class MyWindow < FXMainWindow
        def initialize(app)
            super(app, "test close", nil, nil, DECOR_ALL, 0, 0, 200, 200)
            self.connect(SEL_CLOSE, method(:onClose))
        end
        def onClose(sender, sel, event)
            response = FXMessageBox.question(self, MBOX_YES_NO, "Close
Window", "Are you sure?")
            return (response == MBOX_CLICKED_YES ? 0 : 1)
        end

        def create
            super
            show(PLACEMENT_SCREEN)
        end
    end

  application = FXApp.new("test")
  test = MyWindow.new(application)
  application.create
  test.show(PLACEMENT_SCREEN)
	
  application.run

-----------------
2. (i have posted this question on comp.lang.ruby with no responses at
this time) :  I'm trying to build a small 'auto-copy' app with FXRuby
(on windows). I
need to intercept WM_CHANGECBCHAIN message (in conjonction with win32
function call SetClipboardViewer and ChangeClipboardChain), but it
seems that the only way for handling non integrated win32 event with
Fox is to overload the FXApp::dispatchEvent C function ...

Any idea for doing that only with Ruby and FXruby ?


More information about the fxruby-users mailing list