[#15179] ruby にメッセージの国際化の仕組みはありますか? — "HIRATA Naoto" <hirata-naoto@...>

はじめまして,平田@武蔵工大と申します.

9 messages 1999/07/01

[#15264] 年月を範囲でうまく扱うには? — Yukihiko Eda <yuki-e@...>

江田です。

19 messages 1999/07/06
[#15265] 年月を範囲でうまく扱うには? — gotoken@... (GOTO Kentaro) 1999/07/06

In message "[ruby-list:15264] 年月を範囲でうまく扱うには?"

[#15284] Re: 年月を範囲でうまく扱うには? — Yukihiko Eda <yuki-e@...> 1999/07/07

> 大した手間でもなさそうだし、年月のクラスを作っちゃうのは

[#15296] Re: 年月を範囲でうまく扱うには? — gotoken@... (GOTO Kentaro) 1999/07/08

In message "[ruby-list:15284] Re: 年月を範囲でうまく扱うには?"

[#15323] Re: 年月を範囲でうまく扱うには? — Tadayoshi Funaba <tadf@...> 1999/07/08

ふなばです。

[#15324] Re: 年月を範囲でうまく扱うには? — gotoken@... (GOTO Kentaro) 1999/07/08

ごとけんです

[#15325] Re: 年月を範囲でうまく扱うには? — Wakou Aoyama <wakou@...> 1999/07/08

青山です。

[#15326] Range, ruby-talk (Re: 年月を範囲でうまく扱うには?) — gotoken@... (GOTO Kentaro) 1999/07/08

ごとけんです

[#15378] RubyFAQ-990713 — Akira Endo <akendo@...3.rim.or.jp>

遠藤です.

14 messages 1999/07/13

[#15467] debugger exception handle (Re: Modified debug.rb) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

25 messages 1999/07/16
[#15490] Re: debugger exception handle (Re: Modified debug.rb) — keiju@... (石塚圭樹) 1999/07/16

けいじゅ@日本ラショナルソフトウェアです.

[#15528] Re: debugger exception handle (Re: Modified debug.rb) — matz@... (Yukihiro Matsumoto) 1999/07/19

まつもと ゆきひろです

[#15551] Re: debugger exception handle (Re: Modified debug.rb) — keiju@... (石塚圭樹) 1999/07/20

けいじゅ@日本ラショナルソフトウェアです.

[#15552] Re: debugger exception handle (Re: Modified debug.rb) — gotoken@... (GOTO Kentaro) 1999/07/20

In message "[ruby-list:15551] Re: debugger exception handle (Re: Modified debug.rb)"

[#15643] Re: debugger exception handle (Re: Modified debug.rb) — keiju@... (石塚圭樹) 1999/07/25

けいじゅ@日本ラショナルソフトウェアです.

[#15518] 省略記法 — ARIMA Yasuhiro <fit0298@...>

Pascal では、構造体のメンバを表記する際に省略記法があります。

16 messages 1999/07/19

[#15530] 半 to 全 — Sinichiro Dezawa <dezawa@...>

出沢です

27 messages 1999/07/19

[#15557] グループウェアサーバ — hisanori@...

松尾です。こんにちは。

22 messages 1999/07/21
[#15558] Re: グループウェアサーバ — a-shigi@... (A.Shigihara) 1999/07/21

ども鴫原です。

[#15565] Re: グループウェアサーバ — hisanori@... 1999/07/21

松尾です。

[#15566] Re: グループウェアサーバ — a-shigi@... (A.Shigihara) 1999/07/21

ども鴫原です。

[#15669] cannot install ruby-gtk into FreeBSD 2.2.x — TAKAHASHI Masayoshi <maki@...>

Ruby Workshopのお手紙(請求書とも言う)が届いてうれしい高橋征義です。

26 messages 1999/07/27
[#15678] Re: cannot install ruby-gtk into FreeBSD 2.2.x — Hiroshi Igarashi <igarashi@...> 1999/07/27

いがらしです。

[#15686] Re: cannot install ruby-gtk into FreeBSD 2.2.x — TAKAHASHI Masayoshi <maki@...> 1999/07/27

高橋征義です。

[#15689] Re: cannot install ruby-gtk into FreeBSD 2.2.x — matz@... (Yukihiro Matsumoto) 1999/07/28

まつもと ゆきひろです

[#15692] Re: cannot install ruby-gtk into FreeBSD 2.2.x — Hiroshi Igarashi <igarashi@...> 1999/07/28

いがらしです。

[#15780] Re: cannot install ruby-gtk into FreeBSD 2.2.x — matz@... (Yukihiro Matsumoto) 1999/07/31

まつもと ゆきひろです

[#15807] Re: cannot install ruby-gtk into FreeBSD 2.2.x — WATANABE Hirofumi <eban@...> 1999/07/31

わたなべです.

[#15815] Re: cannot install ruby-gtk into FreeBSD 2.2.x — WATANABE Hirofumi <eban@...> 1999/08/01

わたなべです.

[#15818] Re: cannot install ruby-gtk into FreeBSD 2.2.x — Hiroshi Igarashi <igarashi@...> 1999/08/01

いがらしです。

[#15823] Re: cannot install ruby-gtk into FreeBSD 2.2.x — matz@... (Yukihiro Matsumoto) 1999/08/01

まつもと ゆきひろです

[#15679] about postgres-0.5.1 — goto@...

後藤@横河工事です。たびたびお世話になります。

29 messages 1999/07/27
[#15680] Re: about postgres-0.5.1 — Shugo Maeda <shugo@...> 1999/07/27

前田です。

[#15681] Re: about postgres-0.5.1 — goto@... 1999/07/27

後藤@横河工事です。

[#15682] Re: about postgres-0.5.1 — matz@... (Yukihiro Matsumoto) 1999/07/27

まつもと ゆきひろです

[#15684] Re: about postgres-0.5.1 — goto@... 1999/07/27

後藤@横河工事です。

[#15716] Re: about postgres-0.5.1 — kawakami <kawakami@...> 1999/07/29

[#15720] ruby debugger (like gdb attach) — kikutani@...

前にも2度ほど質問しましたが、cursesとかslangとかののrubyアプリを

28 messages 1999/07/29
[#15730] Re: ruby debugger (like gdb attach) — matz@... (Yukihiro Matsumoto) 1999/07/30

まつもと ゆきひろです

[#15743] Re: ruby debugger (like gdb attach) — kikutani@... 1999/07/30

On Fri, 30 Jul 1999 12:53:46 +0900,

[#15817] Re: ruby debugger (like gdb attach) — kikutani@... 1999/08/01

Fri, Jul 30, 1999 at 02:13:13PM +0900 において

[#15819] Re: ruby debugger (like gdb attach) — "NAKAMURA, Hiroshi" <nakahiro@...> 1999/08/01

なひです.

[#15822] Re: ruby debugger (like gdb attach) — kikutani@... 1999/08/01

On Sun, 1 Aug 1999 21:37:31 +0900,

[ruby-list:15294] gtk calculator

From: Takahiro Maebashi <maebashi@...>
Date: 1999-07-08 02:03:23 UTC
List: ruby-list #15294
前橋です。

某 python-ml-jp に pygtk で作った電卓が出ていたので、それを ruby/gtk で
書き直してみました。python版よりさらにスッキリしたものになりました:-p。
実際に使うときはスクリプトの文字コードを EUC にして、環境変数 LANG を日
本語に(ja_JP.ujis とか ja_JP.EUCとか)してください。ruby-gtk 0.19 でしか
動作は確認していません。

なお、オリジナルは
竹田英二「GTK+ではじめるXプログラミング」'99, 技術評論社, pp.71-78.
に出ていたものだそうです。

----------------------------------------------------------------------
#!/usr/bin/env ruby

require 'gtk'

class Calculator

  MAX_DIGIT = 12
  ADD = "add"; SUB = "sub"; MUL = "mul"; DIV = "div"

  def initialize
    num = ""; dot = false	# 組み立て中の数
    erred = false		# エラー状態か?
    operation = nil		# ∈ {nil, ADD, SUB, MUL, DIV}
    operandl = 0.0		# 左オペランド
    window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
    window.set_title('calculator')
    window.signal_connect('destroy') {Gtk.main_quit}
    window.border_width = 5
    table = Gtk::Table.new(5, 5, true)
    window.add(table)
    table.show
    disp = Gtk::Entry.new	# 電卓の表示部
    disp.set_editable(false)
    table.attach(disp, 0, 5, 0, 1)
    disp.show

    digit_clicked = proc {|widget, digit|
      unless erred
	if disp.get_text.length < MAX_DIGIT
	  num = num + digit.to_s
	  disp.set_text(num)
	end
      end
    }

    dot_clicked = proc {
      unless erred
	if disp.get_text.length < MAX_DIGIT - 1 and not dot
	  dot = true
	  num = num + '.'
	  disp.set_text(num)
	end
      end
    }

    equ_clicked = proc {
      unless erred
	x = Float(disp.get_text)
	case operation
	when ADD
	  answer = operandl + x
	when SUB
	  answer = operandl - x
	when MUL
	  answer = operandl * x
	when DIV
	  if x == 0.0
	    disp.set_text('Error')
	    erred = true
	  else
	    answer = operandl / x
	  end
	end
	unless erred
	  num = ''; dot = false
	  unless operation == nil
	    operation = nil
	    disp.set_text(answer.to_s)
	  end
	end
      end
    }

    sign_clicked = proc {
      unless erred
	x = Float(disp.get_text)
	answer = -x
	disp.set_text(answer.to_s)
	num = ''; dot = false
      end
    }

    op_clicked = proc {|widget, opcode|
      unless num == '' then equ_clicked.call end
      unless erred
	operation = opcode
	operandl = Float(disp.get_text)
	num = ''; dot = false
      end
    }

    cle_clicked = proc {
      unless erred
	if num == '' then operation = nil end
	disp.set_text('0')
	num = ''; dot = false
      end
    }

    clr_clicked = proc {
      erred = false
      operation = nil
      cle_clicked.call
    }

    [
      ["7",  0, 1, 1, 2, digit_clicked, 7],
      ["8",  1, 2, 1, 2, digit_clicked, 8],
      ["9",  2, 3, 1, 2, digit_clicked, 9],
      ["÷", 3, 4, 1, 2, op_clicked, DIV],
      ["C",  4, 5, 1, 2, clr_clicked, nil],
      ["4",  0, 1, 2, 3, digit_clicked, 4],
      ["5",  1, 2, 2, 3, digit_clicked, 5],
      ["6",  2, 3, 2, 3, digit_clicked, 6],
      ["×", 3, 4, 2, 3, op_clicked, MUL],
      ["CE", 4, 5, 2, 3, cle_clicked, nil],
      ["1",  0, 1, 3, 4, digit_clicked, 1],
      ["2",  1, 2, 3, 4, digit_clicked, 2],
      ["3",  2, 3, 3, 4, digit_clicked, 3],
      ["−", 3, 4, 3, 4, op_clicked, SUB],
      ["=", 4, 5, 3, 5, equ_clicked, nil],
      ["0",  0, 1, 4, 5, digit_clicked, 0],
      [".",  1, 2, 4, 5, dot_clicked, nil],
      ["+/-",2, 3, 4, 5, sign_clicked, nil],
      ["+", 3, 4, 4, 5, op_clicked, ADD]
    ].each {|label, la, ra, ta, ba, func, arg|
      button = Gtk::Button.new(label)
      table.attach(button, la, ra, ta, ba)
      button.signal_connect('clicked', arg, &func)
      button.show
    }
    window.show
    cle_clicked.call
  end

end

if __FILE__ == $0
  Calculator.new
  Gtk.main
end

In This Thread