Re: [gtkmm] Passing widgets

Am 08.07.2004 12:12:31 schrieb(en) Linuxteam:

I want to know how do I pass a GtkEntry widget on click of a button. I
have a
callback function on click of a button. In that function, I want to
access the
text of a GtkEntry widget.
My code is:

void window1::on_okbutton_clicked(GtkEntry *entry1)


You can connect this function to a signal "clicked" it with:

yourbutton->signal_clicked().connect(sigc::bind(sigc::slot(*yourwindow, &window1::on_okbutton_clicked), yourentry));

sigc::bind() creates an adaptor that stores "yourentry" and passes it as an additional argument whenever the slot is executed by the signal.




"entry1" is the name of the "GtkEntry" widget.

When I try to compile the above code, it gives me the following error:

------------------------------------------------------------ In constructor `window1_glade::window1_glade()': error: no matching function for call to `
   Glib::SignalProxy0<void>::connect(SigC::Slot1<void, _GtkEntry>)'
/usr/include/gtkmm-2.0/glibmm/signalproxy.h:113: error: candidates
   SigC::Connection Glib::SignalProxy0<R>::connect(const
SigC::Slot0<R>&, bool)
   [with R = void]
/usr/include/sigc++-1.2/sigc++/object_slot.h: In static member
function `static
   typename SigC::Trait<T>::type SigC::ObjectSlot1_<R, P1,
   SigC::Trait<P1>::ref, void*) [with R = void, P1 = _GtkEntry, Obj =
/usr/include/sigc++-1.2/sigc++/object_slot.h:111:   instantiated from
`SigC::Slot1<R, P1> SigC::slot(O1&, R (O2::*)(P1)) [with R = void, P1
_GtkEntry, O1 = window1_glade, O2 = window1_glade]'   instantiated from here
/usr/include/sigc++-1.2/sigc++/object_slot.h:100: error: parameter
type of
   called function is incomplete
/usr/include/sigc++-1.2/sigc++/object_slot.h:100: confused by earlier
bailing out
make: *** [window1_glade.o] Error 1

I would also like to know if there is some complete tutorial available
for GTKMM.

Vishal Kothari.
gtkmm-list mailing list
gtkmm-list gnome org

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