Ruby TK

i know im doing alot wrong, but i need all the help i can
get…so…plz spare the time, thanks

here is what i got —


Start up Tk with Ruby

require ‘tk’
root = {title “Homework #4”}

top = { relief ‘raised’; border 5 } do
text “Clear”
command { delete(0,0, end) }
pack(‘side’ => ‘left’, ‘padx’ => 15, ‘pady’ => 15)
end do
text “Cancel”
command { exit }
pack(‘side’ => ‘left’, ‘padx’ => 15, ‘pady’ => 15)
end do
borderwidth 4
highlightthickness 2
highlightcolor ‘black’
pack(‘side’ => ‘right’, ‘fill’ => ‘both’, ‘expand’ => true)
end { text ‘File:’ ; pack(‘padx’ => 15, ‘pady’ => 15) }
@text = do, ‘textvariable’ => @text).pack(‘side’ =>
‘bottom’, ‘padx’ => 15, ‘pady’ => 15)

top.pack(‘fill’ => ‘both’, ‘side’ => ‘top’)

Wow… You wern’t jokin’
Your root definition should look something like this

root =‘title’=>‘Homework#4’)

or you can set the title after the definition like this

root =

Just about everything in RubyTk follows the same hash-like pattern.
This should give you a better start.


My mistake. I had never seen the attribures in the curley brackets the
way you have them. Guess I will have to defer my expert opinion to
someone else.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs