AndyObtiva/glimmer-dsl-libui

View on GitHub
examples/basic_code_area.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'glimmer-dsl-libui'

class BasicCodeArea
  include Glimmer::LibUI::Application
  
  before_body do
    @code = <<~CODE
      # Greets target with greeting
      def greet(greeting: 'Hello', target: 'World')
        puts "\#{greeting}, \#{target}!"
      end
      
      greet
      greet(target: 'Robert')
      greet(greeting: 'Aloha')
      greet(greeting: 'Aloha', target: 'Nancy')
      greet(greeting: 'Howdy', target: 'Doodle')
    CODE
  end
  
  body {
    window('Basic Code Area', 400, 300) {
      code_area(language: 'ruby', code: @code)
    }
  }
end

BasicCodeArea.launch