Create  Edit  Diff  Phillro Industries  Index  Search  Changes  History  Source  RSS  Note  wikifarm  Login

Component#set

[ap-list:2974] Component#set

たけ(tk)です

 "repeater" さんが次のような面白い提案をしてきました。[Apollo-talk:46]

 皆様のお好みはどちらでしょう?

--

require "phi" ; include Phi
module Phi
class Component
  def set(properties)
    properties.each { |key, value| send((key.to_s << '=').intern, value) }
    return self
  end
end
end
form = Form.new
button1 = Button.new(form,:button1).set(
  :top => 100,
  :left => 100,
  :height => 100)
b = button2 = Button.new(form,:button2)
  b.top = 100
  b.left = 200
  b.height = 100
form.show
mainloop

--

Last modified:2003/07/14 21:39:22
Keyword(s):
References: