Re: clist column autosizing issues



On Wed, 2002-03-13 at 10:55, Chas Owens wrote:
On Wed, 2002-03-13 at 04:15, Pavel Rousnak wrote:
When I issue a $clist->columns_autosize; the columns of $clist are sized
to appropriate sizes for the content, but not the titles.  For example:
<snip />

I've written a test from your example (attached). Everything works fine.
Columns are resized as expected.
Could you send a complete test reflecting that strange behavior?
<snip /> 
Best regards
Pavel.

Well, I don't know what to say.  I ran the tcl1.pl on my machine and it
produced the following results (very similar to yours):
<snip /> 
But my real code still doesn't work.  The only difference I can think of
is that the Gtk::CList is not visible (it is on an unseen tab) when I
issue the columns_autosize for the list.  I am going to focus on the new
tab and see if that fixes the problem.  Here is the relevant function. 
Unfortunately you need an Informix DB to run the script (it is an SQL
editor ala Informix SQL Editor).  If any one has postgresql installed
and wants to take a stab at the problem I can hack together a reduced
functionality version that connects to it instead.

<snip /> 
-- 
Today is Boomtime the 72nd day of Chaos in the YOLD 3168
Kallisti!

Missile Address: 33:48:3.521N  84:23:34.786W

Well, It works now.  I changed the loop that fills the list.  It used to
look like this:

while (my $ref = $sth->fetch) {
        no warnings;
        $list->append(@$ref);
        use warnings;
}

Now it looks like this

while (my $ref = $sth->fetch) {
        $list->freeze;
        no warnings;
        $list->append(@$ref);
        use warnings;
        $list->thaw;
        Gtk->main_iteration while (Gtk->events_pending);
}

The freeze and thaw don't help, but letting the Gtk main loop process
stuff while I am loading the loop has two great features:  one
columns_autosize now works and two my application no longer freezes when
I run an sql command (And I wasted all that time trying to get
multi-threading to work, sigh).

-- 
Today is Boomtime the 72nd day of Chaos in the YOLD 3168
Kallisti!

Missile Address: 33:48:3.521N  84:23:34.786W




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]