Re: Scrolling a window

[email protected] (Jeff Hobbs)
Newsgroups perl.tcltk
Message-ID <[email protected]>
On 02/03/2010 3:05 PM, Swingle David-QWHM86 wrote:
>> Yes, that indicates you are using an 8.4-based Tk.
>> We now ship with an 8.5-based Tk, where the 'tile' extension was added
>> to the core.
>> This added the native themed widgets, as well as combobox, notebook,
>> sizegrip and a few other new widgets.
>
> I have new_ttk__combobox in my script, so does that mean I have more
> than 8.4?  How do I get the version?  Perl -v or Perl -V doesn't show
> the Tk version.

You must have the 'tile' package in use.  We provide the tkkit version 
details in the 'tkkit'

> Something I just discovered that might help others.  After going thru
> the great tutorial at www.tkdocs.com/tutorial, I've been using g_grid()
> instead of g_pack().  But, when I did this for my script, the scroll
> bars didn't resize past the size that the window started at.  In other
> words, if I stretched the window, the scroll bars were left behind.
> After comparing your script with what I have in mine, I realized that
> you use g_pack when creating the new_ScrolledWindow ($sw in your
> example).  If I change your script example to have $sw->g_grid(-column
> =>  0, -row =>  0, -sticky =>  "nsew") instead of $sw->g_pack(....), it
> doesn't work correctly.  Is there a way to use g_grid throughout?

Yes, and I would recommend g_grid.  You have to use grid 
column/rowconfigure to get the fine-grained weighting (stretching) 
control, e.g.:

Tkx::grid(rowconfigure => $mw, 1, -weight => 1);
Tkx::grid(columnconfigure => $mw, 0, -weight => 1);

Will stretch all items in row 1 vertically, and all items in col 0 
horizontally.

Jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.