Re: Disable ALL keybindings for a specific widgit? [SOLVED]



On 6/15/07, Justin Stallard <darkfloyd7 gmail com> wrote:
On 6/15/07, Eduardo M KALINOWSKI <ekalin bol com br> wrote:
> On 6/14/07, Justin Stallard <darkfloyd7 gmail com> wrote:
> > Hi,
> >
> > I've looked through the tutorial, faq, API doc, and even google and I
> > can't seem to find out if there's some way to unbind all the
> > keybindings associated with a particular widgit. Is there?
> >
> > What I want to have is this:
> > A GtkEntry that does not respond to "Left", "Right", "Insert", or any
> > other keybindings or key presses so that I can handle them myself as
> > key_press_events.
>
> Well, if you connect a function to key-press-event and return TRUE,
> the default handler (that does all that) is not run, and the default
> action does not happen.

When I return FALSE from my callback function, pressing "Tab" would
cause the "key-press-event" to be first handled by my function, and
then by the default. Returning TRUE gives me the result I want, and
"Tab" is only handled by my function. The following keys, however,
still do not get handled by my signal handler at all, in either case:
BackSpace
Return
Menu
Insert
Delete
Home
End
Left
Right
KP_Enter

Are these keys handled some other way? What am I not understanding here?

I've discovered what my problem was. I was using
g_signal_connect_after() instead of g_signal_connect(). Using
g_signal_connect() does what I want.

-Justin



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