We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bd8b95b + e9d521c commit b4008ffCopy full SHA for b4008ff
basics/web/embedded_links.rb
@@ -1,8 +1,7 @@
1
require 'picrate'
2
# Loading URLs.
3
#
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.
+# A linux Specific version is fine on the RaspberryPI
6
class EmbeddedLinks < Processing::App
7
8
def setup
@@ -23,9 +22,13 @@ def draw
23
22
line 155, 85, 155, 100
24
end
25
+ def open(url)
26
+ system 'xdg-open', url
27
+ end
28
+
29
def mouse_pressed
- link 'https://ruby-processing.github.io/PiCrate/' if @over_left_button
- 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
32
33
34
def mouse_moved
0 commit comments