Skip to content

Instantly share code, notes, and snippets.

@amirrajan
Last active February 16, 2024 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirrajan/b8ae512f9363417229234c4e71db3b90 to your computer and use it in GitHub Desktop.
Save amirrajan/b8ae512f9363417229234c4e71db3b90 to your computer and use it in GitHub Desktop.
# ./dragonruby mygame --eval bootstrap.rb
class GTK::Console
def eval_the_set_command
cmd = current_input_str.strip
if cmd == "1"
puts "hi"
prompt.clear
return
elsif cmd == "2"
$gtk.request_quit
prompt.clear
return
else
super
end
end
end
def tick args
if args.state.tick_count == 0
$gtk.console.show
puts "What would you like to do?"
puts "1. Say hi"
puts "2. exit"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment