//$Id: helloworld.cc,v 1.3 2004/11/16 20:02:21 murrayc Exp $ -*- c++ -*- /* gtkmm example Copyright (C) 2002 gtkmm development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "AddButton.h" #include AddButton::AddButton() : m_button("Hello World") // creates a new button with the label "Hello World". { // When the button receives the "clicked" signal, it will call the // on_button_clicked() method. The on_button_clicked() method is defined below. m_button.signal_clicked().connect(sigc::mem_fun(*this, &AddButton::on_button_clicked)); // This packs the button into the Window (a container). m_VBox.pack_start(m_button, Gtk::PACK_SHRINK); // The final step is to display this newly created widget... m_button.show(); } AddButton::~AddButton() { } void AddButton::on_button_clicked() { std::cout << "Hello World" << std::endl; }