From: Alex T. <al...@tw...> - 2006-06-17 09:19:28
|
Ashley Etchell wrote: >Hi all > >ive finally built my first little app, a MySQL process watcher, it works >quite will and displays in a way similar to linux 'top'. > > > Ashley, your app uses curses rather than a GUI - and this list is mostly populated by people writing GUI apps, particularly in PythonCard. I suspect most of the people on here will, like me, have no experience of curses, so we probably won't be able to be much help. You'd probably be better on a more general Python list rather than here, but I'm not honestly sure which one. >I have compiled the code into an exe using py2exe so i can distribute it >amongst colleagues > >only problem is, the app cursor is constantly in the waiting state (egg >timer under winXP), which doesnt bother me, but if i change focus to another >window, or try to move my app window, the process watcher app stops >responding and generates a windows error. > >so, how can i avoid the app from crashing, is this thread related in some >way? or simply n00b coding. I have included a copy of the python code that >was compiled below. > >there are other minor things too, like how do i hide the cursor in the app, >it currently gets moved to 0,0 on each refresh. > > > That's one question I might be able to answer :-) There are 2 cursors - the system cursor (usually controlled by mouse movement) and the text cursor within the app. The text cursor is moved to 0,0 because you have the call scr.move(0,0) immediately before the scr.refresh() I doubt if you can hide the system (graphics) cursor in a curses app - typically, only GUI apps are able to control it. Your app is always either busy, or in the time.sleep() call - and in both cases the "busy" cursor is the correct one. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.0/368 - Release Date: 16/06/2006 |