Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "rubygems"
- gem "rubyscript2exe"
- require "rubyscript2exe"
- RUBYSCRIPT2EXE.tk = true
- RUBYSCRIPT2EXE.rubyw = true
- require 'tk'
- class Lol
- def run
- @window.mainloop
- end
- def initialize
- @window = TkRoot.new(:title => 'DUMM??', 'height' => 200, 'width' => 300) do
- root.geometry('+480+380')
- background 'orange'
- end
- button_ja()
- button_nein_1
- label
- end
- def label
- TkLabel.new('height' => 1, 'width' => 20) do
- place 'x' => 10, 'y' => 20
- background 'yellow'
- foreground 'green'
- text 'Bist du eigentlich dumm??'
- font TkFont.new('times 18 bold')
- end
- end
- def button_ja
- @bt = TkButton.new('height' => 1, 'width' => 5) do
- place 'x' => 20, 'y' => 120
- text 'JA'
- background 'red'
- foreground 'blue'
- font TkFont.new('times 20 bold')
- end
- @bt.bind('ButtonRelease-1') do
- msgBox = Tk.messageBox(
- 'type' => "ok",
- 'icon' => "warning",
- 'title' => "",
- 'message' => "Hab ich es doch gewusst..."
- )
- end
- def button_nein_1
- @bt1 = TkButton.new('height' => 1, 'width' => 5) do
- place 'x' => 180, 'y' => 120
- text 'Nein'
- background 'blue'
- foreground 'red'
- font TkFont.new('times 20 bold')
- end
- @bt1.bind('Enter') do
- @bt1.state = 'disabled'
- @bt1.configure('text', '')
- @bt1.configure('background', 'orange')
- @bt1.configure('relief', 'flat')
- @bt1.configure('foreground', 'orange')
- end
- @bt1.bind('Leave') do
- @bt1.state = 'active'
- @bt1.configure('text', 'NEIN')
- @bt1.configure('background', 'blue')
- @bt1.configure('relief', 'raised')
- @bt1.configure('foreground', 'red')
- end
- end
- end
- hehe = Lol.new
- hehe.run
- end
Add Comment
Please, Sign In to add comment