mail-archives/gtk-sharp-list/2004-August/004761.html

85 строки
3.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Drawing Area and Mouse Button Signals
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mvsl%40telefonica.net">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="Previous" HREF="004760.html">
<LINK REL="Next" HREF="004763.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Drawing Area and Mouse Button Signals
</H1>
<B>"Manuel V. Santos López"
</B>
<A HREF="mailto:mvsl%40telefonica.net"
TITLE="[Gtk-sharp-list] Drawing Area and Mouse Button Signals">mvsl@telefonica.net
</A><BR>
<I>Tue, 24 Aug 2004 23:44:32 +0200</I>
<P><UL>
<LI> Previous message: <A HREF="004760.html">[Gtk-sharp-list] Drawing Area and Mouse Button Signals
</A></li>
<LI> Next message: <A HREF="004763.html">[Gtk-sharp-list] Drawing Area and Mouse Button Signals
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4761">[ date ]</a>
<a href="thread.html#4761">[ thread ]</a>
<a href="subject.html#4761">[ subject ]</a>
<a href="author.html#4761">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi,
you should set the event mask before realizing the drawingarea.
The code should read:
&gt;<i> drawingarea = new Gtk.DrawingArea();
</I>&gt;<i> drawingarea.SetSizeRequest(700, 400);
</I>-----&gt; // vbox2.PackEnd(drawingarea);
&gt;<i>
</I>&gt;<i> drawingarea.ExposeEvent += new ExposeEventHandler(drawingarea_expose_event_cb);
</I>&gt;<i> drawingarea.ConfigureEvent += new ConfigureEventHandler(drawingarea_configure_event_cb);
</I>&gt;<i> drawingarea.MotionNotifyEvent += new MotionNotifyEventHandler(drawingarea_motion_notify_event_cb);
</I>&gt;<i> drawingarea.ButtonPressEvent += new ButtonPressEventHandler(drawingarea_button_press_event_cb);
</I>&gt;<i> drawingarea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask |
</I>&gt;<i> EventMask.ButtonPressMask | EventMask.PointerMotionMask |
</I>&gt;<i> EventMask.PointerMotionHintMask;
</I>&gt;<i>
</I>&gt;<i> drawingarea.CanFocus = true;
</I>&gt;<i> drawingarea.GrabFocus();
</I>&gt;<i>
</I>&gt;<i> canvas = new DamageCanvas(drawingarea);
</I>-----&gt; vbox2.PackEnd(drawingarea);
&gt;<i> main_window.Resize(800, 500);
</I>&gt;<i>
</I>
Hope it helps you.
Greetings,
Manuel V. Santos López.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="004760.html">[Gtk-sharp-list] Drawing Area and Mouse Button Signals
</A></li>
<LI> Next message: <A HREF="004763.html">[Gtk-sharp-list] Drawing Area and Mouse Button Signals
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4761">[ date ]</a>
<a href="thread.html#4761">[ thread ]</a>
<a href="subject.html#4761">[ subject ]</a>
<a href="author.html#4761">[ author ]</a>
</LI>
</UL>
</body></html>