Project

General

Profile

WPushbutton clicked signal

Added by Bert Cuypers about 5 years ago

Hi all,

Is it possible to somehow get a pointer to a WPushButton after you click it? At this moment, the clicked() signal only gives you a WMouseEvent from which you can derive the coordinates of the mouseclick. I can't however find a function in Wt to get a Widget based on these coordinates.

Thanks in advance for the help

Best regards,

Bert


Replies (2)

RE: WPushbutton clicked signal - Added by Roel Standaert about 5 years ago

Hi,

There's no way to actually get the sender (or owner) of an event in Wt 4. That was intentionally left out of the implementation to keep things simple. The idea is that if you need that information, you can use a lambda capture or a bind when setting up the connection.

Regards,

Roel

RE: WPushbutton clicked signal - Added by lm at about 5 years ago

I use either a lambda-captured variable (as Roel mentioned) or a class instance member.

    (1-2/2)