motion notify event messages.



Greetings,

As part of the lazarus project to create a "delphi-like" clone for Linux, we are using GTK as our initial 
widget set.  One bug that has caused us much trouble is a problem with the motion-notify event.

Here's the background.

We create a form (gtkwindow) and put a gtkButton on it and a GTkEntry.  We set motion-notify event callbacks 
for each control.  When moving the mouse over the form and controls, the form fires the motion-notify signal 
and we get the coordinates based on the mouse position on the form.  So, when I near the caption bar (the 
upper left corner of the form) the coordinates move towards 0,0.

Here's where the inconsistency appears.

If I hold the left mouse button down over the ENTRY and move my mouse to the left, I get motion-notify events 
fired by the Entry.  The x and y coords are based on the mouse postion within that entry control.  Meaning 
that if the control was 75 pixels wide and 10 high and I held the mouse button down over the right-bottom 
most pixel on the entry control and moved one pixel to the left, the mouse coord's reported in motion-notify 
would be 74,10 or something near that.
 
If I hold the left mouse button down over the BUTTON control and move my mouse to the left, I get 
motion-notify events fired by the button.  The x and y coords are based on the mouse postion within that FORM 
instead of the control.  Meaning that if the control was 75 pixels wide and 10 high and it's origin was at 
50,50 on the form,  and I held the mouse button down over the right-bottom most pixel on the button control 
and moved one pixel to the left, the mouse coord's reported in motion-notify would be 124,60 or something 
near that.

Why is that?  Shouldn't they both report mouse coordinates based on the mouse position in the FORM or the 
CONTROL?  Is this a known issue or have we coded something incorrectly in Lazarus?


Thanks for your assistance.
Shane Miller
http://www.lazarus.freepascal.org 







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]