Hello World with Tk

suggest change

Tk is the standard graphical user interface (GUI) for Ruby. It provides a cross-platform GUI for Ruby programs.

Example code:

require "tk"
TkRoot.new{ title "Hello World!" }
Tk.mainloop

The result:

Step by Step explanation:

require "tk"

Load the Tk library.

TkRoot.new{ title "Hello World!" }

Create a root window titled Hello World.

Tk.mainloop

Start the main loop and display the widget.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents