Re: Filling a ComboBoxEntry "on demand"



Here's the diff, its made against the example located at http://www.gtkmm.org/docs/gtkmm-2.4/examples/book/comboboxentry/text/

diff cbe_example/examplewindow.cc cbe_on_demand/examplewindow.cc
35a36,37
>   m_Combo.get_entry()->signal_populate_popup().connect(sigc::mem_fun(*this, &ExampleWindow::on_populate_popup));
>   g_signal_connect(m_Combo.gobj(), "notify::popup-shown", G_CALLBACK(&ExampleWindow::on_populate_popup_gtk), &m_Combo);
50a53,61
> void ExampleWindow::on_populate_popup(Gtk::Menu* menu)
> {
>   std::cout << "populate_popup called" << std::endl;
> }
>
> void ExampleWindow::on_populate_popup_gtk(gpointer instance, gpointer user_data)
> {
>   std::cout << "populate_popup_gtk called" << std::endl;
> }
diff cbe_example/examplewindow.h cbe_on_demand/examplewindow.h
33a34,35
>   void on_populate_popup(Gtk::Menu* menu);
>   static void on_populate_popup_gtk(gpointer instance, gpointer user_data);

I don't know much either about gtk nor gtkmm, so the way I'm doing this may be plain wrong.
Regards,

Luca


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