[#7878] libwww-ruby — TAKAHASHI Masayoshi <maki@...>

高橋です。ごぶさたしています。

31 messages 1998/05/13
[#7881] RE: libwww-ruby — OZAWA Sakuro <crouton@...> 1998/05/13

さく%札幌出張@塩尻です.

[#7882] Re: libwww-ruby — matz@... (Yukihiro Matsumoto) 1998/05/14

まつもと ゆきひろです

[#7884] Re: libwww-ruby — Eiji-usagi-MATSUmoto <ematsu@...> 1998/05/14

うさぎです

[#7885] Re: libwww-ruby — matz@... (Yukihiro Matsumoto) 1998/05/14

まつもと ゆきひろです

[#7886] Re: libwww-ruby — Eiji-usagi-MATSUmoto <ematsu@...> 1998/05/14

うさぎです

[#7888] Re: libwww-ruby — Mitsuru Ogino <ogino@...> 1998/05/14

ちょっとした疑問ですが。

[#7904] Re: filename (Re: libwww-ruby) — 助田 雅紀 <masaki.suketa@...>

助田です。

19 messages 1998/05/15
[#7908] Re: filename (Re: libwww-ruby) — ttate@... 1998/05/15

立石@JAISTです。

[#7909] Ruby Application Archive (Re: Re: filename (Re: libwww-ruby)) — matz@... (Yukihiro Matsumoto) 1998/05/15

まつもと ゆきひろです

[#7912] Re: filename (Re: libwww-ruby) — Makoto Nukui <gnue@...>

ども、GNUE(鵺)です。

16 messages 1998/05/15
[#7926] Re: filename (Re: libwww-ruby) — TAKAHASHI Masayoshi <maki@...> 1998/05/15

高橋です。

[#7965] links from ruby home page — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

28 messages 1998/05/18
[#7966] Re: links from ruby home page — WATANABE Tetsuya <tetsu@...> 1998/05/18

>>>>> "matz" == Yukihiro Matsumoto <matz@netlab.co.jp> writes:

[#7967] Re: links from ruby home page — matz@... (Yukihiro Matsumoto) 1998/05/18

まつもと ゆきひろです

[#7968] Re: links from ruby home page — WATANABE Tetsuya <tetsu@...> 1998/05/18

>>>>> "matz" == Yukihiro Matsumoto <matz@netlab.co.jp> writes:

[#7969] Re: links from ruby home page — matz@... (Yukihiro Matsumoto) 1998/05/18

まつもと ゆきひろです

[#7974] Re: links from ruby home page — matz@... (Yukihiro Matsumoto) 1998/05/18

まつもと ゆきひろです

[#7979] dbm — Kazuhiro HIWADA <hiwada@...> 1998/05/18

ひわだといいます。こんにちは。

[#7990] Re: dbm — matz@... (Yukihiro Matsumoto) 1998/05/19

まつもと ゆきひろです

[#8002] Dir.open order — Kikutani Makoto <kikutani@...>

きくたに@マサチューセッツです。

13 messages 1998/05/19

[#8099] cathedral v.s. bazaar — Kikutani Makoto <kikutani@...>

debian-usersで話題になってる

23 messages 1998/05/27
[#8103] Re: cathedral v.s. bazaar — TAKAHASHI Masayoshi <maki@...> 1998/05/28

高橋です。

[#8104] Re: cathedral v.s. bazaar — WATANABE Tetsuya <tetsu@...> 1998/05/28

>>>>> "T" == TAKAHASHI Masayoshi <maki@inac.co.jp> writes:

[#8106] Re: cathedral v.s. bazaar — ttate@... 1998/05/28

立石@JAISTです。

[ruby-list:8128] Re: sample program has bug

From: matz@... (Yukihiro Matsumoto)
Date: 1998-05-29 07:55:32 UTC
List: ruby-list #8128
まつもと ゆきひろです

In message "[ruby-list:8127] sample program has bug"
    on 98/05/29, Hiramatu Yoshifumi <hiramatu@cdrom.co.jp> writes:

|Canna の辞書を管理するツールをRuby/Tkで作ろうと思い立ち、勉強を
|始めました。で、sampleディレクトリの中にあるプログラムを動かして
|みたのですが、tkbrowse.rbが予定通りには動いていないようです。

そーですねえ.書き換えてみました.

--
#!/usr/local/bin/ruby
#
# This script generates a directory browser, which lists the working
# directory and allows you to open files or subdirectories by
# double-clicking.

# Create a scrollbar on the right side of the main window and a listbox
# on the left side.

require "tkscrollbox"

# The procedure below is invoked to open a browser on a given file;  if the
# file is a directory then another instance of this program is invoked; if
# the file is a regular file then the Mx editor is invoked to display
# the file.

$dirlist = {}

def browsedir (dir)
  if $dirlist.key? dir
    $dirlist[dir]
  else
    top = if $dirlist.size > 0 then TkToplevel.new else nil end
    list = TkScrollbox.new(top) {
      relief 'raised'
      width 20
      height 20
      setgrid 'yes'
      pack
    }
    list.insert 'end', *`ls #{dir}`.split

    # Set up bindings for the browser.

    list.focus
    list.bind "Control-q", proc{exit}
    list.bind "Control-c", proc{exit}
    list.bind "Control-p", proc{
      print "selection <", TkSelection.get, ">\n"
    }

    list.bind "Double-Button-1", proc{
      for i in TkSelection.get.split
	print "clicked ", i, "\n"
	browse dir, i
      end
    }
    $dirlist[dir] = list
  end
end

def browse (dir, file)
  file="#{dir}/#{file}"
  if File.directory? file
    browsedir(file)
  else
    if File.file? file
      if ENV['EDITOR']
	system format("%s %s&", ENV['EDITOR'], file)
      else
	system "xedit #{file}&"
      end
    else
      STDERR.print "\"#{file}\" isn't a directory or regular file"
    end
  end
end

# Fill the listbox with a list of all the files in the directory (run
# the "ls" command to get that information).

if ARGV.length>0 
  dir = ARGV[0]
else
  dir="."
end

browsedir(dir)
Tk.mainloop

In This Thread

Prev Next