InteractionDialog positioning and sizing

31 views
Skip to first unread message

P5music

unread,
Dec 1, 2020, 3:59:29 PM12/1/20
to CodenameOne Discussions
InteractionDialog is suitable for me when I have BrowserComponents in the layout, because it is not blocking the BC itself.
It is a special dialog because I have to pass top, bottom, left, right parameters but I would like to reproduce the common behaviour of a dialog.
I used to create dialogs with containers and the size was automatically established, and the position was centered.
How can I have this behaviour in a simple way?
Thanks in advance

Shai Almog

unread,
Dec 1, 2020, 10:29:50 PM12/1/20
to CodenameOne Discussions
These APIs were never migrated from Dialog but probably should be. This would be a relatively easy task for a PR.

P5music

unread,
Dec 2, 2020, 4:49:36 AM12/2/20
to CodenameOne Discussions
If the container inside the InteractionDialog is created before, and then added to the dialog, is it possible or sensible to  measure it and set the dimensions like that?
(centering should be easy given the screen width/height values)

Shai Almog

unread,
Dec 2, 2020, 10:57:51 PM12/2/20
to CodenameOne Discussions
You can use getPreferredSize().
Reply all
Reply to author
Forward
0 new messages