gtkd ,drawingarea, capture mouse pressed

drug drug2004 at bk.ru
Fri May 21 12:43:46 UTC 2021


21.05.2021 15:39, Alain De Vos пишет:
> I'll have a look at that website.
> With this code I capture the mouse press event
> 
> ```
> this()
> {
> addEvents(GdkEventMask.BUTTON_PRESS_MASK);
> addOnDraw(&drawCallback);
> addOnButtonPress(&onButtonPress);
> }
> 
> ```
> 
> ```
> public bool onButtonPress(Event event, Widget widget)
> {
> writeln("Button pressed");
> return false;
> }
> ```
> 
> But I still need the coordinates of pointer.
> 
I'm not gtk user too but you could try to use 
GdkEventMask.BUTTON_MOTION_MASK to get pointer
motion events while some button is pressed


More information about the Digitalmars-d-learn mailing list