简体   繁体   中英

GTKmm Why the signal_hide() signal doesn't emit correctly?

I've got a Gtk::Box container (maincontroller) and inside of it, there is a Gtk::Grid (mainmenu). I've added a signal in the maincontroller.cpp like this:

mainmenu->signal_hide().connect(
        sigc::mem_fun(this, &MainController::Elmozdulas)
        );

When i press a button in the mainmenu, i call the hide() function, what works correctly, i don't see anything after that, but it doesn't emit the signal, only if i close the window. Why is that and how could i fix it?

Thanks for your answers in advance!

You might consider binding to signal_unmap instead. I think signal_hide only gets called if the widget is hidden, not if one of its parents are. Neither of these would be triggered if hide is actually called on a child of mainmenu rather than mainmenu itself. In that case it would appear like mainmenu had been hidden, but would in fact still be visible (and mapped, and realized).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM