#include <gtk++/gtkcheckbuttons.hpp>
#include <gtk++/gtkwindows.hpp>
#include <gtk++/gtkboxes.hpp>
#ifdef USE_NAMESPACE_STD
using namespace std;
#endif
void FonctionRappel (GtkCheckButton * Bouton, std::string const & Message)
{
if (lgtkpp::gtk_check_button(Bouton).GetActive())
std::cout << "Le "<<Message<<" vient d'etre coché" << std::endl;
else
std::cout << "Le "<<Message<<" vient d'etre decoché" << std::endl;
}
int main (int argc, char * argv [])
{
lgtkpp::gtk_window* Fenetre;
lgtkpp::gtk_check_button* Bouton;
lgtkpp::gtk_box* Boite;
std::string LabelBouton1, LabelBouton2;
::gtk_init(&argc, &argv);
Fenetre = new lgtkpp::gtk_window ();
Fenetre->SetBorderWidth (20);
Boite = new lgtkpp::gtk_box(lgtkpp::horizontal);
*Fenetre += *Boite;
Bouton = new lgtkpp::gtk_check_button("Bouton 1");
Bouton->SetActive(true);
LabelBouton1 ="bouton 1";
Bouton->SignalConnect("toggled",(GtkSignalFunc)FonctionRappel,&LabelBouton1);
*Boite += *Bouton;
Bouton = new lgtkpp::gtk_check_button("Bouton 2");
LabelBouton2 ="bouton 2";
Bouton->SignalConnect("toggled",(GtkSignalFunc)FonctionRappel,&LabelBouton2);
*Boite += *Bouton;
Fenetre->ShowAll();
gtk_main();
return 0;
}