473,378 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Command Line drive Tk window

I have been working to build a media toolkit that uses pygame to modify
image and sound data for the user. I have all of this working fine.
The one thing I am working on now is adding a pop-up view for the image
data as well as some pop-ups for file selection and color picking. I
am having problems with the first part of this which I think will carry
through to the file/color pickers but all of that is secondary anyway
so not too big a deal.

Basically the module is set up so after importing it must be
initialized. This initializes a bunch of pygame stuff and also starts
a thread to watch for user events on its windows. I just create a Pk
instance and withdraw it (this is ok because this thread is run as
daemon so the program won't be stalled from exiting by a window they
can't see to close). Then when the user wants to view one of their
images in a window they call a function in the object which converts
the image to a PIL image and imports it to a Toplevel Pk window. The
problem is that this window does not become visible. I did some
investigation and found that if I did not withdraw my root window I
could get the Toplevel to show by clicking the root window. What I
think what is actually going on here is that the Tk mainloop is only
looking for user events generated by the gui itself so when I try to do
something from the comand line the mainloop is not looking for the
event.

Does anyone know of a way I can overcome this problem. I have tried
creating a second loop that just keeps hitting the main window by
calling update, this does not work the update stalls until I click with
window just like creation of the toplevel window. Finally I have also
tried cyclicly adding an after_idle call to the window so it will keep
calling some function when it goes to idle figuing I could keep the
main loop alive perhaps in this way. This prevented the main window
from apearing at all and so this is not a good option.

Any thought would be apreciated,
Andrew

Dec 3 '05 #1
0 867

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eric Ching | last post by:
Can I run pythonw with a script that takes command line arguments then launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and nothing happens. Nothing, as in I am immediately returned...
0
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the...
12
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the...
10
by: Steve | last post by:
Is there anyone with experience using the Winzip command line add-in? I can't get it to create the zip file with a space in the file name. Using: RetValue = Shell("C:\winzip\wzzip.exe...
3
by: Tuang | last post by:
I'd like to create my own mini "IDE" for working with several programming languages that provide interactive "toplevel" command line interpreters, such as Python, Ruby, Lisp, Scheme, OCaml, etc....
2
by: msuk | last post by:
All, I am trying to use Regasm from the command prompt and have to keep putting the full file path of where my assembley is located. Does anyone know how to set it up so wherever I run the...
6
by: Lucas Cowald | last post by:
Hi, I need to RUN/execute a Command-Line command from an ASP page. This is the command: sse45.exe -i k:\o\2.wmv -o k:\o\2.shh -w 128 -df 0 -m 2 -p Can you show me a code how to run this...
2
by: Enrique Bustamante | last post by:
Casting arrays that works on watch and command window but not in code. My application is casting arrays in a way it should work. To test if I was doing something invalid, I wrote a test code that...
4
by: RLN | last post by:
Re: Access 2003/WinXP Pro-SP3 I have a shell command that does not run correctly. I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb Pgm1 launches Pgm2 via a command button...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.