[Gtk-sharp-list] Trouble with DrawingArea.MotionNotifyEvent.

Ivan Gužvinec ivan.guzvinec@telemach.net
Sun, 21 Mar 2004 15:07:09 +0100


--=-nhiFd8fvzo4ClY4PYEjX
Content-Type: multipart/mixed; boundary="=-5CsB70Y0Sr06VxODBRn/"


--=-5CsB70Y0Sr06VxODBRn/
Content-Type: multipart/alternative; boundary="=-NMeGLVdeEPkGGtYWW3xZ"


--=-NMeGLVdeEPkGGtYWW3xZ
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,

I'm having trouble with MotionNotifyEvent in my derived Window class. I
would like to create a DrawingArea widget, add it to self (this) and
then catch its MotionNotifyEvent(s). So far I only get exactly one
MotionNotifyEvent when (1) mouse Enters the window area or (2) when I
press mouse buttons and then move the mouse inside the DrawingArea. But
when I simply move the mouse inside the DrawingArea, no
MotionNotifyEvents are fired.

Perhaps I'm doing things the wrong way, so any hint/help would be
greatly appreciated.

I've made a simple test program to demonstrate this. Please find the
attached "CreatedWindow.cs", compile with "mcs -r gtk-sharp.dll -r
gdk-sharp.dll -r glib-sharp.dll CreatedWindow.cs"

thanks,
Ivan

--=-NMeGLVdeEPkGGtYWW3xZ
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
  <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.0.9">
</HEAD>
<BODY>
Hi,<BR>
<BR>
I'm having trouble with MotionNotifyEvent in my derived Window class. I wou=
ld like to create a DrawingArea widget, add it to self (this) and then catc=
h its MotionNotifyEvent(s). So far I only get exactly one MotionNotifyEvent=
 when (1) mouse Enters the window area or (2) when I press mouse buttons an=
d then move the mouse inside the DrawingArea. But when I simply move the mo=
use inside the DrawingArea, no MotionNotifyEvents are fired.<BR>
<BR>
Perhaps I'm doing things the wrong way, so any hint/help would be greatly a=
ppreciated.<BR>
<BR>
I've made a simple test program to demonstrate this. Please find the attach=
ed &quot;CreatedWindow.cs&quot;, compile with &quot;mcs -r gtk-sharp.dll -r=
 gdk-sharp.dll -r glib-sharp.dll CreatedWindow.cs&quot;<BR>
<BR>
thanks,<BR>
Ivan
</BODY>
</HTML>

--=-NMeGLVdeEPkGGtYWW3xZ--

--=-5CsB70Y0Sr06VxODBRn/
Content-Disposition: attachment; filename=CreatedWindow.cs
Content-Transfer-Encoding: base64
Content-Type: text/x-csharp; name=CreatedWindow.cs; charset=

Ly8gY3JlYXRlZCBvbiAwMy8yMS8yMDA0IGF0IDE0OjQwDQp1c2luZyBTeXN0ZW07DQp1c2luZyBH
dGs7DQp1c2luZyBHdGtTaGFycDsNCg0KcHVibGljIGNsYXNzIENyZWF0ZWRXaW5kb3cgOiBXaW5k
b3cNCnsNCglzdGF0aWMgR0xpYi5HVHlwZSB0eXBlOw0KCQ0KCXByaXZhdGUgRHJhd2luZ0FyZWEJ
ZGE7DQoJDQoJc3RhdGljIENyZWF0ZWRXaW5kb3cgKCkNCgl7DQoJCXR5cGUgPSBSZWdpc3RlckdU
eXBlICh0eXBlb2YgKENyZWF0ZWRXaW5kb3cpKTsJCX0NCgkNCglwdWJsaWMgQ3JlYXRlZFdpbmRv
dyAoKSA6IGJhc2UgKHR5cGUpDQoJew0KCQlkYSA9IG5ldyBEcmF3aW5nQXJlYSgpOw0KCQlkYS5T
ZXRTaXplUmVxdWVzdCg2NDAsIDQ4MCk7CQkNCgkJdGhpcy5BZGQoZGEpOw0KCQlkYS5Nb3Rpb25O
b3RpZnlFdmVudCArPSBuZXcgTW90aW9uTm90aWZ5RXZlbnRIYW5kbGVyKHBpY3ZfTW92ZSk7DQog
ICAgCWRhLkV2ZW50cyA9ICAoaW50KUdkay5FdmVudE1hc2suQWxsRXZlbnRzTWFzazsNCgl9DQoJ
DQoJcHJpdmF0ZSB2b2lkIHBpY3ZfTW92ZShvYmplY3Qgb2JqLCBNb3Rpb25Ob3RpZnlFdmVudEFy
Z3MgYXJncykNCgl7DQoJCUdkay5FdmVudE1vdGlvbiBldiA9IGFyZ3MuRXZlbnQ7DQoJCQ0KCQlT
eXN0ZW0uQ29uc29sZS5Xcml0ZUxpbmUoIkV2dDogezB9IFg9ezF9LCBZPXsyfSIsIGV2LlR5cGUs
IGV2LlgsIGV2LlkpOw0KCQlhcmdzLlJldFZhbCA9IHRydWU7DQoJfQ0KfQ0KDQpjbGFzcyBNYWlu
Q2xhc3Mgew0KCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkNCgl7DQoJCUFwcGxpY2F0aW9uLklu
aXQoKTsNCgkJDQoJCUNyZWF0ZWRXaW5kb3cgd2luID0gbmV3IENyZWF0ZWRXaW5kb3coKTsNCgkJ
d2luLlNob3dBbGwoKTsNCgkJDQoJCUFwcGxpY2F0aW9uLlJ1bigpOw0KCX0NCn0=

--=-5CsB70Y0Sr06VxODBRn/--

--=-nhiFd8fvzo4ClY4PYEjX
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iQCVAwUAQF2hjcj+Az87AOMpAQLO2QP/fAyhBdcT+a/QiydoAgHhSiDH+bmHFSvY
p+cnCG8zIqoHdRLnaPPMmxbThmMul4Uhc4m0CsYIgRwoNV9MWbDVfly/ACyfvDNM
Y3U0/IAbPqen7JxfuoeAbKbVYH3CcUwsNWJ9azclVLMbQU24zCVV26X8hQUMZ/7h
UcFBnJm8ouo=
=sVo+
-----END PGP SIGNATURE-----

--=-nhiFd8fvzo4ClY4PYEjX--