From: Kero van Gelder Date: 2001-10-28T19:47:03+09:00 Subject: [ruby-talk:23673] Re: Two Ruby-Tk questions > > You can scale() the canvas. > Thanks a lot. > > Does scale only "increase" my canvas, or > would it make my ovals bigger/smaller, too? scale() scales the content of the canvas. > I only want to make the canvas bigger and leave > the ovals as they are; oops, I misunderstood your question. > My code fragment looks like: > > parent.bind("Configure", proc{|e| p "configure"; > @canvas.configure('height'=> e.height, 'width'=> e.width); > } ) > > But that does not do the trick, as configure calls configure > again & when I start the programm the window grows > in "size"; Really nice effect - could be avoided by a control variable, > but I'm sure there must be an easier way; :-( canvas = TkCanvas.new() canvas.pack('fill'=>'both', 'expand'=>true) Now your canvas will "expand" in "both" directions when you enlarge the window. No need to bind to an event for that. See also http://httpd.chello.nl/k.vangelder/ruby/learntk/ mainly chapter 2 (Simple Widgets) and 4 (Combining widgets) (and yes, I should find time to extend this tutorial) Bye, Kero. +--- Kero ------------------------------ kero@chello.nl ---+ | Don't split your mentality without thinking twice | | Proud like a God -- Guano Apes | +--- M38c ------- http://members.chello.nl/~k.vangelder ---+