Any idea why the view might not be rendering?
# doodle
f
Any idea why the view might not be rendering?
Copy code
class UsefulApp(display: Display) : Application {
    init {
        println("Hi!")
        val pushButton = Label("Click me")
        pushButton.size = Size(300, 300)
        display += listOf(pushButton)
    }

    override fun shutdown() {}
}
n
Most views delegate rendering to a behavior; PushButton does this. So you’ll need to give it one. The best way is to use a Theme so all your buttons look the same. You can see how behaviors modules are registered in the Photos app launcher, and how a theme is selected in the app itself. There, I use several behaviors from BasicTheme. There are also many native behaviors, with one existing for buttons. But you can also set one inline. Here’s an example of using a simple button behavior that lets you render onto its canvas:
Copy code
val tf = PushButton("Hi!").apply {
    behavior = simpleButtonRenderer { button, canvas -> canvas.rect(button.bounds.atOrigin, fill = Red.paint) }
}
f
Thank you so much!
fixed 🙂
well partially, fired doesn’t seem to trigger when clicked
n
sounds like you didn’t include the PointerModule. adding it to your module list will enable pointer handling. doodle minimizes the default modules to reduce bundle size; even leaving out pointer and keyboard by default.
the list of optional modules for Web is here.
f
That was it! thank you!!
apologies for all the basic questions
n
this might be where a hypothetical VSplitPanel would let external listeners know that it’s left item had changed. here’s how the built in SplitPanel does it.