Button click signal not working
- From: eduro <squashmybrain yahoo com>
- To: gtkmm-list gnome org
- Subject: Button click signal not working
- Date: Tue, 21 Jun 2011 21:53:24 -0700 (PDT)
Hi,
I created a gtk application with a notebook. I wanted to reuse a glade file
in one of my tab in the notebook. To make it work properly, I replaced the
GtkWindow in the glade file to GtkFrame so that I could add it in one of my
tabs. The only problem that I am encountering is that it doesn't seem to
catch the click signal from my button. Below are some code snippets.
MainWindow.cpp :
CStatusTextTab *m_pStatusTextTab; // declaration in my main window
class
//Initialization for my main window:
Glib::RefPtr<Gtk::Builder> pXmlStatusTextInterface;
try
{
pXmlStatusTextInterface =
Gtk::Builder::create_from_file("StatusText.xml");
}
catch(const Glib::FileError& ex)
{
std::cout << "FileError: " << ex.what() << std::endl;
}
catch(const Gtk::BuilderError& ex)
{
std::cout << "BuilderError: " << ex.what() << std::endl;
}
if(pXmlStatusTextInterface)
{
pXmlStatusTextInterface->get_widget_derived("window1",
m_pStatusTextTab);
}
m_Notebook.append_page(*m_pStatusTextTab, "Status Text");
StatusText.cpp:
CStatusTextTab::CStatusTextTab(BaseObjectType* cobject, const
Glib::RefPtr<Gtk::Builder>& refGlade):
Gtk::Window(cobject)
{
m_builder = refGlade;
m_builder->get_widget("ScalarIDComboBox", m_pScalarCB);
m_pScalarCB->set_active(0);
m_builder->get_widget("MetaIDRB1", m_pMetaData1);
m_builder->get_widget("MetaIDRB2", m_pMetaData2);
m_builder->get_widget("MetaIDRB3", m_pMetaData3);
m_builder->get_widget("MetaIDRB4", m_pMetaData4);
m_builder->get_widget("MetaIDRB5", m_pMetaData5);
m_builder->get_widget("ValueEntry", m_pValueEntry);
m_pValueEntry->set_text("0");
m_builder->get_widget("entry2", m_pIPEntry);
m_pIPEntry->set_text("192.168.0.1");
m_builder->get_widget("entry3", m_pIPPort);
m_pIPPort->set_text("6000");
// Here is where I initialized the button but is not working
m_builder->get_widget("SendButton", m_pSendButton);
m_pSendButton->signal_clicked().connect( sigc::mem_fun(*this,
&CStatusTextTab::on_SendButton_clicked) );
}
Thanks and Regards,
Ed
--
View this message in context: http://old.nabble.com/Button-click-signal-not-working-tp31900372p31900372.html
Sent from the Gtkmm mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]