I'd like to show a "tooltip" near mouse pointer position, so
let (x,y) = nwg::GlobalCursor::position();
self.win_tt.set_position(x,y);
self.win_tt.set_visible(true);
where win_tt is a Window
But this doesn't position the window correctly, but further to the rigght/bottom on a scaled monitor
However, if I manually adjust for dpi
let (x,y) = nwg::GlobalCursor::position();
let dpi:i32 = unsafe{nwg::dpi()};
let xx = (x as f64 / (dpi as f64 / 96 as f64)).round() as i32;
let yy = (y as f64 / (dpi as f64 / 96 as f64)).round() as i32;
self.win_tt.set_position(xx,yy);
self.win_tt.set_visible(true);
it works fine
I've added dpiAware in the manifest (without this the first example without dpi correction works) and the high-dpi feature enabled
I'd like to show a "tooltip" near mouse pointer position, so
where
win_tt
is a Window But this doesn't position the window correctly, but further to the rigght/bottom on a scaled monitorHowever, if I manually adjust for dpi
it works fine
I've added
dpiAware
in the manifest (without this the first example without dpi correction works) and thehigh-dpi
feature enabled