Re: mouse click on labels



On 21 Nov 2002, iain wrote:

On Thu, 2002-11-21 at 13:35, Razvan wrote:
in docs at GtkWidget it is "button-press-event" with minus not with
underscore

which way is corect?

Both - and _ are interchangable in signal names.

The problem is that you need to put the GtkLabel inside a GtkEventBox
then do gtk_widget_add_events (GTK_WIDGET (eventbox),
GDK_BUTTON_PRESS_MASK);

You don't need to add this event as it already is catched by the 
GtkWidget, and so by the EventBox.

regards

Vincent




then you can connect to the button-press-event on the eventbox.

iain


-- 
TORRI Vincent
Mathematiques Appliquees Bordeaux                                                
Institut de Mathematiques                                                       
Universite Bordeaux 1                                                           
351 cours de la liberation                                                      
33 405 Talence cedex - France                                                   
                                                                                
Tel : 33 (0)5 57 96 21 42                                                       
Fax : 33 (0)5 56 84 26 26                                                       
--




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