Ala Qumsieh <ala_qumsieh@xxxxxxxxx> writes:
> I'm able to reproduce a core dump when using HList.
> Admittedly, it was a typo from my side that caused it,
> and there is no reason for anyone to do what I'm doing
> :)
>
> It would be nice though to spew forth a warning
> message, and avoid the core dump. It is triggered when
> a widget is inserted more than once into the HList.
>
> use strict;
> use Tk;
> use Tk::HList;
>
> my $m = new MainWindow;
> my $h = $m->HList->pack(qw/-fill both -expand 1/);
> my $b = $h->Button(-text => 'button');
> $h->add('a',
> -itemtype => 'window',
> -widget => $b,
> );
> $h->add('b',
> -itemtype => 'window',
> -widget => $b,
> );
>
> MainLoop;
> __END__
>
> This core dumps in Tk800 and Tk804. It's probably a
> Tk-related issue, and not pTk's.
>
I also think so. The Text widget is facing the same problem --- the
same widget may be used twice with windowCreate --- but it is solved
there. The solution seems to be in pTk/tkTextWind.c in the
EmbWinConfigure function. If the widget was already put into the Text
widget, then some cleanup is done first which effectively deletes the
widget from the Text widget (calls to Tcl_DeleteHashEntry,
Tk_DeleteEventHandler, Tk_ManageGeometry, Tk_UnmapWindow etc., see
from line 342 in tkTextWind.c as it comes with the Tk804.027
distribution), and then the widget is again put into the Text widget.
So only the last windowCreate call wins. Something similar should be
coded for the Tix based widgets.
Regards,
Slaven
--
Slaven Rezic - slaven@xxxxxxxx
tktimex - project time manager
http://sourceforge.net/projects/ptktools/
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx
|