Re: TreeView, Row and double click



Hello thank you for the answer,
but i dont see the functions you told me about il the gtkm reference,

but i sucessfully wrote a code to detect a dble click (inspired by a ggogelization ;) ) but it works only in a blank window...

it doesn t work if i attach the signal_button_press_event() to a Button or a treeview...

he is the code for the window : fenetre.cc

#include <fenetre.h>
#include <string>
#include <iostream>
fenetre::fenetre()
{

set_default_size(600, 600);
set_position(Gtk::WIN_POS_CENTER);

show_all();

this->add_events(Gdk::BUTTON_PRESS_MASK); this->signal_button_press_event().connect(sigc::mem_fun(*this, &fenetre::on_press));

}
bool fenetre::on_press(GdkEventButton *event)
{
	static long unsigned lastclick = 0;

	if (event->type == GDK_2BUTTON_PRESS && event->button ==1)
	{
		if (lastclick == 0 || (event->time - lastclick) < 600)
			lastclick = event->time;
		else
			std::cout << "Dble click" << std::endl;
		return true;

	}
	else
		return false;
}


im using gtkmm-2.4

thanks :)

_________________________________________________________________
MSN Search : des réponses à tous vos besoins ! http://www.imagine-msn.com/hotmail/default.aspx?locale=fr-FR




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