logo       

Re: HList causing core dumps: msg#00017

Subject: Re: HList causing core dumps
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



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe