-
Whenever I try to use an import ch.bailu.gtk.gio.ApplicationFlags
import ch.bailu.gtk.gtk.Application
import ch.bailu.gtk.gtk.Window
import ch.bailu.gtk.lib.bridge.UiBuilder
import ch.bailu.gtk.type.Strs
import kotlin.system.exitProcess
fun main(args: Array<String>) {
val app = Application("dev.matytyma.DevTools", ApplicationFlags.FLAGS_NONE)
app.onActivate {
val builder = UiBuilder.fromResource("/window.ui")
val window = Window(builder.getObject("window"))
window.show()
}
exitProcess(app.run(args.size, Strs(args)));
} |
Beta Was this translation helpful? Give feedback.
Answered by
bailuk
Sep 22, 2023
Replies: 1 comment
-
A GTK application needs an application Window. It's a GTK Api thing. fun main(args: Array<String>) {
val app = Application("dev.matytyma.DevTools", ApplicationFlags.FLAGS_NONE)
app.onActivate {
val builder = UiBuilder.fromResource("/window.ui")
val window = Window(builder.getObject("window"))
app.addWindow(window)
window.show()
}
exitProcess(app.run(args.size, Strs(args)))
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
matytyma
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A GTK application needs an application Window. It's a GTK Api thing.
I'm not exactly sure what the correct way is to set an application window in this case but I've managed to run your example by adding
app.addWindow(window)