From: Ian Hobson Date: 2003-12-06T20:07:07+09:00 Subject: Re: Tk Help needed with grid In message , Kero writes >> I'm having trouble getting grid to show me something. > >Does the last example on this page help? > > http://httpd.chello.nl/k.vangelder/ruby/learntk/scrollbars.html > Yes it did thanks. I also needed to know that the rowconfigure command is TkGrid.rowconfigure(griddedPanel, rowNo , "weight"=>1) and TkGrid.columconfigure(griddedPanel, rowNo, "weight"=>1) where griddedPanel is the parent being managed by grid. And finally. I had to pack a parent before I saw anything at all! The routine is now. def widgetIn(parent,type) # return a widget of type within parent, # all linked up with two scroll bars # and laid out with grid # type may be TkListbox or TkText (TkCanvas not tested) widget = type.new(parent) widget.grid('row'=>0, 'column'=>0, 'sticky'=>'news') yscroll = TkScrollbar.new(parent, 'orient'=>'vertical', 'command'=> proc{|*args| widget.yview *args }) yscroll.grid('row'=>0, 'column'=>1, 'sticky'=>'ns') xscroll = TkScrollbar.new(parent, 'orient'=>'horizontal', 'command'=> proc{|*args| widget.xview *args }) xscroll.grid('row'=>1, 'column'=>0, 'sticky'=>'ew') widget.yscrollcommand(proc {|first,last| yscroll.set(first, last)}) widget.xscrollcommand(proc {|first,last| xscroll.set(first, last)}) TkGrid.rowconfigure(parent,0,'weight'=>1) TkGrid.columnconfigure(parent,0,'weight'=>1) widget end and it works. Regards Ian -- Ian - posting to a Newsgroup. Please remove everything to reply.