From: Len Lawrence Date: 2006-11-25T04:51:58+09:00 Subject: Re: Only one root window in RubyTk On Thu, 23 Nov 2006 09:41:27 +0900, Morton Goldberg wrote: > On Nov 22, 2006, at 5:50 PM, Len Lawrence wrote: > >> I have just started using ruby after 15 years with Tcl/Tk/C/C++ >> and have encountered a problem trying to create a second >> toplevel window. This was trivial in tcl. In ruby the second >> window has the same object reference as the first, so everything >> gets packed together. >> >> Is this a bug or a feature of the ruby Tk implementation? >> > > AFAIK, you can't have two root windows in Ruby/Tk. However, you can > put up two windows by creating a toplevel window as the second window. > > > #! /usr/bin/env ruby -w > > require "tk" > > root = TkRoot.new { title "ttlog : version 2.2" } > p root > second = TkToplevel.new(root) { title "Todays news" } > p second > > Tk.mainloop > > > > # > # @path=".w00000", @db_class=TkToplevel> > > > Hope this helps. > > Regards, Morton Thanks Morton; just what I was looking for. In Tcl you use toplevel to create what I call a "root" window. The Pickaxe does not go into much detail - perlTk book in the post. Thanks again, and apologies for the elementary question. Len