jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
121 stars 22 forks source link

gdk_keyval_name missing #203

Closed ptersilie closed 9 years ago

ptersilie commented 9 years ago

I wanted to catch keypresses on a DrawingArea and then convert the key value to it's corresponding character to be able to draw it onto the canvas. Unfortunately the ffi is missing the gtk method "gdk_keyval_name"[1].

Is this hard to add? If someone could give me a tip on how to do this I'd be happy to contribute this myself in form of a pull request. :)

[1] https://developer.gnome.org/gdk3/stable/gdk3-Keyboard-Handling.html#gdk-keyval-name

GuillaumeGomez commented 9 years ago

Nothing very hard, don't worry. I give you a little guide :

If you have any question, please ask.

ptersilie commented 9 years ago

Thanks. That really doesn't sound that hard. I already started hacking on that and I feel like I actually know what I'm doing ;). Unfortunately I can't seem to be able to build rgtk (even without my changes). I'm getting this error:

src/cairo/ffi.rs:82:1: 82:52 error: conflicting implementations for trait `core::marker::Send` [E0119]
src/cairo/ffi.rs:82 unsafe impl Send for *mut cairo_rectangle_list_t {}
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/cairo/ffi.rs:82:1: 82:52 note: conflicting implementation in crate `core`
src/cairo/ffi.rs:82 unsafe impl Send for *mut cairo_rectangle_list_t {}
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I think I'm on the current version of rust (4db0b3246 2015-02-25) and cargo (5773064 2015-02-25), so I'm not sure what causes that error. Any ideas?

GuillaumeGomez commented 9 years ago

It has been reported on PR #199. I don't have time to take a look today. I hope I'll have tomorrow...

ptersilie commented 9 years ago

Thanks! I pulled the update. Building works now. Will start working on the keyval stuff tomorrow. :)

GuillaumeGomez commented 9 years ago

Nice !