https://kotlinlang.org logo
#gui
Title
r

Robert Jaros

03/18/2021, 6:43 PM
You are using
@GtkDsl
as an annotation for functions. The documentation says it should be used for classes. Does it work for you? (I've made some tests in my KVision DSL and your way doesn't work for me).
c

Clocks

03/18/2021, 6:45 PM
Did you annotate your annotation with
DslMarker
?
r

Robert Jaros

03/18/2021, 6:45 PM
yes
c

Clocks

03/18/2021, 6:47 PM
Currently my ability to code is hindered due to new GPU issues. I'll be able to follow up with my own tests then
r

Robert Jaros

03/18/2021, 6:48 PM
I'm using it with my classes and it works as expected. I've just noticed you are using it differently, so I'm curious if it really works for you 🙂
If I'm correct when I move this line with `title`: https://github.com/Doomsdayrs/kotlinx-gtk/blob/main/example/src/nativeMain/kotlin/Main.kt#L81 below
box(Orientation.HORIZONTAL, 10) {
it should not compile (unless I use explicit receiver with
this@applicationWindow.title
). But it compiles fine in your project, so I think your
DslMarker
is not working correctly.
c

Clocks

03/18/2021, 9:32 PM
That action is not related to DSL, that's just order of inheritance of "this"
bow is a this of "box"
But it is inside "this" of the application
6 Views