Skip to content

Commit

Permalink
Create font_button.rb
Browse files Browse the repository at this point in the history
First standalone addition of font_button - currently misses 3 components.
  • Loading branch information
rubyFeedback authored Jan 24, 2025
1 parent 31c17ce commit 38301eb
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions examples2/font_button.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ============================================================================ #
# This example (font_button.rb) shall demonstrate the following
# functionality (5 components), as well as their implementation-status
# in regards to this file:
#
# :new_font_button # [DONE]
# :font_button_font # [NOT YET ADDED]
# :font_button_on_changed # [DONE]
# :free_font_button_font # [NOT YET ADDED]
# :free_font_descriptor #[NOT YET ADDED]
#
# Unsure what ":load_control_ font" is.
# ============================================================================ #
require 'libui'
LibUI.init # Initialize LibUI.

main_window = LibUI.new_window('font_button.rb', 640, 240, 1)

vbox = LibUI.new_vertical_box
LibUI.box_set_padded(vbox, 1)
_ = LibUI.new_font_button # Create a new font-button here.
LibUI.box_append(vbox, _, 0) # Add the font-button here.

LibUI.font_button_on_changed(_) {|entry|
puts 'The font was changed. (class '+entry.class.to_s+')'
}

LibUI.window_set_child(main_window, vbox)
LibUI.control_show(main_window)

LibUI.window_on_closing(main_window) {
LibUI.quit
1
}

LibUI.main
LibUI.uninit

0 comments on commit 38301eb

Please sign in to comment.