Bring window to top in Tk

L

Larry

I have a Perl/Tk program which does a long process and I want to be
able to do other things while it's working. Is there any way to make
my program put its window on top of all other applications when it's
done?
 
R

robic0

I have a Perl/Tk program which does a long process and I want to be
able to do other things while it's working. Is there any way to make
my program put its window on top of all other applications when it's
done?

Now why would you want to do that?
If I had to use this program and I were running another window
that had the focus and in the middle of typing or clicking a stupid
windows took the focus from me, I would never run this stupid thing
again. Especially bogus Perl window crap! Problem is some people
think their running program is more important than what the user
might be doing somewhere else. Don't ask this question with the
assertion that this is somehow OK for everybody to do. There's
gui guidelines on Microsofts website, for the people such as you
who are neophyte's to user friendlyness, and in my opinion, just
plain intrusive on multi-tasking os's.

Look for a beep or taskbar flash method somewhere.
 
L

Larry

robic0 said:
There's
gui guidelines on Microsofts website, for the people such as you
who are neophyte's to user friendlyness, and in my opinion, just
plain intrusive on multi-tasking os's.

Look for a beep or taskbar flash method somewhere.

OK, I would be fine with taskbar flash... just something to get the
user's attention so they don't have to keep checking the application.
Anybody have an idea on that?
 
L

Larry

Larry said:
I have a Perl/Tk program which does a long process and I want to be
able to do other things while it's working. Is there any way to make
my program put its window on top of all other applications when it's
done?

In browsing CPAN, I found Tk::WM which seemed promising at first, but
doesn't seem to have a method for bringing a window to the top of all
applications. Am I missing something there?
 
L

Larry

robic0 said:
Now why would you want to do that?
If I had to use this program and I were running another window
that had the focus and in the middle of typing or clicking a stupid
windows took the focus from me, I would never run this stupid thing
again. Especially bogus Perl window crap! Problem is some people
think their running program is more important than what the user
might be doing somewhere else. Don't ask this question with the
assertion that this is somehow OK for everybody to do. There's
gui guidelines on Microsofts website, for the people such as you
who are neophyte's to user friendlyness, and in my opinion, just
plain intrusive on multi-tasking os's.

Look for a beep or taskbar flash method somewhere.

I agree with your premise that programs should behave and play nicely
with others but the overall consideration is what is best for the user.
If the program has no way to tell the user it's done, the user has to
keep checking it periodically... not a very efficient use of the user's
time. A taskbar flash or a way to pop up a little window in the lower
right corner would be ideal, but I don't know if Tk can do those things
(at least not without a lot of work). A beep is not ideal, especially
if people are sitting near to others.
 
L

Larry

Actually, on thinking about it further, what I really want to do is
allow the user to minimize the window while it's working, then when
it's done "restore" the window. How can I do that?
 
A

A. Sinan Unur

I am not sure you really want to keep talking to yourself online.
Actually, on thinking about it further, what I really want to do is
allow the user to minimize the window while it's working, then when
it's done "restore" the window. How can I do that?

Why isn't it acceptable for the user to come back and check when he/she
feels like checking? Why do you feel like *you* have the right to
interrupt something else the user might have been doing while your
program did its thing?

Anyway, see <URL:http://search.cpan.org/~ni-s/Tk-804.027/pod/Wm.pod>

Sinan
 
L

Larry

A. Sinan Unur said:
Why isn't it acceptable for the user to come back and check when he/she
feels like checking? Why do you feel like *you* have the right to
interrupt something else the user might have been doing while your
program did its thing?

I guess you would have to ask the user. It depends on the application.
I can definitely think of applications where I would want it to
immediately notify me and not wait till I got around to checking.
 
L

Larry

Larry said:
Actually, on thinking about it further, what I really want to do is
allow the user to minimize the window while it's working, then when
it's done "restore" the window. How can I do that?

I found it!

$MW->deiconify;

So the way it will work is the use will minimize the window and when
the process is done, it will "deiconify" (in the Windows world, that
would be "restore" the window).

Thanks everyone that helped... interesting side discussion, too, about
UI design.
 
A

Ala Qumsieh

Larry said:
want. I don't want my window to *stay* on top ... I want it to jump to
the top only when it's done.

Then a simple:

$MainWindow->raise;

should do it.

--Ala
 
J

John

Sinan wrote:

"Why isn't it acceptable for the user to come back and check when
he/she
feels like checking? Why do you feel like *you* have the right to
interrupt something else the user might have been doing while your
program did its thing?"

Why? Well, I'm willing to entertain the possibility that Larry --
unlike the rest of us -- has made actual eye contact with the user, and
knows firsthand what makes the user' s job easier or harder.
 
L

Larry

John said:
Sinan wrote:

"Why isn't it acceptable for the user to come back and check when
he/she
feels like checking? Why do you feel like *you* have the right to
interrupt something else the user might have been doing while your
program did its thing?"

Why? Well, I'm willing to entertain the possibility that Larry --
unlike the rest of us -- has made actual eye contact with the user, and
knows firsthand what makes the user' s job easier or harder.

Yes, you're absolutely right! I have purposely not gone into the
details of what the app does (because it's not relevant to my question)
but trust me, the app would be far less usable if it couldn't grab the
user's attention when the user is doing something else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top