<@U78L28DMX> Id like to create a more general samp...
# tornadofx
e
@amanda.hinchman-dominguez Id like to create a more general sample that showcases DND, but also one that would give you the answers you need. Would DND for a customer object cover your use case? It's important to note that you can't/shouldn't DND an actual UI element, but rather something that identifies the tile.
👍 1
a
possibly. I had a pretty fruitless night, but I tried a new approach in tornadofx, maybe this is something similar to what you're thinking of?
e
Yeah, the DND stuff looks good. I don't know what
grid
is, but
passGridInfo
looks suspect. I also wonder by the
gridInfo
object isn't already in scope so you simply do
val gridInfo: GridInfo by inject
I also wonder why you create variables for all those event handlers? That looks suspect as well.
You should do
val pos = event.dragboard.getContent(TITLES).getPosition()
so you don't need to repeat that 4 times in a row 🙂
Then you don't need to assign all those variables either (colIndex, rowIndex, colSpan, rowSpan) as you can just pass
pos.colIndex
etc to the grid.add function.
a
Good idea! I was pretty tired last night, but determined to have an idea written down before I passed out
sounds great! I'll try that when I get home tonight.
e
I think these suggestions will clean it up a lot. I'd like to look more into your app once I get a little more free time. You're getting the hang of it, but making it more idiomatic will make it easier to maintain this in the long run.