Skip to content

Instantly share code, notes, and snippets.

@phylor
Last active February 6, 2021 17:07
Show Gist options
  • Save phylor/d2b847d589a296cbcf5808643af32ba4 to your computer and use it in GitHub Desktop.
Save phylor/d2b847d589a296cbcf5808643af32ba4 to your computer and use it in GitHub Desktop.
Cheatsheet for GTK3 in Ruby

Components

  • Button
button = Gtk::Button.new(label: 'click me')
button.signal_connect 'clicked' do |widget|
  puts "I was clicked"
end
  • Input field (single line)
input = Gtk::Entry.new
input.text # Returns text
input.set_text('new text')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment