0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

windows11で、sketchup6 その96

Posted at

概要

windows11に、sketchup6を入れてみた。
rubyで、3Dを書く。
練習問題やってみた。

練習問題

webdialogで、プログラムランチャーを書け。

写真

image.png

サンプルコード


def testweb2
	wd = UI::WebDialog.new("Ruby ", true, 'Runcher', 500, 200)
	wd.set_html <<-EOS
		<html>
		<head>
		</head>
		<body>
		<div><label><input type="radio" name="fruit" value="run0">サイコロ</label></div>
		<div><label><input type="radio" name="fruit" value="run1">時計</label></div>
		<div><label><input type="radio" name="fruit" value="run2">ブロック崩し</label></div>
		<br>
		<button onclick="run()">run</button>
		<script>
		function run() {
			var elements = document.getElementsByName('fruit');
			for (var i = 0; i < elements.length; i++)
			{
				if (elements.item(i).checked)
				{
					window.location = 'skp:' + elements.item(i).value;
				}
			}
		}
		</script>
		</body>
		</html>
	EOS
	wd.add_action_callback('run0') do |d, a|
		create_dice
	end
	wd.add_action_callback('run1') do |d, a|
		Tokei.new
	end
	wd.add_action_callback('run2') do |d, a|
		Block.new
	end
	wd.show
end




以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?