Skip to content

Commit b4008ff

Browse files
committed
2 parents bd8b95b + e9d521c commit b4008ff

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

basics/web/embedded_links.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
require 'picrate'
22
# Loading URLs.
33
#
4-
# Click on the left button to open a different URL in the same window (Only
5-
# works online). Click on the right button to open a URL in a new browser window.
4+
# A linux Specific version is fine on the RaspberryPI
65
class EmbeddedLinks < Processing::App
76

87
def setup
@@ -23,9 +22,13 @@ def draw
2322
line 155, 85, 155, 100
2423
end
2524

25+
def open(url)
26+
system 'xdg-open', url
27+
end
28+
2629
def mouse_pressed
27-
link 'https://ruby-processing.github.io/PiCrate/' if @over_left_button
28-
link 'https://ruby-processing.github.io/' if @over_right_button
30+
open('https://ruby-processing.github.io/PiCrate/') if @over_left_button
31+
open('https://monkstone.github.io/') if @over_right_button
2932
end
3033

3134
def mouse_moved

0 commit comments

Comments
 (0)