Display a label and an Entry widget: : Entry TextField « Tk « Ruby






Display a label and an Entry widget:


require 'tk'
top = TkRoot.new {title "Label and Entry Widget"}
lb1 = TkLabel.new(top){
    text 'Hello World'
    background "yellow"
    foreground "blue"
    pack()
}
e1 = TkEntry.new(top){
    background "red"
    foreground "blue"
    pack()
}
Tk.mainloop

 








Related examples in the same category

1.Text Field