Re: Button not working <<<<<
- From: Kjell Ahlstedt <kjell ahlstedt bredband net>
- To: nalin4linux77 linux <nalin4linux77 gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Button not working <<<<<
- Date: Sat, 24 Mar 2012 10:44:07 +0100
The documentation of signals is poor in present releases of gtkmm. That
will change in the future. Then the documentation will be copied from
gtk+ to gtkmm (with small changes). The documentation of GtkButton's
"activate" signal in gtk+ says
"The ::activate signal on GtkButton is an action signal and emitting it
causes the button to animate press then release. Applications should
never connect to this signal, but use the "clicked" signal."
If you connect to signal_clicked() instead of signal_activate() your
program works.
Have you seen the "Programming with gtkmm" book?
http://developer.gnome.org/gtkmm-tutorial/stable/
Kjell
2012-03-24 08:04, nalin4linux77 linux skrev:
Dear Friends
I am new to c++ and Gtkmm! and i have made a small program which
given below but it is not working please help me and also i forgot to
say that i am familiar with Pygtk :)
#include <iostream>
#include <gtkmm.h>
using namespace std;
void say()
{
exit(0);
}
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Button butt("_Something", true);
butt.signal_activate().connect(sigc::ptr_fun(say));
window.add(butt);
window.show_all_children();
Gtk::Main::run(window);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]