Re: A question of gtk.



Hello Ana,

'Cause I read a bit the manual of GDK, gdk-events,
but I read only for
make 1click, 2clicks or 3clicks but no click with
the right button.

You should have read the API references of GDK
here is the link
http://developer.gnome.org/doc/API/gdk/gdk-event-structures.html#GDKEVENTBUTTON

You have to use just the BUTTON_PRESS_MASK.

|--------------------------------------------------------------|
| gtk_widget_set_events(        GTK_WIDGET(widget),         
  |
|                               GDKBUTTON_PRESS_MASK );        |
|                                                     
        |
| gtk_signal_connect(   GTK_OBJECT(widget),            
       |
|                       "button_press_event",                  |
|                       GTK_SIGNAL_FUNC(your_handler), NULL);  |
|--------------------------------------------------------------|

the handler will be written like this....

|--------------------------------------------------------------|
|                                                     
        |
| void your_handler(    GdkButtonEvent *event,          
      |
|                       gpointer user_data )                   |
| {                                                   
        |
|       /* here you can check what button                  
   |
|               has been pressed*/                             |
|       switch( event->button )                            
   |
|       {                                                  
   |
|       case 1:                                            
   |
|               /* left button */                              |
|               break ;                                        |
|       case 2:                                            
   |
|               /* middle button */                            |
|               break ;                                        |
|       case 3:                                             
  |
|               /* right button */                             |
|       }                                                   
  |
| }                                                   
        |
|--------------------------------------------------------------|

Hope that will Help. :-)

Tushar.
                        

=====
Tushar Vijay Joshi
42/3 Ujjwal Nagar, Wardha Road, Nagpur 440 025
(0) 235940 (R) 260565 (M) 98222-20365
Email: tusharvjoshi yahoo com
<<No one can laugh at a person who can laugh at himself.
Smile anyway.  Success is never ending Failure is never Final.>>

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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