I
Ian Hobson
Hi All,
I'm having trouble getting grid to show me something.
I am trying to write a routine (called from within initialize) that will
fill a TkPanel with a TkText or TkListbox, all linked up with two
scrollbars.
Def widgetIn(parent,type)
# return a widet of type within parent, all linked up with two
scroll bars
# and laid out with grid
widget = type.new(parent)
xscroll = TkScrollbar.new(parent,
'orient'=>'horizontal',
'command'=> proc{|*args| widget.xview
*args })
yscroll = TkScrollbar.new(parent,
'orient'=>'vertical',
'command'=> proc{|*args| widget.yview
*args })
widget.yscrollcommand(proc {|first,last| yscroll.set(first, last)})
widget.xscrollcommand(proc {|first,last| xscroll.set(first, last)})
here is where I am stuck.
now I need to grid them with 'sticky'=>'news' in layout
grid(widget, yscroll)
grid(xscroll)
and then (possibly) call gridColumnconfigure(1,'weight'=>1)
and gridRowConfigure(1,'weight=>1) to set the grid to
the right shape.
Everything I have tried has failed. What is the correct form? I'm trying
to translate from TCL and perl but I know neither language!!
Thanks
Ian
I'm having trouble getting grid to show me something.
I am trying to write a routine (called from within initialize) that will
fill a TkPanel with a TkText or TkListbox, all linked up with two
scrollbars.
Def widgetIn(parent,type)
# return a widet of type within parent, all linked up with two
scroll bars
# and laid out with grid
widget = type.new(parent)
xscroll = TkScrollbar.new(parent,
'orient'=>'horizontal',
'command'=> proc{|*args| widget.xview
*args })
yscroll = TkScrollbar.new(parent,
'orient'=>'vertical',
'command'=> proc{|*args| widget.yview
*args })
widget.yscrollcommand(proc {|first,last| yscroll.set(first, last)})
widget.xscrollcommand(proc {|first,last| xscroll.set(first, last)})
here is where I am stuck.
now I need to grid them with 'sticky'=>'news' in layout
grid(widget, yscroll)
grid(xscroll)
and then (possibly) call gridColumnconfigure(1,'weight'=>1)
and gridRowConfigure(1,'weight=>1) to set the grid to
the right shape.
Everything I have tried has failed. What is the correct form? I'm trying
to translate from TCL and perl but I know neither language!!
Thanks
Ian