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

Re: Is there any way to match a key event against key binding rules for GtkTextView class without creating a GtkTextView object?



Thanks. I'll try this approach.

Regards
James Su

On Mon, Jul 27, 2009 at 2:28 PM, Tristan Van Berkom <tvb gnome org> wrote:

> On Sun, Jul 26, 2009 at 11:21 PM, Zhe Su<james su gmail com> wrote:
> > Can anybody give me some suggestions about this issue?
> >
>
> Im not sure exactly how the keybindings are defined in the theme, but
> my guess is that you need to derive your custom object from GtkTextView
> if you want to inherit the keybindings.
>
> Think of it this way, the person who wrote the theme, wrote explicit style
> properties explicitly for textview classes, so the theme writers bindings
> to the textview should only apply to textview and subclasses.
>
> On the other hand, you *can* write completely different classes,
> and define style properties which you can later define in your own
> theme, if you dont care about picking up what people already put
> in the available stock GTK+ themes.
>
> Cheers,
>                -Tristan
>
> > On Fri, Jul 24, 2009 at 5:16 PM, Zhe Su <james su gmail com> wrote:
> >
> >> Hi,
> >>   GtkTextView widget can use key binding rules defined in gtkrc file.
> For
> >> example, when Emacs key theme is selected, ctrl-w will be mapped to
> >> cut-clipboard signal. Now, I'm developing a custom widget and want to
> handle
> >> those key bindings supported by GtkTextView. After reading the source
> code
> >> of gtkwidget, yI found that gtk_bindings_activate_event() is used for
> >> matching activating key bindings for a specific object. However this
> >> function can only match and activate key bindings explicitly defined for
> a
> >> specific object type. So if I want to match and activate all key
> bindings
> >> supported by GtkTextView, a GtkTextView object must be used when calling
> >> this function. Now the question is: is it possible to retrieve the
> >> information of all key bindings defined for GtkTextView and apply them
> to my
> >> custom widget, so that  gtk_bindings_activate_event() can work with my
> >> custom widget object as if it's a GtkTextView object?
> >>
> >> Regards
> >> James Su
> >>
> > _______________________________________________
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> >
>


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