teek 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -0
- data/Rakefile +121 -22
- data/ext/teek/extconf.rb +19 -1
- data/ext/teek/tcltkbridge.c +44 -2
- data/ext/teek/tcltkbridge.h +3 -0
- data/ext/teek/tkdrop.c +66 -0
- data/ext/teek/tkdrop.h +26 -0
- data/ext/teek/tkdrop_macos.m +141 -0
- data/ext/teek/tkdrop_win.c +232 -0
- data/ext/teek/tkdrop_x11.c +337 -0
- data/ext/teek/tkwin.c +42 -0
- data/lib/teek/platform.rb +29 -0
- data/lib/teek/version.rb +1 -1
- data/lib/teek.rb +248 -7
- data/teek.gemspec +3 -2
- metadata +7 -45
- data/sample/calculator.rb +0 -255
- data/sample/debug_demo.rb +0 -43
- data/sample/goldberg.rb +0 -1803
- data/sample/goldberg_helpers.rb +0 -170
- data/sample/minesweeper/assets/MINESWEEPER_0.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_1.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_2.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_3.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_4.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_5.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_6.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_7.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_8.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_F.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_M.png +0 -0
- data/sample/minesweeper/assets/MINESWEEPER_X.png +0 -0
- data/sample/minesweeper/minesweeper.rb +0 -452
- data/sample/optcarrot/vendor/optcarrot/apu.rb +0 -856
- data/sample/optcarrot/vendor/optcarrot/config.rb +0 -257
- data/sample/optcarrot/vendor/optcarrot/cpu.rb +0 -1162
- data/sample/optcarrot/vendor/optcarrot/driver.rb +0 -144
- data/sample/optcarrot/vendor/optcarrot/mapper/cnrom.rb +0 -14
- data/sample/optcarrot/vendor/optcarrot/mapper/mmc1.rb +0 -105
- data/sample/optcarrot/vendor/optcarrot/mapper/mmc3.rb +0 -153
- data/sample/optcarrot/vendor/optcarrot/mapper/uxrom.rb +0 -14
- data/sample/optcarrot/vendor/optcarrot/nes.rb +0 -105
- data/sample/optcarrot/vendor/optcarrot/opt.rb +0 -168
- data/sample/optcarrot/vendor/optcarrot/pad.rb +0 -92
- data/sample/optcarrot/vendor/optcarrot/palette.rb +0 -65
- data/sample/optcarrot/vendor/optcarrot/ppu.rb +0 -1468
- data/sample/optcarrot/vendor/optcarrot/rom.rb +0 -143
- data/sample/optcarrot/vendor/optcarrot.rb +0 -14
- data/sample/optcarrot.rb +0 -354
- data/sample/paint/assets/bucket.png +0 -0
- data/sample/paint/assets/cursor.png +0 -0
- data/sample/paint/assets/eraser.png +0 -0
- data/sample/paint/assets/pencil.png +0 -0
- data/sample/paint/assets/spray.png +0 -0
- data/sample/paint/layer.rb +0 -255
- data/sample/paint/layer_manager.rb +0 -179
- data/sample/paint/paint_demo.rb +0 -837
- data/sample/paint/sparse_pixel_buffer.rb +0 -202
- data/sample/sdl2_demo.rb +0 -318
- data/sample/threading_demo.rb +0 -494
data/sample/debug_demo.rb
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Demo of the Teek debugger window.
|
|
4
|
-
# Run: ruby -Ilib sample/debug_demo.rb
|
|
5
|
-
|
|
6
|
-
require 'teek'
|
|
7
|
-
|
|
8
|
-
app = Teek::App.new(debug: true)
|
|
9
|
-
|
|
10
|
-
# Show the main app window
|
|
11
|
-
app.show
|
|
12
|
-
app.set_window_title('Debug Demo App')
|
|
13
|
-
app.set_window_geometry('300x200')
|
|
14
|
-
|
|
15
|
-
# Create some widgets
|
|
16
|
-
frame = app.create_widget('ttk::frame')
|
|
17
|
-
app.command(:pack, frame, fill: :both, expand: 1, padx: 10, pady: 10)
|
|
18
|
-
|
|
19
|
-
lbl = app.create_widget('ttk::label', parent: frame, text: 'Hello from the app')
|
|
20
|
-
app.command(:pack, lbl, pady: 5)
|
|
21
|
-
|
|
22
|
-
ent = app.create_widget('ttk::entry', parent: frame)
|
|
23
|
-
app.command(:pack, ent, pady: 5)
|
|
24
|
-
|
|
25
|
-
# Button that creates more widgets dynamically
|
|
26
|
-
dynamic_widgets = []
|
|
27
|
-
add_btn = app.create_widget('ttk::button', parent: frame, text: 'Add Widget',
|
|
28
|
-
command: proc { |*|
|
|
29
|
-
btn = app.create_widget('ttk::button', parent: frame, text: "Button #{dynamic_widgets.size + 1}")
|
|
30
|
-
app.command(:pack, btn, pady: 2)
|
|
31
|
-
dynamic_widgets << btn
|
|
32
|
-
})
|
|
33
|
-
app.command(:pack, add_btn, pady: 5)
|
|
34
|
-
|
|
35
|
-
# Button to destroy last widget
|
|
36
|
-
rm_btn = app.create_widget('ttk::button', parent: frame, text: 'Remove Widget',
|
|
37
|
-
command: proc { |*|
|
|
38
|
-
widget = dynamic_widgets.pop
|
|
39
|
-
widget&.destroy
|
|
40
|
-
})
|
|
41
|
-
app.command(:pack, rm_btn, pady: 5)
|
|
42
|
-
|
|
43
|
-
app.mainloop
|