Re: [gtk-list] Gtk--: how to disconnect (Button) objects writes:
> I'm doing a connect_to_method onto a button (Gtk+1.0.5, Gtk--0.9.11)
> which works just fine. The problem I have is how to disconnect the
> button at a later stage.
> Connection          *connect;
> Gtk_Button          button;
> connect_to_method (button.clicked, this, &callbackMethod);
> ... snip ...
> // 1st try
> //connect = (Connection *)(button.clicked)    // doesn't compile

It should be:
Connection c;
c=connect_to_method(button.clicked, this, &callbackMethod);

usually you want to keep the c variable stored inside the object which
creates the connection (and also later disconnects th connection..).

-- Tero Pulkkinen -- --

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