neovim-gtk/src/cmd_line.rs

24 lines
422 B
Rust
Raw Normal View History

2017-11-18 12:56:37 +00:00
use gtk;
use gtk::prelude::*;
pub struct CmdLine {
dlg: gtk::Dialog,
}
impl CmdLine {
pub fn new() -> Self {
let dlg = gtk::Dialog::new();
dlg.set_modal(true);
dlg.set_destroy_with_parent(true);
CmdLine {
dlg,
}
}
pub fn show<W: gtk::IsA<gtk::Window>>(&self, parent: &W) {
self.dlg.set_transient_for(parent);
self.dlg.show();
}
}