Skip to content
This repository was archived by the owner on Apr 28, 2021. It is now read-only.

Commit 3edbec1

Browse files
committed
add play button
1 parent 24664fe commit 3edbec1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/gui/buttons.jl

+7-3
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,18 @@ function widget{T <: Range}(
147147
)
148148
slider(value(r), screen; args...)
149149
end
150+
function playbutton(screen; icon_size = 10mm)
151+
play_button, play_stop_signal = GLVisualize.toggle_button(
152+
loadasset("play.png"), loadasset("pause.png"), screen,
153+
primitive = IRect(0, 0, icon_size, icon_size)
154+
)
155+
end
150156

151157
function play_slider(
152158
screen, icon_size = Signal(54), range = 1:360;
153159
slider_length = 200
154160
)
155-
play_button, play_stop_signal = GLVisualize.toggle_button(
156-
loadasset("checked.png"), loadasset("unchecked.png"), screen
157-
)
161+
play_button, play_stop_signal = playbutton(screen)
158162
play_s = map(!, play_stop_signal)
159163
slider_s, slider_w = slider(
160164
range, screen,

0 commit comments

Comments
 (0)