problem with callback



Hello again

I still have the same problem

>Hello again

>I am making a window that has a menu, two
drawing_area
> and a GtkEntry
>
> I added the following events
(GDK_BUTTON1_MOTION_MASK,
> GDK_BUTTON2_MOTION_MASK, GDK_BUTTON_PRESS_MASK,
> GDK_VISIBILITY_NOTIFY_MASK) to the two drawing_area,
> and the respective callback, but the problem is that
> when I press a any key, the Gtkentry and the two
> drawing_are receive the signal, then call the
function
> callback of the two drawing_area and writes the
> character in the Gtkentry.
>
> My question:
>
> how can I do for that when I press a key, The signal
> will be received only by selected widget, a
> drawing_area or the gtkEntry?


	
I used the function gtk_widget_grab_focus () but does
not work, because it function only put focus in the
widget selected, but the others widget also receive
the signal.

But I already solve part of problem, I use the event
"button_press_event" of each drawing_area for disable
the GtkEntry with gtk_entry_set_editable() when I
select one of the drawing_area, But even the two
drawing_area receive the signal "key_press_event".

Then I try to block the callback of "key_press_event"
of each drawing_area with
g_signal_handlers_block_by_func(), but does not work,
and with the function  g_signal_handler_block I had
problem because I don't know as obtain the handler_id.

now I have 3 question.

how can I obtain the handler_id for the function
g_signal_handler_block?

Is there other way to prevent that the drawing_area
receive the signal key_press_event?

The problem when I use the function
gtk_entry_set_editable() for disable the GtkEntry is
that for enable the GtkEntry I have to enable the
gtkEntry when I select the widget, then I connect the
signal "button_press_event" with GtkEntry and in this
callback enable the GtkEntry, but now I can't select
text of GtkEntry because I connect the event
"key_press_event" with the GtkEntry, how can I enable
the opcion of select copy and paste of GtkEntry after
of connect this signal?


      ____________________________________________________________________________________
¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:                      
http://correo.yahoo.com.mx/


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