Closed kojix2 closed 3 years ago
An easy way to solve this problem is to override UI#timer. But before doing that, it would be better to check other callbacks used in libui. There may be other functions that cause the same problem.
I just added support for timer and queue_main block syntax to Glimmer DSL for LibUI today (0.2.0)
Here are examples using it:
https://github.com/AndyObtiva/glimmer-dsl-libui/#timer
https://github.com/AndyObtiva/glimmer-dsl-libui/#color-the-circles
The implementation includes some extra convenience options like specifying repeat option as a finite integer or disabling repetition after one run (currently at the bottom of this file):
https://github.com/AndyObtiva/glimmer-dsl-libui/blob/master/lib/glimmer/libui.rb
So, your implementation in LibUI is more than good enough at the binding layer to enable Glimmer’s code at the higher DSL layer. I don’t think you have to worry about it.
Amazing! You work so fast, I can't keep up with you at all. Well, I'll take my time.
Maybe I could have solved this issue, but I haven't tested it enough, so I'll wait and see.
Given the Layered Architecture of Glimmer DSL for LibUI, I think we have the following layers from top to bottom, and each is performing its function sufficiently, so I wouldn't worry:
You can't write this way.
Cannot add callbacks as instance variables to 1000. (This is necessary to avoid garbage collection.)
You can write it this way.
However, the first way of writing is better.