Glimmer DSL for LibUI Basic Child Window

andyobtiva

Andy Maleh

Posted on July 26, 2022

Glimmer DSL for LibUI Basic Child Window

Glimmer DSL for LibUI v0.5.14 has been released with the following changes:

  • Basic Child Window example: a sample demonstrating how to spawn a child window from the main window
  • Modify default window closing behavior to autodetect if the window is a child window (not the main window), and if closed, ensure that does not quit the app.
  • Accept true and false as return values for on_closing window listener as aliases to 1 and 0

Basic Child Window Code

# From: https://github.com/AndyObtiva/glimmer-dsl-libui#basic-child-window

require 'glimmer-dsl-libui'

include Glimmer

window('Main Window') {
  button('Spawn Child Window') {
    on_clicked do
      window('Child Window') {
        on_closing do
          puts 'Child window is closing'
        end
      }.show
    end
  }

  on_closing do
    puts 'Main window is closing'
  end
}.show
Enter fullscreen mode Exit fullscreen mode

Basic Child Window Screenshots

screenshot1

screenshot2

Happy Glimmering!

💖 💪 🙅 🚩
andyobtiva
Andy Maleh

Posted on July 26, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related