Another game witk ‘tk’
If somebody else and maybe all of you guys are playing ruby with Gtk2, i will play with ‘Tk’. I dont know the good reason to use this damn thing but just like my mum said….TRY IT !!…Maybe just because i do not find free e-book for Gtk Ruby
Just simple way using my paradise way
$sudo apt-get install libtk-ruby
This library provides some widgets and container of course under tk its self..And this is my first code for tk..
$gedit cobagui.rb
class Aguilera
require ‘tk’ #kudu ada kode sakti ini untuk request module Tk
#Merupakan kode sakti juga. Kudu ada sintak ini untuk mendeklarasikan document root
top = TkRoot.new {title “Coba Label dan Entry Widget”}
#kode penambahan widget Label
lb1 = TkLabel.new(top){
text ‘Ini label Mbak…’
background “yellow”
foreground “blue”
pack(‘padx’=>10, ‘pady’=>10, ’side’=>’left’)
}
#kode penambahan widgets Entry
e1 = TkEntry.new(){
background “red”
foreground “black”
pack(‘padx’=>10, ‘pady’=>10, ’side’=>’left’)
}
list1 = TkListbox.new(top)
list1.insert(1,”Bakpao”)
list1.insert(2,”Ramen”)
list1.insert(3,”Pizza”)
list1.pack()
checkVar=TkVariable.new
c1 = TkCheckButton.new(top){
text “Klik sini jika Anda Lapar”
variable checkVar
pack()
}
Tk.mainloop
end
To good to be truth
Belutz berkata,
Maret 30, 2008 pada 5:30 am
ahahahahaha….
itu aplikasinya buat pesen makanan dari jauh yah?