Using wxEvtHandler::Connect
Manuel Martín
mmartin at ceyd.es
Thu Jul 12 12:25:55 PDT 2007
> wxStaticText* Session = new wxStaticText(this, newSessionID, "");
> wxStaticText* Status = new wxStaticText(this, newStatusID, "");
> wxStaticText* Detail = new wxStaticText(this, newDetailID, "");
> wxGauge* Test = new wxGauge(this, newTestID, 200,
> wxDefaultPosition, wxSize(100, -1), wxGA_HORIZONTAL|wxNO_BORDER);
> wxGauge* Overall = new wxGauge(this, newOverallID, 200,
> wxDefaultPosition, , wxSize(100, -1), wxGA_HORIZONTAL|wxNO_BORDER);
> Connect(newSessionID, wxEVT_LEFT_DOWN,
> wxMouseEventHandler(ScriptStatusPanel::OnSessionClick));
> Connect(newStatusID, wxEVT_LEFT_DOWN,
> wxMouseEventHandler(ScriptStatusPanel::OnSessionClick));
> Connect(newDetailID, wxEVT_LEFT_DOWN,
> wxMouseEventHandler(ScriptStatusPanel::OnSessionClick));
> Connect(newTestID, wxEVT_LEFT_DOWN,
> wxMouseEventHandler(ScriptStatusPanel::OnSessionClick));
> Connect(newOverallID, wxEVT_LEFT_DOWN,
> wxMouseEventHandler(ScriptStatusPanel::OnSessionClick));
> }
>
> void A::OnSessionClick(wxMouseEvent& event)
> {
> printf("I was here!\n");
> }
>
>
> Clicking on the widgets appears to have no effect, though... is there
> something obvious I am doing wrong?
staticTex and Gauge are not supposed to send mouse events.
So you can't receive what isn't sent.
HTH
Manolo
More information about the wx-users
mailing list