You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is possible to set :parent of a dialog created via (dialog) or similar functions, and it seems that it will call Window#setLocationRelativeTo method. However, it is called before (pack!) function can be applied to the dialog, resulting to invalid positioning of the dialog (calling setLocationRelativeTo before pack is useless, at least on newly created windows - they have size 0 and will not be positioned correctly because of this).
So, to fix this, setLocationRelativeTo has to be called after (pack!) but before (show!), resulting in ugly code:
Yeah, haven't thought about config. It feels more natural than dropping back to plain java methods. Thanks for pointing this out.
As for the solution, I don't think it is possible to do something here with little effort. It would be possible to abstract this problem if dialog had some kind of pre-initialization hook which is run before it is shown, but I know none. For now, I guess, a function is sufficient.
Currently it is possible to set
:parent
of a dialog created via(dialog)
or similar functions, and it seems that it will callWindow#setLocationRelativeTo
method. However, it is called before(pack!)
function can be applied to the dialog, resulting to invalid positioning of the dialog (callingsetLocationRelativeTo
beforepack
is useless, at least on newly created windows - they have size 0 and will not be positioned correctly because of this).So, to fix this,
setLocationRelativeTo
has to be called after(pack!)
but before(show!)
, resulting in ugly code:instead of threading macro.
I guess it is sufficient to add a function like
so it can be used with threading macro conveniently.
The text was updated successfully, but these errors were encountered: