-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
Doesn’t a Wx::Grid get motion events sent? This code demonstrates the
problem:
#!/usr/bin/env ruby
#Encoding: UTF-8
require “wx”
class MyFrame < Wx::Frame
include Wx
def initialize(parent = nil)
super(parent, title: “Test”, size: Size.new(400, 400))
self.background_colour = NULL_COLOUR
StaticText.new(self, label: "") #Dummy
@grid = Grid.new(self, size: Size.new(300, 200))
@grid.create_grid(10, 10)
@grid.evt_motion{|e| p "!"; $stdout.flush}
end
end
class MyApp < Wx::App
include Wx
def on_init
@mainwindow = MyFrame.new
@mainwindow.show
end
end
x = MyApp.new
x.main_loop
If I hover the mouse above the grid, nothing happens, but if I put in a
panel control instead of a grid, it works. Surprisingly, if I changed
the line
@grid.evt_motion{|e| p “!”; $stdout.flush}
to
THE_APP.evt_motion{|e| p “!”; $stdout.flush}
I get motion events for everything but the grid. As soon as the cursor
enters the grid control, no output arrives anymore.
What’s going on here? Is that a bug?
I’m working on Ubuntu Lucid. Here’s the uname -a:
Linux ikarus 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC
2010 x86_64 GNU/Linux
and here’s my ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
I compiled both Ruby and wxRuby from source.
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkyIk7MACgkQDYShvwAbcNntNQCfcw+zR78b6ZxoTImx+rCRzCeN
khQAnjo4Zcix/0VkZqrwkz3f6x6XpCSM
=tLGS
-----END PGP SIGNATURE-----