Mistake in example in Programming with gtkmm4

I do not know if this is the right place to report the issue but I have not found better.

In Chapter 12. Drop Down in Complex Example section there is a method implemented in the example:

void ExampleWindow::on_unbind_list_item(const Glib::RefPtr<Gtk::ListItem>& list_item)
{
  if (auto connection = static_cast<sigc::connection*>(list_item->get_data("connection")))
  {
    connection->disconnect();
    list_item->set_data("connection", nullptr);
  }
}

I believe it should be either removed or bound to factory after

  factory->signal_bind().connect(
    sigc::mem_fun(*this, &ExampleWindow::on_bind_list_item));
  factory->signal_unbind().connect(
    sigc::mem_fun(*this, &ExampleWindow::on_unbind_list_item));

IDK if the code is wrong or not but that example is located here: examples/book/dropdown/complex/examplewindow.cc · master · GNOME / gtkmm-documentation · GitLab. If the code is wrong you could do a MR for it, or file an issue on that project.

hmm I’m not proficient with this process yet;

I created MR here

But the pipeline seem to fail with something unrelated - and in all honesty I do not know how to proceed.

Yeah that pipeline failure is not on code you touched. I don’t think you need to do anything. The MR is ready to be merged anyway.

1 Like

Your MR looks good. I can’t merge it right now. I have problems logging in
to gitlab.gnome.org.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.