Note that there are some explanatory texts on larger screens.

plurals
  1. POGtkmm: Connect signal handler to combobox in TreeView
    primarykey
    data
    text
    <p>This is a follow-up question to this: <a href="https://stackoverflow.com/questions/8676942/how-do-i-add-a-combobox-to-a-treeview-column">How do I add a ComboBox to a TreeView column?</a></p> <p>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:</p> <pre><code>m_Combo.signal_changed().connect(sigc::mem_fun(*this, &amp;ExampleWindow::on_combo_changed) ); </code></pre> <p>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.</p> <p>Also, all the existing documentation shows the signal handler doing something like this:</p> <pre><code>void ExampleWindow::on_combo_changed() { Glib::ustring text = m_Combo.get_active_text(); if(!(text.empty())) std::cout &lt;&lt; "Combo changed: " &lt;&lt; text &lt;&lt; std::endl; } </code></pre> <p>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:</p> <pre><code>/usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:6196:1: note: template&lt;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&gt; sigc::bound_const_volatile_mem_functor7&lt;T_return, T_obj, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7&gt; sigc::mem_fun(T_obj&amp;, 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` </code></pre> <p>Not making my life trying to debug any easier. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload