|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
DLL hourglass in ctypesHello,
I am reporting back after some experimenting with building a DLL based on the SDL library. I have successfully created a very simple DLL that accepts 5 int values (color, x,y,w,h) and uses the SDL_RectFill function to draw directly to the screen. Then I use ctypes to import the DLL into pythonCE and access its functions from there. This may seem very basic, but it allows me to draw a rectangle of any size or colour to the screen, and I can do it using very straightforward python script. The DLL lives in the main Windows folder, and is automatically recognised by pythonCE when it starts.
My question is about the hourglass which appears on the screen while my script is running (in WM5 it's actually not an hourglass, but a kind of circular dial with windows colours). Is there any way I can prevent this from appearing while my python script runs?
My next plan was to try to use ppygui to make some buttons for user input.
Any thoughts or comments are very welcome.
Adam
_______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
|
|
Re: DLL hourglass in ctypesAdam Walley wrote:
> > > My question is about the hourglass which appears on the screen while > my script is running (in WM5 it's actually not an hourglass, but a > kind of circular dial with windows colours). Is there any way I can > prevent this from appearing while my python script runs? I do not recall exactly, but I vaguely remember something about this. Do you have a windows message loop running? I think the hour glass stays there until you start processing windows messages. -- Brad Clements, bkc@... (315)268-1000 http://www.murkworks.com AOL-IM: BKClements _______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
|
|
|
|
|
Re: DLL hourglass in ctypesChristopher Fairbairn wrote:
> > They use code along the lines of: > > import _pcceshell_support > _pcceshell_support.Busy(0); > > I haven't liked this, since it means each library needs to be aware of something > PythonCE specific. For cleaness I think the native C part of the Python > interpreter can (and should) take care of this. > I think according to the Windows CE compatibility guide, you're supposed to show the hourglass until your application is "ready for user input". I believe it's up to the application .py file, not any libraries or interpreter, to make the Busy(0) call. Only the application author knows how many modules need to be loaded and when the application really has "started". -- Brad Clements, bkc@... (315)268-1000 http://www.murkworks.com AOL-IM: BKClements _______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
|
|
Re: DLL hourglass in ctypesBrad Clements wrote:
<snip> > I think according to the Windows CE compatibility guide, you're supposed > to show the hourglass until your application is "ready for user input". > > I believe it's up to the application .py file, not any libraries or > interpreter, to make the Busy(0) call. > > Only the application author knows how many modules need to be loaded and > when the application really has "started". I'll admit to being completely out of my league when it comes to how windows CE development should be done, however, I do like the idea of being able to leave the hourglas running until I'm "ready for input". I'm in the midst of creating a scanning application that will be loading quite a few modules, and it would be nice to have the visual clue that the user needs to wait. Additionally, it would be nice to be able to turn on the hourglass when entering a method that may take a while to complete. (I'm sure there is probably an easy way to do this, I'm just not familiar with it yet.) -John _______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
|
|
Re: DLL hourglass in ctypesWell, my initial question certainly seems to have stirred some interest. Thanks to everyone for the input. I think what I can draw from all this is that:
1. The hourglass/busy icon is useful to give users an indication of when the application is busy 'grinding' away at something and user input is not expected/possible at that time - as in the application John described in a previous post. 2. The hourglass/busy icon is NOT helpful when the application is doing some processing that involves some visual effects, since the hourglass/busy icon then interferes and obscures the display. This is a nuisance, when the application is trying to display something on screen (whether it requires user input or not). I would say most pygame applications fall into this category (and the idea of pygame for PythonCE is what prompted this post in the first place). My conclusion would be that while there is no harm in having this icon appear by default, it cannot be left to the system to decide when the icon should appear. Therefore, a method of 'disabling' the icon, at least for the duration of the execution of a script, would be useful. Jared kindly pointed out that the ppygui package already has this covered, so at least in the first instance I will see whether I can combine what I have built so far with ppygui to see if I can achieve a satisfactory result. Thanks again to all. Adam 2008/8/13 Brad Clements <bkc@...>
_______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
|
|
Re: DLL hourglass in ctypesJust one more note on this. Having tinkered a little with ppygui, I decided that although it is a very fine package, it would not really help with what I am aiming for - mainly because it is event based, whereas pygame apps would tend to need 'real-time' interaction, rather than waiting for the user to press something. If someone knows where/how I would put a main loop into a ppygui app then let me know.
I did find that adding the lines: import _pcceshell_support _pcceshell_support.Busy(0) worked like a dream! No more hourglass/busy indicator/color wheel or whatever it's called (not knowing makes it harder to google). So thanks to Christopher for that tip. Adam.
2008/8/13 Adam Walley <adam.walley@...>
_______________________________________________ PythonCE mailing list PythonCE@... http://mail.python.org/mailman/listinfo/pythonce |
| Free embeddable forum powered by Nabble | Forum Help |