Search code examples
c++linuxgtkmm

gtkmm, how can I make my program waiting the clicked signal from a button?


I want to make my program waiting until a button is clicked.

The problems are,

  • I can't use trhead
  • I can't use a dialog or another window
  • I cant't use a function like Glib::usleep() because it makes the interfaces insensitive.

I don't found any strategy to solve that problem.


Solution

  • Ok, I found a solution:

    // computation going on
    while( Gtk::Main::events_pending() )
    Gtk::Main::iteration();
    // computation continued
    

    https://developer.gnome.org/gtkmm/stable/classGtk_1_1Main.html#a2a2a6cddef82f8c52026790f3f7887e0

    any comment, or other answer are welcome