Hi,

Thanks for the idea and i finally solved the problem.

The secret was the method transient as shown below.
With it, there is no task bar icon. Without it, another
task bar icon pops up.

Thanks!

Dan



use Tk;
$mw = MainWindow->new;
$mw->title("MainWindow");
$mw->Button(-text => "Toplevel", -command => \&do_Toplevel)->pack( );

MainLoop;

sub do_Toplevel {
    if (! Exists($tl)) {
        $tl = $mw->Toplevel( );
            $tl->transient($tl->Parent->toplevel);
        $tl->title("Toplevel");
        $tl->Button(-text => "Close", -command => sub { $tl->destroy; undef
$tl})->pack;
    } else {
        $tl->deiconify( );
        $tl->raise( );
    }
}

On Tue, Sep 1, 2009 at 7:16 PM, Brian Raven <bra...@nyx.com> wrote:

> From: perl-win32-users-boun...@listserv.activestate.com
> [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
> Daniel Burgaud
> Sent: 01 September 2009 11:08
> To: Perl-Win32-Users
> Subject: need help: TK windows - no task bar icon pls
>
> > Hi
> >
> > I have a perl script with a main TK:
> >
> > my $MW = MainWindow->new();
> >
> >
> > Within, I have routines that requires a popup.
> >
> > sub POPUP {
> > my $popup = $MW->TopLevel();
> > .
> > .
> > .
> >   while(1) {
> >     usleep 5000;
> >     $popup->focus;
> >   .
> >   .
> >   .
> >  }
> > }
> >
> > I do not like to use dialog or dialogbox because i need a popup that
> > performs complex task, dialog or dialogbox is not up to task.
> >
> > My problem is, this popup creates "another" task bar icon separate
> from
> > the mainwindow. how do I make it not create another task bar icon?
> > Dialog/DialogBox does not have this taskbar icon...
>
> As DialogBox derives directly from TopLevel, I expect that the answer
> lies somewhere in DialogBox.pm, probably in its Populate and Show
> methods. My first guess would be that it is something to do with the
> calls to transient, withdraw and Popup, although I can see no
> documentation for Popup in TopLevel or its obvious base classes.
>
> Unless somebody comes up with a better answer, try copying DialogBox.pm,
> make mods to it and see what happens. If you discover the answer from
> that, don't forget to let us know what it is.
>
> HTH
>
> --
> Brian Raven
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient or have received this e-mail in error, please
> advise the sender immediately by reply e-mail and delete this message and
> any attachments without retaining a copy.
>
> Any unauthorised copying, disclosure or distribution of the material in
> this e-mail is strictly forbidden.
>
> _______________________________________________
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to