This is a follow-up question to this: How do I add a ComboBox to a TreeView column?
I was able to place a ComboBox inside a TreeView with the options I need. But I can't seem to figure out how to connect a signal handler to it. All the existing documentation shows connect statements like this:
m_Combo.signal_changed().connect(sigc::mem_fun(*this, &ExampleWindow::on_combo_changed) );
But I'm not inside a Window class definition, and thus have no *this object. I'm using Glade to create the basic structures of the GUI.
Also, all the existing documentation shows the signal handler doing something like this:
void ExampleWindow::on_combo_changed()
{
Glib::ustring text = m_Combo.get_active_text();
if(!(text.empty()))
std::cout << "Combo changed: " << text << std::endl;
}
Where the "m_Combo" object is global, and can just be simply accessed. But When the ComboBox is inside a TreeView, it's dynamic. How would I go about actually accessing the ComboBox? Pass something through via a parameter? The signal_changed().connect() function seems to be really picky about its parameters. No matter what I give it, it spits out (literally) 100 lines of gibberish in compiler errors. Ends with:
/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:6196:1: note: template<class T_arg1, class T_arg2, class T_arg3, class T_arg4, class T_arg5, class T_arg6, class T_arg7, class T_return, class T_obj, class T_obj2> sigc::bound_const_volatile_mem_functor7<T_return, T_obj, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> sigc::mem_fun(T_obj&, T_return (T_obj2::*)(T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7)const volatile)
make: *** [src/RTT_Client_GTK.o] Error 1`
Not making my life trying to debug any easier.
main()
function, you should be in a class of some kind, right? Also, there is a way to pass signals directly to a function that is outside a class structure: developer.gnome.org/gtkmm-tutorial/unstable/… – Christian Smith