From: ts Date: 2002-02-03T18:16:37+09:00 Subject: Re: tk.rb strange behavior?? >>>>> "P" == Phil Mitchell writes: Write it like this P> ---------minibuffer.rb------------------ P> require "tk" P> class MiniBuffer < TkFrame P> def initialize(p=nil, params=nil) P> super(p, params) P> @parent = p P> label = TkLabel.new(self) { P> text('label') P> } P> entry = TkEntry.new(self) P> label.grid('row' => '0', 'column' => '0', 'sticky' => 'ew') P> entry.grid('row' => '0', 'column' => '1', 'sticky' => 'ew') P> TkGrid.rowconfigure(self, '0', 'weight' => 1) P> TkGrid.columnconfigure(self, '0', 'weight' => 1) P> TkGrid.columnconfigure(self, '1', 'weight' => 5) P> end P> end if __FILE__ == $0 root = TkRoot.new MiniBuffer.new(root, 'borderwidth'=>'5', 'relief'=>'groove'). pack('side'=>'top', 'expand'=>1, 'fill' => 'x', 'anchor' => 'n') Tk.mainloop end i.e. create a new MiniBuffer only when the main program is 'minibuffer.rb', otherwise it will be created by the main application. Guy Decoux