Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted as C++ by registered user adam ( 14 years ago )
#include <gtkmm.h>
#include <cstdlib>
class Win : public Gtk::Window
{
public:
Win() :
button("test")
{
add(button);
button.signal_clicked().connect(sigc::mem_fun(*this, &Win;::func));
show_all_children();
}
private:
Gtk::Button button;
void func()
{
button.set_sensitive(0);
int i;
while (i < 10)
{
while (Gtk::Main::events_pending())
Gtk::Main::iteration();
i++;
sleep(1);
}
button.set_sensitive(1);
}
};
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Win window;
Gtk::Main::run(window);
return 0;
}
Revise this Paste