Gtk::TextView widget (signal problem).



Hello everyone;
I need help...
I'm trying to implement a signal on the click of the left mouse button over a Gtk::TextView.
Here is my code:

bool myWindow::on_textview_clicked(GdkEventButton* event)
{
   if (event->button == 1 || event->type == GDK_BUTTON_PRESS )
           cout<<"textview clicked..."<<endl; //do some stuff here....
   return false;
}

Then, in the constructor:
m_textview = NULL;
m_refGlade->get_widget ("m_textview", m_textview);
m_textview->add_events(Gdk::BUTTON_PRESS_MASK);
m_textview->signal_button_press_event().connect(
       SigC::slot(*this, &myWindow::on_textview_clicked));

Now, after I have done all that... the textview is only receiving the signal only when I press the middle wheel button.

I even tried to add an Gtk::EvenBox .... I got the same result!!
By the way... I'm using Gtkmm version 2.2
Any help is appreciated.
Thanks

David Kinyanjui








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]