qarmin
(Rafał Mikrut)
December 2, 2020, 4:19pm
1
Hi,
I want to center independent Dialog to main Window, but when I use
dialog_progress.set_position(WindowPosition::CenterOnParent);
then dialog appear on center of current screen, where actually Window is.
Is there any method to set position of Dialog to center of Window like:
dialog_progress.set_at_center_of(window_main);
?
ebassi
(Emmanuele Bassi)
December 2, 2020, 4:20pm
2
No: positioning top-level windows is the realm of the window manager, not of the toolkit.
Dies
December 2, 2020, 11:26pm
4
Based on what you stated @ebassi is absolutely correct, as usual.
But just in case what you said and what you mean aren’t the same thing.
If it’s actually independent, not something you’re creating, then this
dialog_progress.set_position(WindowPosition::CenterOnParent);
doesn’t make much sense… Center on what parent?
If it’s a dialog you’re creating then setting the main_window of your application as the parent of the dialog should get you the behavior you’re after.
system
(system)
Closed
December 16, 2020, 11:27pm
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.