Enable mouse event
This commit is contained in:
parent
54449aed83
commit
c8e78fd697
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -4,6 +4,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cairo-rs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cairo-rs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gdk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gdk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"gdk-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glib 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glib 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glib-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glib-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gtk 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gtk 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -9,6 +9,7 @@ cairo-rs = "0.0.8"
|
|||||||
glib = "0.0.8"
|
glib = "0.0.8"
|
||||||
glib-sys = "0.3"
|
glib-sys = "0.3"
|
||||||
gdk = "0.3"
|
gdk = "0.3"
|
||||||
|
gdk-sys = "0.3"
|
||||||
#neovim-lib = "0.1"
|
#neovim-lib = "0.1"
|
||||||
rmp = "0.7"
|
rmp = "0.7"
|
||||||
phf = "0.7"
|
phf = "0.7"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
extern crate gtk;
|
extern crate gtk;
|
||||||
extern crate gdk;
|
extern crate gdk;
|
||||||
|
extern crate gdk_sys;
|
||||||
extern crate glib;
|
extern crate glib;
|
||||||
extern crate glib_sys;
|
extern crate glib_sys;
|
||||||
extern crate cairo;
|
extern crate cairo;
|
||||||
|
@ -13,6 +13,7 @@ use gtk;
|
|||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{Window, WindowType, DrawingArea, Grid, ToolButton, ButtonBox, Orientation, Image};
|
use gtk::{Window, WindowType, DrawingArea, Grid, ToolButton, ButtonBox, Orientation, Image};
|
||||||
use gdk::{Event, EventKey, EventConfigure, EventButton, EventMotion, EventType};
|
use gdk::{Event, EventKey, EventConfigure, EventButton, EventMotion, EventType};
|
||||||
|
use gdk_sys;
|
||||||
use glib;
|
use glib;
|
||||||
use glib_sys;
|
use glib_sys;
|
||||||
use neovim_lib::{Neovim, NeovimApi};
|
use neovim_lib::{Neovim, NeovimApi};
|
||||||
@ -113,6 +114,7 @@ impl Ui {
|
|||||||
|
|
||||||
grid.attach(&self.drawing_area, 0, 1, 1, 1);
|
grid.attach(&self.drawing_area, 0, 1, 1, 1);
|
||||||
|
|
||||||
|
self.drawing_area.set_events(gdk_sys::GDK_BUTTON_PRESS_MASK.bits() as i32);
|
||||||
self.drawing_area.connect_button_press_event(gtk_button_press);
|
self.drawing_area.connect_button_press_event(gtk_button_press);
|
||||||
self.drawing_area.connect_button_release_event(gtk_button_release);
|
self.drawing_area.connect_button_release_event(gtk_button_release);
|
||||||
self.drawing_area.connect_motion_notify_event(gtk_motion_notify);
|
self.drawing_area.connect_motion_notify_event(gtk_motion_notify);
|
||||||
|
Loading…
Reference in New Issue
Block a user