
Untitled
By: a guest on Jan 28th, 2012 | syntax:
None | size: 1.00 KB | hits: 14 | expires: Never
#! /usr/bin/ruby
require 'tk'
def myproc(entry1, entry2)
puts entry1
end
root = TkRoot.new
root.title = "Camera Downloader V.01"
entry1 = TkEntry.new(root)
entry2 = TkEntry.new(root)
variable1 = TkVariable.new
variable2 = TkVariable.new
entry1.textvariable = variable1
entry2.textvariable = variable2
variable1.value = "Enter any text value"
variable2.value = "Enter any confidential value"
btn_OK = TkButton.new(root) do
text "OK"
borderwidth 5
underline 0
state "normal"
cursor "watch"
font TkFont.new('times 20 bold')
foreground "red"
activebackground "blue"
relief "groove"
command (proc {myproc(variable1, variable2)})
pack("side" => "bottom","padx"=> "50", "pady"=> "100"
)
end
entry1.place('height' => 25,
'width' => 150,
'x' => 10,
'y' => 10)
entry2.place('height' => 25,
'width' => 150,
'x' => 10,
'y' => 40)
Tk.mainloop