Re: gtkd ,drawingarea, capture mouse pressed

2021-05-21 Thread Alain De Vos via Digitalmars-d-learn
I found something, https://api.gtkd.org/gdk.Event.Event.getCoords.html

Re: gtkd ,drawingarea, capture mouse pressed

2021-05-21 Thread drug via Digitalmars-d-learn
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 wid

Re: gtkd ,drawingarea, capture mouse pressed

2021-05-21 Thread Alain De Vos via Digitalmars-d-learn
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"); retur

Re: gtkd ,drawingarea, capture mouse pressed

2021-05-21 Thread evilrat via Digitalmars-d-learn
On Friday, 21 May 2021 at 12:28:36 UTC, Alain De Vos wrote: On a gtkd drawingarea I want to capture the mouse-pressed event and get the coordinates of the pointer on the area. I have ``` addEvents(GdkEventMask.BUTTON_PRESS_MASK); ``` Maybe I must add a signal-handler ? Not a gtk user, but mayb

gtkd ,drawingarea, capture mouse pressed

2021-05-21 Thread Alain De Vos via Digitalmars-d-learn
On a gtkd drawingarea I want to capture the mouse-pressed event and get the coordinates of the pointer on the area. I have ``` addEvents(GdkEventMask.BUTTON_PRESS_MASK); ``` Maybe I must add a signal-handler ?