Home > Archive > PerlTk > December 2004 > Windows amenities
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Vorxion 2004-12-08, 8:58 pm |
| I've found an example online that shows how to handle Systray behaviour in
Windows, so that's not too much of a problem.
What I -do- need to know is how to make a Tk app disappear from the Alt-Tab
task list while minimised to the systray.
Any help would be appreciated. Actually, any code that demonstrates all of
the above would be , but I should be able to make do. :)
--
Vorxion - Founder of the knocking-shop of the mind.
"You have it, you sell it, you've still got it--what's the difference?"
--Diana Trent, "Waiting for God", on why a modelling agency is really a
knocking-shop. Applied by me to the field of consulting. :)
The Sci-Fi fan's solution to debt: Reverse the polarity on your charge card.
| |
|
| Vorxion wrote:
> I've found an example online that shows how to handle Systray behaviour in
> Windows, so that's not too much of a problem.
>
> What I -do- need to know is how to make a Tk app disappear from the Alt-Tab
> task list while minimised to the systray.
>
> Any help would be appreciated. Actually, any code that demonstrates all of
> the above would be , but I should be able to make do. :)
>
Where did you find the online example for the systray behavior? I have
been looking for something like that for a few w s.
| |
| Vorxion 2004-12-09, 8:57 am |
| In article <v6idnYL4mJB5dircRVn-rQ@comcast.com>, ryan wrote:
>Vorxion wrote:
>Where did you find the online example for the systray behavior? I have
>been looking for something like that for a few w s.
This originally came -off- of USENET. I found it via Google, but don't
have the energy to repeat the search at the moment, so I'll post the lynx
text rendering of what was there that I saved for my reference. Hope it
helps you like it'll help me!
**********
Does this Perl Tk feature exist?
Comp Lang Perl Tk
Computer Languages
Does this Perl Tk feature exist? - Comp Lang Perl Tk - James
2003-07-28 02:52:25.0
This may be a dumb question, but I don't think it is; so please bear with
me.
A tiny bit of background...
I've been working in Perl for a few years now; however I am just starting to
program in Perl Tk. I'm tying to port some of my command line .pl scripts
to Tk in an effort make them more user friendly. I plan on compiling some
of them with Perl2Exe so they become standalone apps.
While porting/upgrading some of my more powerful, feature rich scripts
(which tend to sit active on the user's desktop for long time periods or run
fairly often via the Windows Task Scheduler), I realized there was one
special feature I would really like to add, however I have been unable to
find any specific Tk command or module that can do it.
My question is...
I would like to offer a feature to minimize the Tk interface to only a
taskbar icon (next to the clock). When the user is then ready, they can
restore the app by clicking on the icon in the tray... I've seen this done
in many apps (such as WinAmp, Kazaa & ZoneAlarm). Can this be done in Perl
Tk? If so, how? Is there a URL where I can get more info? Are there any
working examples? Any information would be helpful.
Thanks in advance.
--
James
turajb@hoflink.com
Re: Does this Perl Tk feature exist? - Comp Lang Perl Tk - Marc
Dashevsky
2003-07-28 03:18:48.0
turajb@hoflink.com says in article
<Jd0Va.206609$ye5.33762597@news4.srv.hcvlny.cv.net>:
> I would like to offer a feature to minimize the Tk interface to only a
> taskbar icon (next to the clock). When the user is then ready, they can
> restore the app by clicking on the icon in the tray.
I'm certain there's no way to do it in perl/Tk since the system tray
is strictly a Windows concept. Perhaps you'll find this capability
somewhere in the Win32 module or in another module at CPAN.
--
Marc Dashevsky -- Remove '_' from address if replying by e-mail.
Re: Does this Perl Tk feature exist? - Comp Lang Perl Tk - Didier
Ladner
2003-07-28 14:50:36.0
In article <Jd0Va.206609$ye5.33762597@news4.srv.hcvlny.cv.net>,
turajb@hoflink.com says...
The environment generated with Win32::GUI can be integrated inside
Perl/Tk.
With Win32::GUI you can access specifics Win32 functions.
The systray is one of them.
The function name is defined as "Win32::GUI::NotifyIcon".
You will need to be carefull about the order of your sub...
Here a sample script to let's you see, just choose a nice win32 ico and
name it god.ico in the same dir from where you will launch this script:
#---------------
BEGIN{
use Win32::Console;
Win32::Console::Free();
}
use Win32::GUI;
use Tk;
$mw = MainWindow -> new;
$mw -> wm('geometry', '0x0+0+0');
$mw->overrideredirect(1);
&do_win32_stuff;
MainLoop;
#--------------------------------
sub do_win32_stuff{
$mw_win32 = new Win32::GUI::DialogBox(
-width => 0,
-height => 0,
-name => 'MainWindow');
$icon = new Win32::GUI::Icon('god.ico');
new Win32::GUI::NotifyIcon(
$mw_win32,
-name => "Notify",
-id => 1,
-icon => $icon,
-tip => "I'am in the Systray!");
$call = Win32::GUI::Dialog();
$mw_win32->Notify->Delete(-id => 1);
sub Notify_Click{
&my_menu;
}
}
#--------------------------------
sub my_menu{
$popup = $mw->Menu(Name => 'popupMenu', -tearoff => 0);
$popup->command(-label => 'Number 1',-command => [\&do_label,1] );
$popup->command(-label => 'Number 2',-command => [\&do_label,2]);
$popup->separator;
$popup->command(-label => 'Number 3', -command => [\&do_label,3]);
$popup->command(-label => 'Number 4', -command => [\&do_label,4]);
$popup->command(-label => 'Number 5', -command => [\&do_label,5]);
$popup->separator;
$popup->command(-label => 'Quit', -command => [ \&stop]);
$popup->Popup(-popover => 'cursor', -popanchor => 'nw');
}
#--------------------------------
sub stop{
exit;
}
#--------------------------------
sub do_label{
if(Exists($top)){
$label-> configure(-text => "I'am $_[0]");
} else {
$top = $mw ->Toplevel;
$top->title(" Numbers");
$top->focus;
$label = $top->Label (-text => "I'am $_[0]",
-relief => 'groove',
-width => '24')->pack;
}
}
#-------------------------
> This may be a dumb question, but I don't think it is; so please bear with
> [..] My question is...
> I would like to offer a feature to minimize the Tk interface to only a
> taskbar icon (next to the clock). When the user is then ready, they can
> restore the app by clicking on the icon in the tray... I've seen this done
> in many apps (such as WinAmp, Kazaa & ZoneAlarm). Can this be done in Perl
> Tk? If so, how? Is there a URL where I can get more info? Are there any
> working examples? Any information would be helpful.
>
> Thanks in advance.
> --
> James
> turajb@hoflink.com
Re: Does this Perl Tk feature exist? - Comp Lang Perl Tk - Didier
Ladner
2003-07-28 17:41:18.0
In article <MPG.198f48979cf9f338989689@192.168.0.7>, didier@perltk.org
says...
And should be better if you place the win32 delete tag inside the stop
sub:
sub stop{
$mw_win32->Notify->Delete(-id => 1);
exit;
}
Re: Does this Perl Tk feature exist? - Comp Lang Perl Tk - James
2003-07-29 00:49:24.0
Didier,
Thanks for the sample code and for the brief explanation. In reviewing the
win32::gui module, it appears to have some things which will come in handy.
Also thanks for the sample code. It will give me the jump start I needed to
play with this module/feature & Tk widgets to figure out how to best
approach this whole design situation.
--
James
turajb@hoflink.com
"Didier Ladner" <didier@perltk.org> wrote in message
news:MPG.198f7094fdfef0be98968b@192.168.0.7...
> In article <MPG.198f48979cf9f338989689@192.168.0.7>, didier@perltk.org
> says...
>
> And should be better if you place the win32 delete tag inside the stop
> sub:
>
> sub stop{
> $mw_win32->Notify->Delete(-id => 1);
> exit;
> }
--
Vorxion - Founder of the knocking-shop of the mind.
"You have it, you sell it, you've still got it--what's the difference?"
--Diana Trent, "Waiting for God", on why a modelling agency is really a
knocking-shop. Applied by me to the field of consulting. :)
The Sci-Fi fan's solution to debt: Reverse the polarity on your charge card.
|
|
|
|
|