https://kotlinlang.org logo
Title
c

Cody Mikol

05/01/2022, 3:53 PM
What is the proper way to do something like absolutely positioned elements? I'm trying to make a selection drop down. Another window element seems like it could work, but doesn't seem like the right choice.
k

Kirill Grouchnikov

05/01/2022, 5:54 PM
Positioned and fully contained within the same window, or can it go outside the original window bounds?
c

Cody Mikol

05/01/2022, 8:05 PM
Contained in the window
a

Abdelilah El Aissaoui

05/01/2022, 10:57 PM
What about
Popup
? Setting the
popupPositionProvider
you can decide where to display it
c

Cody Mikol

05/04/2022, 12:23 PM
Looks like PopUp can't go outside the window bounds
a

Abdelilah El Aissaoui

05/04/2022, 12:24 PM
Didn't you want it contained in the window?
c

Cody Mikol

05/04/2022, 12:24 PM
I mispoke, my bad 😅
k

Kirill Grouchnikov

05/04/2022, 12:26 PM
Then it has to be hosted in its own window
c

Cody Mikol

05/04/2022, 12:26 PM
Ah, ok
a

Abdelilah El Aissaoui

05/04/2022, 12:27 PM
Ah 😂 then not sure if a
Dialog
can be an option, otherwise
Window
is the only other option I am aware of
c

Cody Mikol

05/04/2022, 12:27 PM
I noticed that was causing some weird behavior in window previews on linux
Not sure how to phrase this question, but is there a way to hint to the OS that the extra window shouldn't be previewed?
sorry if that doesnt make sense 😅
And thank you both for your help
a

Abdelilah El Aissaoui

05/04/2022, 12:33 PM
Yeah, I know what you mean. Not sure tbh, I guess it's sth that depends on the window manager or display server (no idea tho)
k

Kirill Grouchnikov

05/04/2022, 12:34 PM
Try this
c

Cody Mikol

05/04/2022, 12:48 PM
That seems to have done the trick!
thank you
should I be creating that via AwtWindow ?
k

Kirill Grouchnikov

05/04/2022, 12:57 PM
I don't follow the question
c

Cody Mikol

05/04/2022, 1:01 PM
I was following your advice along with this documentation here. They wrap the ComposableWindow in something like
AwtWindow(creeate = { /* ComposableWindow Here */ }, dispose = {})
Without that the ComposableWindow isn't rendered to the screen, but I'm not sure if this is the correct way to do things
or what I should provide to the dispose argument
k

Kirill Grouchnikov

05/04/2022, 1:04 PM
If you're doing an explicit
ComposeWindow
, you're in charge of configuring everything, including the size, position, and calling
isVisible = true
on it
You would also need to track clicks outside of its bounds and
Escape
key hits to dismiss the popup