popup layout: add get_offset
forgetten one and remove the manual set_offset
set_offset can be generated automatically
@@ -2,13 +2,16 @@ use auto::PopupLayout;
use glib::translate::*;
pub trait PopupLayoutExtManual {
- fn set_offset(&self, dx: i32, dy: i32);
+ fn get_offset(&self) -> (i32, i32);
}
impl PopupLayoutExtManual for PopupLayout {
- fn set_offset(&self, dx: i32, dy: i32) {
+ fn get_offset(&self) -> (i32, i32) {
+ let mut dx = 0;
+ let mut dy = 0;
unsafe {
- gdk_sys::gdk_popup_layout_set_offset(self.to_glib_none().0, dx, dy);
+ gdk_sys::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy);
}
+ (dx, dy)
}
}
