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 ?
On Sep 28, 2006, at 3:53 AM, A.R. wrote:> 1. why SEL_CLOSE doesn''t work on this example ?? It seems that > SEL_CLOSE never be called ??This is due to a bug in FOX; see: http://rubyforge.org/tracker/index.php? func=detail&aid=5498&group_id=300&atid=1223 I''m still waiting for this bug to be fixed.> 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 ?No, sorry. That''s getting into way too much Win32 platform-dependent stuff. Your best bet is to try to get Jeroen to provide first class support for that in FOX.
On Thursday 28 September 2006 08:07, Lyle Johnson wrote:> > On Sep 28, 2006, at 3:53 AM, A.R. wrote: > > > 1. why SEL_CLOSE doesn''t work on this example ?? It seems that > > SEL_CLOSE never be called ?? > > This is due to a bug in FOX; see: > > http://rubyforge.org/tracker/index.php? > func=detail&aid=5498&group_id=300&atid=1223 > > I''m still waiting for this bug to be fixed. > > > 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 ? > > No, sorry. That''s getting into way too much Win32 platform-dependent > stuff. Your best bet is to try to get Jeroen to provide first class > support for that in FOX.When you asked to remove the test on "message" not being zero, I removed them all [or so I thought]. However, in the case of close() I have overlooked the test. It has been fixed internally, and I will make a new release of 1.6. asap. Thanks for the info, - Jeroen
> > This is due to a bug in FOX; see: > >Ok thanks for this explication :)> > > Any idea for doing that only with Ruby and FXruby ? > > > > No, sorry. That''s getting into way too much Win32 platform-dependent > > stuff. Your best bet is to try to get Jeroen to provide first class > > support for that in FOX.I understand (and agree) this. In fact, i''m asked more how to attach some external event (generated by win or by the application ...). i''ll take a look at FXMAPFUNC and try to pick some external win32 manager event (but i didn''t find this for the moment in ruby). Thanks.