5 abr 2021

ejercicio TK -1

 #!/usr/bin/ruby

#https://sandbox.mc.edu/~bennet/ruby/code/tk2_rb.html

# Import the library.



require 'tk'


# Root window.

root = TkRoot.new { title 'Presioóname !!!!' 

  background '#111188'

}


# Add a label to the root window.

lab = TkLabel.new(root) { 

  text "Presioóname !!!!" 

  background '#3333AA'

  foreground '#CCCCFF'

}


# Make it appear.

lab.pack('side' => 'left', 'fill' => 'y')


# Here's a button.  Also added to root by default.

TkButton.new {

  text "PRESIONA"

  background '#EECCCC'

  activebackground '#FFEEEE'

  foreground '#990000'

  command { print "Gracias!\n" }

  pack('side' => 'right')

}


Tk.mainloop


ejercicio TK -1

 #!/usr/bin/ruby #https://sandbox.mc.edu/~bennet/ruby/code/tk2_rb.html # Import the library. require 'tk' # Root window. root = TkRo...