Skip to content

Commit 209f595

Browse files
committed
rework Clock class and sample
1 parent f1bfc00 commit 209f595

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

samples/clock_demo.cr

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class CairoApp
1515
hb1 = Gtk::Box.new :horizontal, 2
1616
clock1 = GtkCustomWidgets::Clock(GtkCustomWidgets::DigitalClockDisplay).new
1717
clock1.blink = true
18-
hb1.pack_start(clock1, expand = true, fill = true, padding = 2)
18+
hb1.pack_start(clock1.display, expand = true, fill = true, padding = 2)
1919
clock2 = GtkCustomWidgets::Clock(GtkCustomWidgets::AnalogClockDisplay).new
20-
hb1.pack_start(clock2, expand = true, fill = true, padding = 2)
20+
hb1.pack_start(clock2.display, expand = true, fill = true, padding = 2)
2121
hb2 = Gtk::Box.new :horizontal, 2
2222
btn0 = Gtk::Button.new_with_label "start"
2323
btn0.on_clicked {clock1.start

src/widgets/clock.cr

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ module GtkCustomWidgets
3030
next true
3131
end
3232
end
33+
34+
def display
35+
@display
36+
end
3337

3438
def location=(loc : Time::Location)
3539
@location = loc

0 commit comments

Comments
 (0)