Re: [java-gnome-hackers] BindingSet (was: Update)
Brought to you by:
afcowie
From: Luca De R. <pie...@li...> - 2003-12-26 20:43:23
|
Il ven, 2003-12-26 alle 21:35, Luca De Rugeriis ha scritto: > Il ven, 2003-12-26 alle 20:49, Jeffrey Morgan ha scritto: > > On Fri, 2003-12-26 at 14:26, Luca De Rugeriis wrote: > > > Il ven, 2003-12-26 alle 19:31, Luca De Rugeriis ha scritto: > > > Fine ;) > > > Next one: > > > native static final protected boolean gtk_bindings_activate(int object, int keyval, int modifier); > > > > > > I guess I could wrap this function with the following: > > > > > > public boolean activateBindings(int keyval, int modifier) { > > > return gtk_bindings_activate(handle, keyval, modifier); > > > } > > > > The keyval should be one of the public members of gdk.KeySymbol and the > > modifer should be of type gdk.ModifierType. The body should be as: > > > > return gtk_bindings_activate(handle, keyval, modifier.getValue); > :) I was asking myself how one can manage ascii key values by hand! > This shows how little I know about gdk/gtk and company. > > The result is: > > public boolean activateBindings(KeySymbol keyval, ModifierType modifier) { > return gtk_bindings_activate(handle, keyval, modifier.getValue()); > } > > but how I can pass the keyval in question? There is no keyval.getValue > or something. Could the following code work? public boolean activateBindingSet(KeySymbol keyval, ModifierType modifier) { return gtk_binding_set_activate(handle, Integer.parseInt(keyval.toString()), modifier.getValue(), handle); } -- Luca De Rugeriis <pie...@li...> |