From alexandre.delattre at enst-bretagne.fr Thu Feb 1 15:26:01 2007 From: alexandre.delattre at enst-bretagne.fr (alexandre.delattre at enst-bretagne.fr) Date: Thu, 1 Feb 2007 15:26:01 +0100 Subject: [PythonCE] VensterCE release In-Reply-To: <7A93FCDF-D431-4A8D-B673-DED85592A5B5@ablelinktech.com> References: <20070130165510.n9dxmi1vs4kcc8sw@webmail.enst-bretagne.fr> <7A93FCDF-D431-4A8D-B673-DED85592A5B5@ablelinktech.com> Message-ID: <20070201152601.z06ycwp6804o844g@webmail.enst-bretagne.fr> A fresher version of vensterce is up on sourceforge (http://sourceforge.net/projects/vensterce/). Various glitches have been fixed and sip handling is enhanced. A control EditBox is implemented in venster.lib.edit and gives a text control with classic undo/copy/paste context menu. The IDE is updated (and "englishised") and shows an example of integrating HTML control in your apps. Enjoy ;-) From sergeych at tancher.com Fri Feb 2 16:09:24 2007 From: sergeych at tancher.com (Sergey Chernov) Date: Fri, 2 Feb 2007 18:09:24 +0300 Subject: [PythonCE] using it Message-ID: <004d01c746dc$1fcfa5c0$1664a8c0@Sergeychn> I'm new there and didn't got too ,uch yet about subj. Still I'm very impressed with the ce port (2.5). The question is, is there yet a way to have any UI to use with the script? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070202/8e2d0272/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3084 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070202/8e2d0272/attachment.bin From xrubenx.es at gmail.com Tue Feb 6 12:51:10 2007 From: xrubenx.es at gmail.com (Ruben) Date: Tue, 6 Feb 2007 11:51:10 +0000 Subject: [PythonCE] Bluetooth In-Reply-To: <6.1.2.0.0.20070129165616.044682b0@pop3.infinito.it> References: <6.1.2.0.0.20070129165616.044682b0@pop3.infinito.it> Message-ID: <200702061151.10415.xrubenx.es@gmail.com> Hello, I have extracted the libraries and files that I think contain the core of the Bluetooth stack for Windows CE. Now I will get the Python.h from the source code of PythonCE in order to compile the libraries (after pass them through SWIG) and get Python loadable modules with the Bluetooth functions. I am doing everything by myself following the documentation that I can find on the Net. If there is anybody who did something like this [1] before and could help me a bit, would be very appreciated, because I am a GNU/Linux user and I don't feel very sure on Windows. [1] Use SWIG and compile files for PocketPC in order to use them from Python. Thanks in advance, Ruben. From sergeych at tancher.com Tue Feb 6 13:11:28 2007 From: sergeych at tancher.com (Sergey Chernov) Date: Tue, 6 Feb 2007 15:11:28 +0300 Subject: [PythonCE] UI? Message-ID: <027b01c749e7$ee32d410$1664a8c0@Sergeychn> Does anybody use any GUI with pythonCE? I'd be happy to hear anything about it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070206/420ac87e/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3084 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070206/420ac87e/attachment.bin From bandung at skyesystems.com Tue Feb 6 14:28:55 2007 From: bandung at skyesystems.com (Bandung) Date: Tue, 6 Feb 2007 05:28:55 -0800 (PST) Subject: [PythonCE] UI? In-Reply-To: <027b01c749e7$ee32d410$1664a8c0@Sergeychn> References: <027b01c749e7$ee32d410$1664a8c0@Sergeychn> Message-ID: <8825921.post@talk.nabble.com> Start with Tkinter. It comes with Python2.5 You will have to install tcl in order to use it. Go to this thread and read it if you are having difficulties in getting your Tkinter/tcl installation working. The thread includes the latest copies of tcl for wince. Make sure that you include Celib as well as the other two dll's - tk8.4.dll and tcl8.4.dll in your windows directory. http://www.nabble.com/tk-tcl-tf2953745.html tcl Sergey Chernov-2 wrote: > > Does anybody use any GUI with pythonCE? I'd be happy to hear anything > about > it. > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > -- View this message in context: http://www.nabble.com/UI--tf3180316.html#a8825921 Sent from the Python - pythonce mailing list archive at Nabble.com. From pythonce-ml at lestat.st Wed Feb 7 18:20:21 2007 From: pythonce-ml at lestat.st (David Goncalves) Date: Wed, 07 Feb 2007 18:20:21 +0100 Subject: [PythonCE] wxWidgets for PythonCE 2.5 In-Reply-To: <8825921.post@talk.nabble.com> References: <027b01c749e7$ee32d410$1664a8c0@Sergeychn> <8825921.post@talk.nabble.com> Message-ID: <45CA0A55.3030408@lestat.st> Hi, Has someone compiled wxWidgets for the current 1.5 release of PythonCE ? I would like to try it on my pocket to compare it to Tkinter. Thanks. From xrubenx.es at gmail.com Tue Feb 13 17:30:13 2007 From: xrubenx.es at gmail.com (Ruben Miguelez Garcia) Date: Tue, 13 Feb 2007 16:30:13 +0000 Subject: [PythonCE] Bluetooth In-Reply-To: <200702061151.10415.xrubenx.es@gmail.com> References: <6.1.2.0.0.20070129165616.044682b0@pop3.infinito.it> <200702061151.10415.xrubenx.es@gmail.com> Message-ID: <200702131630.13514.xrubenx.es@gmail.com> > I have extracted the libraries and files that I think contain the core of > the Bluetooth stack for Windows CE. They are: winsock2.h ws2bth.h bthapi.h bthutil.h They can not contain absolutely everything, but the core for BT. I obtain this list joining all the files used by the BT library http://msdn2.microsoft.com/en-us/library/ms863414.aspx And the ones used by wmconsole http://www.xmailserver.org/wmconsole.html ----------- > [1] Use SWIG and compile files for PocketPC in order to use them from > Python. I tried to use SWIG and compile without success. No way to eliminate too many errors on SWIG parser output. Now I am thinking on compile them as a .dll and use it with ctypes. Any comment, hint, suggestion, help would be welcome. ------------ By the way, I could receive Bluetooth information on the PocketPC/PDA without use bluetooth. One BT device connect to the PDA using the Serial Port Profile, so the connection is mapped on a COM: port. Then using the module provided by Benjamin McBride -- ceserial.py --, you open the port and read. That's all. Here I'll let a small code, because on my way I found a lot of help just reading a few lines that got me out of where I was stuck. ---------- # Program to read and print the info received on COM6: # by Ruben }:o) import ceserial MAX=1024 try: port=ceserial.Serial(port='COM6:') port.open() while port.isOpen(): # Need to modify this, because the port can be opened but the BT connection closed. comming=port.inWaiting() take= comming * (comming >= MAX) or MAX * (MAX > comming) data=port.read(take) print data except KeyboardInterrupt: # If you press Ctrl+C port.close() print "Ending program..." except ceserial.SerialException: port.close() print "Problem with COM6. Closing and ending" -- Kind regards / Cumprimentos / Atentamente, Ruben. Come?ar j? ? metade de toda a??o. Prov?rbio grego From wendellp at operamail.com Thu Feb 15 18:36:01 2007 From: wendellp at operamail.com (Wendell P) Date: Thu, 15 Feb 2007 18:36:01 +0100 Subject: [PythonCE] Installing 2.5 on Jornada 720 Message-ID: <20070215173601.0F5C02474B@ws5-3.us4.outblaze.com> I've followed the directions posted here and elsewhere, but am unable to make it work. What am I missing? Python25 was installed by CAB. Also installed in \Windows directory: dummy aygshell.dll, dummy DocList.dll, gx.dll, and mfcce400.dll. Have also tried it with mfcce300.dll, with alternate versions of the other three, and with installing these four in the \python directory. The error message is "Cannot find 'python' (or one of its components). Machine: Jornada 720, 206MHz StrongARM SA-1110, WinCE 3.0 -- _______________________________________________ Surf the Web in a faster, safer and easier way: Download Opera 9 at http://www.opera.com Powered by Outblaze From xrubenx.es at gmail.com Fri Feb 16 19:50:26 2007 From: xrubenx.es at gmail.com (Ruben Miguelez Garcia) Date: Fri, 16 Feb 2007 18:50:26 +0000 Subject: [PythonCE] remote-console Message-ID: <200702161850.26251.xrubenx.es@gmail.com> Dear Thomas, > A much improved version is available here: > > http://ctypes-stuff.googlecode.com/svn/trunk/wince/remote-console/ > > The console.py script is thought to be run on the workstation. Editing > the client.py script (which is transferred automatically to the PDA) is no > longer needed. > > console.py accepts some command line options which can also be used for > Python itself: -m 'package', -c 'Python commands', other options are > accepted but don't do anything: -i, -u. Is this program only for Windows? (i.e. to be run on a Windows-Python ) I have Linux and it give me some errors [1]. It seems that the problem is just importing ctypes.wintypes which crash. I have tried to update ctypes many times but the error don't disappear. Does anyone have similar problem? Thanks for your time and your program. I'm still using the previous version. :o) ---------- $ python console.py serialsocket.py Traceback (most recent call last): File "console.py", line 4, in ? import rapi File "rapi.py", line 1, in ? import ctypes, ctypes.wintypes File "/usr/lib/python2.4/site-packages/ctypes-1.0.1-py2.4-linux-i686.egg/ctypes/wintypes.py", line 21, in ? class VARIANT_BOOL(_SimpleCData): ValueError: _type_ 'v' not supported -- Kind regards / Cumprimentos / Atentamente, Ruben. Quando um homem tem consciencia da sua valia, opera prodigios em todas as condicoes de vida -- D.Antonio Costa From theller at ctypes.org Fri Feb 16 21:10:35 2007 From: theller at ctypes.org (Thomas Heller) Date: Fri, 16 Feb 2007 21:10:35 +0100 Subject: [PythonCE] remote-console In-Reply-To: <200702161850.26251.xrubenx.es@gmail.com> References: <200702161850.26251.xrubenx.es@gmail.com> Message-ID: Ruben Miguelez Garcia schrieb: > Dear Thomas, > >> A much improved version is available here: >> >> http://ctypes-stuff.googlecode.com/svn/trunk/wince/remote-console/ >> >> The console.py script is thought to be run on the workstation. Editing >> the client.py script (which is transferred automatically to the PDA) is no >> longer needed. >> >> console.py accepts some command line options which can also be used for >> Python itself: -m 'package', -c 'Python commands', other options are >> accepted but don't do anything: -i, -u. > > Is this program only for Windows? (i.e. to be run on a Windows-Python ) > > I have Linux and it give me some errors [1]. It seems that the problem is > just importing ctypes.wintypes which crash. > > I have tried to update ctypes many times but the error don't disappear. > > Does anyone have similar problem? > > > Thanks for your time and your program. I'm still using the previous > version. :o) Ah, great. Yes, the current version only works on Windows, it requires that the device is connected via ActiveSync. The CeRemoteAPI is used to transfer the client script to the device, and start the interpreter there. Sorry for this limitation. Is there something on Linux that allows to transfer files and start processes on the PDA? Thomas From sergeych at tancher.com Sun Feb 18 09:52:08 2007 From: sergeych at tancher.com (Sergey Chernov) Date: Sun, 18 Feb 2007 11:52:08 +0300 Subject: [PythonCE] remote-console In-Reply-To: <200702161850.26251.xrubenx.es@gmail.com> Message-ID: <000001c7533a$12f7d970$7e00a8c0@Sergeychn> Very interesting. Is there any place where to find more about this tool and other ones? > -----Original Message----- > From: pythonce-bounces at python.org [mailto:pythonce-bounces at python.org] On > Behalf Of Ruben Miguelez Garcia > Sent: Friday, February 16, 2007 9:50 PM > To: pythonce at python.org > Subject: [PythonCE] remote-console > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3084 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070218/ea2fb83a/attachment.bin From a.g.booth at leeds.ac.uk Mon Feb 19 11:15:02 2007 From: a.g.booth at leeds.ac.uk (Andrew Booth) Date: Mon, 19 Feb 2007 10:15:02 -0000 Subject: [PythonCE] win32process.pyd Message-ID: <000f01c7540e$d1cb5eb0$6400a8c0@booth1> I have recently (finally) upgraded from 2.3.5 to 2.5. I previously had win32process.pyd in the Lib directory. However, when I put it in the Lib or the DLLs directory, I get: Import win32process ImportError: DLL load failed: The specified module could not be found. Am I putting it in the wrong place or do I need an updated file? Any help very much appreciated. Andrew Booth From xrubenx.es at gmail.com Mon Feb 19 20:43:39 2007 From: xrubenx.es at gmail.com (Ruben Miguelez Garcia) Date: Mon, 19 Feb 2007 19:43:39 +0000 Subject: [PythonCE] remote-console In-Reply-To: References: <200702161850.26251.xrubenx.es@gmail.com> Message-ID: <200702191943.39620.xrubenx.es@gmail.com> > Ah, great. Yes, the current version only works on Windows, it requires > that the device is connected via ActiveSync. The CeRemoteAPI is used to > transfer the client script to the device, and start the interpreter there. > Sorry for this limitation. > Is there something on Linux that allows to > transfer files and start processes on the PDA? I really don't know because I didn't have time to investigate it and my application is already finished, so I won't work more with the PDA for some time. But I think It should be possible. I just connected the usb cable from the cradle to my laptop and this is the output from the kernel: -------------------- # dmesg usb 2-1: new full speed USB device using uhci_hcd and address 2 drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic usbcore: registered new driver usbserial_generic usbcore: registered new driver usbserial drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0 drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC PDA drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5 ipaq 2-1:1.0: PocketPC PDA converter detected usb 2-1: PocketPC PDA converter now attached to ttyUSB0 usbcore: registered new driver ipaq --------------------- For some of you, maybe this is like Chinese. But in a few words it means that my Linux (Debian 2.16) knows what I have connected and is ready to use it. The problem is that I don't know how to do it. :o) ------------------------- And about the first version of you program, which works just fine for me, I have tried to modify it slightly to send or execute programs transferring the text, but without success... Maybe because my experience with Python is not big enough. I attach here my modifications. Maybe somebody want to help. :D Ruben. -------------- next part -------------- A non-text attachment was scrubbed... Name: server_pc_sendfile.py Type: application/x-python Size: 1390 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070219/4b179131/attachment.bin From xrubenx.es at gmail.com Mon Feb 19 21:18:06 2007 From: xrubenx.es at gmail.com (Ruben Miguelez Garcia) Date: Mon, 19 Feb 2007 20:18:06 +0000 Subject: [PythonCE] remote-console In-Reply-To: <000001c7533a$12f7d970$7e00a8c0@Sergeychn> References: <000001c7533a$12f7d970$7e00a8c0@Sergeychn> Message-ID: <200702192018.06168.xrubenx.es@gmail.com> Dear Sergey Chernov, > Very interesting. Is there any place where to find more about this tool and > other ones? On this list. But maybe, somebody could open a section on the Wiki and put there this kind of things. I only found the programs of Thomas Heller and the ceserial. But I think they are good enough to open a section and put there these programs. Kind regards / Cumprimentos / Atentamente, Ruben. From ricercar at infinito.it Tue Feb 20 12:54:18 2007 From: ricercar at infinito.it (ricercar at infinito.it) Date: Tue, 20 Feb 2007 12:54:18 +0100 Subject: [PythonCE] Bluetooth Message-ID: <6.1.2.0.0.20070220125201.02928440@localhost> Hi all, I sent this email by mistake directly to Ruben, my apologize to him and all. In the meantime Ruben answered other emails and I did some further steps, so thinks are clearer to me. I read with interest your posts about bluetooth. I also started looking into it, but started form another point: using ctypes to call directly the windows mobile dlls. Since I had not much time the first tries were unsuccessful, I will retry during the next weekend. But this process involve a lot of typing to convert classes and constants! I think also your idea of creating a dll could be interisting. Can you tell me which development tools are you using? I programmed in C++ for over ten years but now they are more or less four years that I work with other languages, so at the moment I have only the tools I need to build Python extensions. I don't know exactly what I need to build for the windows mobile. Regards, Enrico Bortolazzi From xrubenx.es at gmail.com Tue Feb 20 13:41:04 2007 From: xrubenx.es at gmail.com (Ruben M. G.) Date: Tue, 20 Feb 2007 12:41:04 +0000 Subject: [PythonCE] Bluetooth In-Reply-To: <6.1.2.0.0.20070220125201.02928440@localhost> References: <6.1.2.0.0.20070220125201.02928440@localhost> Message-ID: Dear Enrico Bortolazzi, > I read with interest your posts about bluetooth. I also started looking > into it, but started form another point: using ctypes to call directly the > windows mobile dlls. That was my last idea before start to use ceserial.py But I didn't feel with time enough to learn to use ctypes and the dll so I took another road (ceserial). > Since I had not much time the first tries were > unsuccessful, I will retry during the next weekend. But this process > involve a lot of typing to convert classes and constants! > I think also your idea of creating a dll could be interisting. Can you tell > me which development tools are you using? Of course. You have to install "eMbedded Visual C++ 4.0" and then "SDK for Windows Mobile 2003-based Pocket PCs". You need these two applications if you want to write an application on C++ for Windows Mobile. Or at least is what they say on the web :P http://www.microsoft.com/downloads/details.aspx?FamilyID=9996b314-0364-4623-9ede-0b5fbb133652&DisplayLang=en#Requirements http://msdn2.microsoft.com/en-us/embedded/aa714533.aspx You could try to compile as a dll what I called "the Bluetooth stack core for Windows CE" and then use it with ctypes. (I have no idea how to do it). Have fun amico!! -- Kind regards / Cumprimentos / Atentamente, Ruben. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070220/d0dea282/attachment.html From awong8888 at gmail.com Wed Feb 21 02:46:28 2007 From: awong8888 at gmail.com (adrian wong) Date: Tue, 20 Feb 2007 17:46:28 -0800 Subject: [PythonCE] serial port access Message-ID: Hello I would like to access my serial port on my pocket pc. Would someone sent me the ceserial.py codes and give me a few pointers on "how to" do a "Hello World " type python program to strart. I'm very new to python and very, very very new to pythonce. I tried this link "http://mail.python.org/pipermail/pythonce/attachments/20060922/5af92a01/attachment-0003.py ", but when I import ceserial, pythonce gave me a "SyntasError: invalid synax" Thanks in advance. Adrian awong8888 at gmail.comhttp://mail.python.org/pipermail/pythonce/attachments/20060922/5af92a01/attachment-0003.py ", but when I import ceserial, pythonce gave me a "SyntasError: invalid synax" Thanks in advance. Adrian awong8888 at gmail.com From awong8888 at gmail.com Wed Feb 21 08:42:20 2007 From: awong8888 at gmail.com (adrian) Date: Wed, 21 Feb 2007 07:42:20 +0000 (UTC) Subject: [PythonCE] serial port access References: Message-ID: adrian wong gmail.com> writes: > > Hello > > I would like to access my serial port on my pocket pc. Would someone > sent me the ceserial.py codes and give me a few pointers on "how to" > do a "Hello World " type python program to strart. I'm very new to > python and very, very very new to pythonce. I tried this link > "http://mail.python.org/pipermail/pythonce/attachments/20060922/5af92a01/attachment-0003.py > ", but when I import ceserial, pythonce gave me a "SyntasError: > invalid synax" > Thanks in advance. > Adrian > awong8888 gmail.comhttp://mail.python.org/pipermail/pythonce/attachments/20060922/5af92a01/attachment-0003.py > ", but when I import ceserial, pythonce gave me a "SyntasError: > invalid synax" > Thanks in advance. > Adrian > awong8888 gmail.com > when I click on the link in my own post, I downloaded the file instead of cut and pasted the text. And it is working, or at least I imported without any error. in case someone else want to do this, you also need windase.py a link http://mail.python.org/pipermail/pythonce/attachments/20060922/5af92a01/attachment-0002.py the code is from Benjamin McBride in a post earlier. Adrian From theller at ctypes.org Wed Feb 21 14:35:10 2007 From: theller at ctypes.org (Thomas Heller) Date: Wed, 21 Feb 2007 14:35:10 +0100 Subject: [PythonCE] remote-console In-Reply-To: <200702191943.39620.xrubenx.es@gmail.com> References: <200702161850.26251.xrubenx.es@gmail.com> <200702191943.39620.xrubenx.es@gmail.com> Message-ID: Ruben Miguelez Garcia schrieb: >> Ah, great. Yes, the current version only works on Windows, it requires >> that the device is connected via ActiveSync. The CeRemoteAPI is used to >> transfer the client script to the device, and start the interpreter there. >> Sorry for this limitation. > >> Is there something on Linux that allows to >> transfer files and start processes on the PDA? > > I really don't know because I didn't have time to investigate it and my > application is already finished, so I won't work more with the PDA for some > time. > > But I think It should be possible. I just connected the usb cable from the > cradle to my laptop and this is the output from the kernel: > > -------------------- > # dmesg > usb 2-1: new full speed USB device using uhci_hcd and address 2 > drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic > usbcore: registered new driver usbserial_generic > usbcore: registered new driver usbserial > drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0 > drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC > PDA > drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5 > ipaq 2-1:1.0: PocketPC PDA converter detected > usb 2-1: PocketPC PDA converter now attached to ttyUSB0 > usbcore: registered new driver ipaq > --------------------- > I found the synce project on sourceforge. This contains a rapi library that emulates the rapi.dll on Windows. I have adapted the remote console sources so that it also works on linux (tested on Ubuntu). I'm not a Linux expert, but here is (in short) what I did: - Installed the synce-serial, synce-dccm, libsynce0, librapi packages. - Cradled the CE device into the USB connector (I use a Dell X50 PDA, with Windows Mobile 2003) - Run these commands (some or all of them with sudo): modprobe ipaq synce-serial-config ttyUSB0 synce-serial-start Now the device connects to the PC, and I can run console.py. Note that there should be no need to adjust anything in the console.py or the client.py sources (at least if you use the default IP address that synce suggests: 192.168.131.102). console.py accepts some command line switches that the python interpreter also understands. Useful are probably "-c " and "-m ". Thomas From mail at jan-ischebeck.de Thu Feb 22 14:01:43 2007 From: mail at jan-ischebeck.de (Jan Ischebeck) Date: Thu, 22 Feb 2007 14:01:43 +0100 Subject: [PythonCE] VensterCE release - Bugfix and Feedback In-Reply-To: <20070201152601.z06ycwp6804o844g@webmail.enst-bretagne.fr> References: <20070130165510.n9dxmi1vs4kcc8sw@webmail.enst-bretagne.fr> <7A93FCDF-D431-4A8D-B673-DED85592A5B5@ablelinktech.com> <20070201152601.z06ycwp6804o844g@webmail.enst-bretagne.fr> Message-ID: <45DD9437.2090405@jan-ischebeck.de> Hello Alexandre, Today I downloaded your latest release of versterce (vensterce-01022007.zip), which is great ! I just had some minor issues to get it running. Can you please change ce.py to make it WinCe 4.20 compatible? aygshell.py in WinCe 4.20 just allow access via ordinal. Below code made it work for me. try: SHHandleWMActivate=ctypes.windll.aygshell.SHHandleWMActivate SHHandleWMSettingChange = ctypes.windll.aygshell.SHHandleWMSettingChange except: # WinCe 4.20 just allows dll access via ordinal SHHandleWMActivate=ctypes.windll.aygshell[84] SHHandleWMSettingChange=ctypes.windll.aygshell[83] Also the ZIP file includes only MoinMoin.pyc but not MoinMoin.py. Thanks, Jan PS: In case you are planning some improvements, what about the following features? - multiple file support - debug support - dynamic dll loading and navigation support - remote keyboard support (Host python script, which sends keypresses to the IDE on the PDA) alexandre.delattre at enst-bretagne.fr schrieb: > A fresher version of vensterce is up on sourceforge > (http://sourceforge.net/projects/vensterce/). > Various glitches have been fixed and sip handling is enhanced. > A control EditBox is implemented in venster.lib.edit and gives a text > control with classic undo/copy/paste context menu. > The IDE is updated (and "englishised") and shows an example of integrating > HTML control in your apps. > > Enjoy ;-) > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From sleepingbull at gmail.com Thu Feb 22 06:12:08 2007 From: sleepingbull at gmail.com (Matt S.) Date: Wed, 21 Feb 2007 21:12:08 -0800 Subject: [PythonCE] wxPython, handling close events Message-ID: I have a a wxPython application on the PPC 2003, Python 2.4, etc... I can gracefully exit on win32 from the frame close button or any button within the frame. My trouble arises on the PPC because the frame widgets (esp. close button) seem to not be associated with wx as much as the system and don't clean up properly. When I tap the close circle-X, the top level window goes away but the Python CE window remains. Then if I want to delete/replace the program my request gets refused because the original file is in use. Furthermore, if I start up the file again it will run but after loading up, the top level window is the old tlw. I've been experimenting with binding close events to a pre-exit function. I want to either kick up a message dialog to make sure the user wants to exit or just veto (event.Veto()) the frame level close button event. self.top_window.Bind(wx.EVT_CLOSE, self.PreExit) I've also fooled around with the following at the application level, self.Bind(wx.EVT_QUERY_END_SESSION, self.OnExit) self.Bind(wx.EVT_END_SESSION, self.OnExit) I'm afraid the frame close button event I'm trying to handle is some sort of hybrid. I won't describe it here but I also have a few other issues: 1) when the PPC goes into sleep mode bad things happen to my app 2) I've tried to use PocketConsole and the kill utility to find a resulting hung python program file but I don't see the file as a process. Python.exegets listed as a process but I'm not sure I've successfully ended it. I assume that if I do, the hung python program will get cleaned up. 3) Basic PPC os questions: -If a python file that is being interpreted is not a process, what is it? -Anyone know how to clean up one of the files when it's not ended properly? If no one has a quick comment that breaks the dam, tomorrow I'll put together a simple example of my problem and post it for interrogation. Thanks! Matt Lastly, please let me know if you think this subject should be posted to a wxPython list (and which one). Maybe a wxPythonCE list would be helpful in the near future? On 2/21/07, pythonce-request at python.org wrote: > > Send PythonCE mailing list submissions to > pythonce at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonce > or, via email, send a message with subject or body 'help' to > pythonce-request at python.org > > You can reach the person managing the list at > pythonce-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of PythonCE digest..." > > Today's Topics: > > 1. Bluetooth (ricercar at infinito.it) > 2. Re: Bluetooth (Ruben M. G.) > 3. serial port access (adrian wong) > 4. Re: serial port access (adrian) > > > ---------- Forwarded message ---------- > From: ricercar at infinito.it > To: pythonce at python.org > Date: Tue, 20 Feb 2007 12:54:18 +0100 > Subject: [PythonCE] Bluetooth > Hi all, > I sent this email by mistake directly to Ruben, my apologize to him and > all. In the meantime Ruben answered other emails and I did some further > steps, so thinks are clearer to me. > > I read with interest your posts about bluetooth. I also started looking > into it, but started form another point: using ctypes to call directly the > windows mobile dlls. Since I had not much time the first tries were > unsuccessful, I will retry during the next weekend. But this process > involve a lot of typing to convert classes and constants! > I think also your idea of creating a dll could be interisting. Can you > tell > me which development tools are you using? > I programmed in C++ for over ten years but now they are more or less four > years that I work with other languages, so at the moment I have only the > tools I need to build Python extensions. I don't know exactly what I need > to build for the windows mobile. > > Regards, > Enrico Bortolazzi > > > > > ---------- Forwarded message ---------- > From: "Ruben M. G." > To: pythonce at python.org, "ricercar at infinito.it" > Date: Tue, 20 Feb 2007 12:41:04 +0000 > Subject: Re: [PythonCE] Bluetooth > Dear Enrico Bortolazzi, > > > I read with interest your posts about bluetooth. I also started looking > > into it, but started form another point: using ctypes to call directly > the > > windows mobile dlls. > > That was my last idea before start to use ceserial.py > But I didn't feel with time enough to learn to use ctypes and the > dll so I > took another road (ceserial). > > > Since I had not much time the first tries were > > unsuccessful, I will retry during the next weekend. But this process > > involve a lot of typing to convert classes and constants! > > I think also your idea of creating a dll could be interisting. Can you > tell > > me which development tools are you using? > > Of course. > > You have to install "eMbedded Visual C++ 4.0" and then "SDK for Windows > Mobile 2003-based Pocket PCs". > > You need these two applications if you want to write an application on C++ > for > Windows Mobile. Or at least is what they say on the web :P > > http://www.microsoft.com/downloads/details.aspx?FamilyID=9996b314-0364-4623-9ede-0b5fbb133652&DisplayLang=en#Requirements > > http://msdn2.microsoft.com/en-us/embedded/aa714533.aspx > > You could try to compile as a dll what I called "the Bluetooth > stack core for > Windows CE" and then use it with ctypes. (I have no idea how to do it). > > Have fun amico!! > > -- > Kind regards / Cumprimentos / Atentamente, Ruben. > > > ---------- Forwarded message ---------- > From: "adrian wong" > To: pythonce at python.org > Date: Tue, 20 Feb 2007 17:46:28 -0800 > Subject: [PythonCE] serial port access > Hello > > I would like to access my serial port on my pocket pc. Would someone > sent me the ceserial.py codes and give me a few pointers on "how to" > do a "Hello World " type python program to strart. I'm very new to > python and very, very very new to pythonce. I tried this link > "http://mail.python.org/pipermail/pythonce > /attachments/20060922/5af92a01/attachment-0003.py > ", but when I import ceserial, pythonce gave me a "SyntasError: > invalid synax" > Thanks in advance. > Adrian > awong8888 at gmail.comhttp://mail.python.org/pipermail/pythonce > /attachments/20060922/5af92a01/attachment-0003.py > ", but when I import ceserial, pythonce gave me a "SyntasError: > invalid synax" > Thanks in advance. > Adrian > awong8888 at gmail.com > > > > ---------- Forwarded message ---------- > From: adrian > To: pythonce at python.org > Date: Wed, 21 Feb 2007 07:42:20 +0000 (UTC) > Subject: Re: [PythonCE] serial port access > adrian wong gmail.com> writes: > > > > > Hello > > > > I would like to access my serial port on my pocket pc. Would someone > > sent me the ceserial.py codes and give me a few pointers on "how to" > > do a "Hello World " type python program to strart. I'm very new to > > python and very, very very new to pythonce. I tried this link > > > "http://mail.python.org/pipermail/pythonce > /attachments/20060922/5af92a01/attachment-0003.py > > ", but when I import ceserial, pythonce gave me a "SyntasError: > > invalid synax" > > Thanks in advance. > > Adrian > > awong8888 > gmail.comhttp://mail.python.org/pipermail/pythonce > /attachments/20060922/5af92a01/attachment-0003.py > > ", but when I import ceserial, pythonce gave me a "SyntasError: > > invalid synax" > > Thanks in advance. > > Adrian > > awong8888 gmail.com > > > > > when I click on the link in my own post, I downloaded the file instead of > cut > and pasted the text. And it is working, or at least I imported without any > error. > in case someone else want to do this, you also need windase.py a link > http://mail.python.org/pipermail/pythonce > /attachments/20060922/5af92a01/attachment-0002.py > > the code is from Benjamin McBride in a post earlier. > > > Adrian > > > > --===============2007223627==-- > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070221/a9000b30/attachment.html From coder_infidel at hotmail.com Thu Feb 22 16:03:44 2007 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Fri, 23 Feb 2007 00:03:44 +0900 Subject: [PythonCE] win32process.pyd References: <000f01c7540e$d1cb5eb0$6400a8c0@booth1> Message-ID: As with Python on any other operating system, extension modules for version 2.3 (for example) will not work with 2.4 or later. You could try to build a win32process.pyd for PythonCE 2.5 but a better solution I think would be to use ctypes. Luke ----- Original Message ----- From: "Andrew Booth" To: Sent: Monday, February 19, 2007 7:15 PM Subject: [PythonCE] win32process.pyd >I have recently (finally) upgraded from 2.3.5 to 2.5. > > I previously had win32process.pyd in the Lib directory. However, when I > put > it in the Lib or the DLLs directory, I get: > > Import win32process > ImportError: DLL load failed: The specified module could not be found. > > Am I putting it in the wrong place or do I need an updated file? > > Any help very much appreciated. > > Andrew Booth > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From mail at jan-ischebeck.de Thu Feb 22 18:08:34 2007 From: mail at jan-ischebeck.de (Jan Ischebeck) Date: Thu, 22 Feb 2007 18:08:34 +0100 Subject: [PythonCE] remote-console In-Reply-To: References: <200702161850.26251.xrubenx.es@gmail.com> <200702191943.39620.xrubenx.es@gmail.com> Message-ID: <45DDCE12.2010800@jan-ischebeck.de> Hi Thomas, Your script works well for me on Ubuntu Feisty. The only issue I have is, that it doesn't detect the "//Program Files/" folder correctly for non-US Pocket PCs. (E.g. German WinCE uses "//Programme/"). I've tried to get this directory via CeGetSpecialFolder, but was not successful. Below my additions to rapi.py to make use CeGetSpecialFolder. Jan ##################################################################### # getSpecialFolderPath rapi.CeGetSpecialFolderPath.errcheck = errcheck rapi.CeGetSpecialFolderPath.argtypes = (ctypes.c_int, DWORD, ctypes.c_void_p); def GetSpecialFolderPath(folderid): length=128 buf = ctypes.create_string_buffer('\000' * length) rapi.CeGetSpecialFolderPath(folderid, length, buf) value = ctypes.string_at(buf, length).decode('utf-16') return value[0:value.index('\x00')] CSIDL_PROGRAMS= 0x0002 CSIDL_PERSONAL= 0x0005 CSIDL_FAVORITES_GRYPHON= 0x0006 CSIDL_STARTUP= 0x0007 CSIDL_RECENT= 0x0008 CSIDL_STARTMENU = 0x000b CSIDL_DESKTOPDIRECTORY= 0x0010 CSIDL_FONTS= 0x0014 CSIDL_FAVORITES= 0x0016 ################################################################ # Error codes from Synce project (librapi2/src/rapi_types.h) ERROR_SUCCESS = 0 ERROR_FILE_NOT_FOUND = 2 ERROR_NOT_ENOUGH_MEMORY = 8 ERROR_SEEK = 25 ERROR_INVALID_PARAMETER = 87 ERROR_INSUFFICIENT_BUFFER = 122 ERROR_NO_DATA = 232 ERROR_NO_MORE_ITEMS = 259 ERROR_KEY_DELETED = 1018 Thomas Heller schrieb: > Ruben Miguelez Garcia schrieb: > >>> Ah, great. Yes, the current version only works on Windows, it requires >>> that the device is connected via ActiveSync. The CeRemoteAPI is used to >>> transfer the client script to the device, and start the interpreter there. >>> Sorry for this limitation. >>> >>> Is there something on Linux that allows to >>> transfer files and start processes on the PDA? >>> >> I really don't know because I didn't have time to investigate it and my >> application is already finished, so I won't work more with the PDA for some >> time. >> >> But I think It should be possible. I just connected the usb cable from the >> cradle to my laptop and this is the output from the kernel: >> >> -------------------- >> # dmesg >> usb 2-1: new full speed USB device using uhci_hcd and address 2 >> drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic >> usbcore: registered new driver usbserial_generic >> usbcore: registered new driver usbserial >> drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0 >> drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC >> PDA >> drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5 >> ipaq 2-1:1.0: PocketPC PDA converter detected >> usb 2-1: PocketPC PDA converter now attached to ttyUSB0 >> usbcore: registered new driver ipaq >> --------------------- >> >> > > I found the synce project on sourceforge. This contains a rapi library that > emulates the rapi.dll on Windows. > > I have adapted the remote console sources so that it also works on linux > (tested on Ubuntu). > > I'm not a Linux expert, but here is (in short) what I did: > > - Installed the synce-serial, synce-dccm, libsynce0, librapi packages. > - Cradled the CE device into the USB connector (I use a Dell X50 PDA, > with Windows Mobile 2003) > - Run these commands (some or all of them with sudo): > modprobe ipaq > synce-serial-config ttyUSB0 > synce-serial-start > > Now the device connects to the PC, and I can run console.py. > Note that there should be no need to adjust anything in the console.py > or the client.py sources (at least if you use the default IP address that > synce suggests: 192.168.131.102). > > console.py accepts some command line switches that the python interpreter > also understands. Useful are probably "-c " and "-m ". > > Thomas > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From sleepingbull at gmail.com Fri Feb 23 00:31:58 2007 From: sleepingbull at gmail.com (Matt S.) Date: Thu, 22 Feb 2007 15:31:58 -0800 Subject: [PythonCE] wxPython, handling close events Message-ID: Here's some sample code that highlights my application closing problem. If a user uses the Quit button, no problem. If on the other hand they close the frame, hay mucho problemas. I've included some comments and commented out some code that can be used to alter the applications behavior. Ideally, I want the user to have to confirm that they want to quit before the program ever begins to be destroyed. Thanks! Matt ---------- Forwarded message ---------- > From: "Matt S." > To: pythonce at python.org > Date: Wed, 21 Feb 2007 21:12:08 -0800 > Subject: [PythonCE] wxPython, handling close events > I have a a wxPython application on the PPC 2003, Python 2.4, etc... > > I can gracefully exit on win32 from the frame close button or any button > within the frame. My trouble arises on the PPC because the frame widgets > (esp. close button) seem to not be associated with wx as much as the system > and don't clean up properly. When I tap the close circle-X, the top level > window goes away but the Python CE window remains. Then if I want to > delete/replace the program my request gets refused because the original file > is in use. Furthermore, if I start up the file again it will run but after > loading up, the top level window is the old tlw. > > I've been experimenting with binding close events to a pre-exit function. > I want to either kick up a message dialog to make sure the user wants to > exit or just veto (event.Veto()) the frame level close button event. > > self.top_window.Bind(wx.EVT_CLOSE, self.PreExit) > > I've also fooled around with the following at the application level, > > self.Bind(wx.EVT_QUERY_END_SESSION, self.OnExit) > self.Bind(wx.EVT_END_SESSION , self.OnExit) > > I'm afraid the frame close button event I'm trying to handle is some sort > of hybrid. > > I won't describe it here but I also have a few other issues: > 1) when the PPC goes into sleep mode bad things happen to my app > 2) I've tried to use PocketConsole and the kill utility to find a > resulting hung python program file but I don't see the file as a process. > Python.exe gets listed as a process but I'm not sure I've successfully > ended it. I assume that if I do, the hung python program will get cleaned > up. > 3) Basic PPC os questions: > -If a python file that is being interpreted is not a process, what is it? > -Anyone know how to clean up one of the files when it's not ended > properly? > > If no one has a quick comment that breaks the dam, tomorrow I'll put > together a simple example of my problem and post it for interrogation. > > Thanks! > Matt > > Lastly, please let me know if you think this subject should be posted to a > wxPython list (and which one). Maybe a wxPythonCE list would be helpful in > the near future? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070222/4f8f9fdd/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: simple_frame.py Type: text/x-python Size: 4967 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070222/4f8f9fdd/attachment.py From theller at ctypes.org Fri Feb 23 09:32:14 2007 From: theller at ctypes.org (Thomas Heller) Date: Fri, 23 Feb 2007 09:32:14 +0100 Subject: [PythonCE] remote-console In-Reply-To: <45DDCE12.2010800@jan-ischebeck.de> References: <200702161850.26251.xrubenx.es@gmail.com> <200702191943.39620.xrubenx.es@gmail.com> <45DDCE12.2010800@jan-ischebeck.de> Message-ID: Jan Ischebeck schrieb: > Hi Thomas, > > Your script works well for me on Ubuntu Feisty. > > The only issue I have is, that it doesn't detect the "//Program Files/" > folder correctly for non-US Pocket PCs. (E.g. German WinCE uses > "//Programme/"). > > I've tried to get this directory via CeGetSpecialFolder, but was not > successful. Below my additions to rapi.py to make use CeGetSpecialFolder. The magic constant is CSIDL_PROGRAM_FILES = 0x26. I have adapted your patch somewhat and committed it to the repository. Can you please check if it works for you? > > Jan > > ##################################################################### > # getSpecialFolderPath > > rapi.CeGetSpecialFolderPath.errcheck = errcheck > rapi.CeGetSpecialFolderPath.argtypes = (ctypes.c_int, DWORD, > ctypes.c_void_p); > > def GetSpecialFolderPath(folderid): > length=128 > buf = ctypes.create_string_buffer('\000' * length) > rapi.CeGetSpecialFolderPath(folderid, length, buf) > value = ctypes.string_at(buf, length).decode('utf-16') > return value[0:value.index('\x00')] Thanks for tha patch, Thomas From coder_infidel at hotmail.com Fri Feb 23 17:12:20 2007 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Sat, 24 Feb 2007 01:12:20 +0900 Subject: [PythonCE] wxPython, handling close events References: Message-ID: As with any Pocket PC application (written in Python or otherwise), the X "close" button merely hides a window and does not destroy it. The Pocket PC platform is intended so that users don't need to "close" applications as such, and if you open enough other applications that the memory starts to become full, the OS will actually close (WM_CLOSE) some of the applications that were hidden in the background. If you try clicking the X button on any of the Microsoft's Pocket PC applications, e.g. Pocket Word, and then look in the task manager you will notice that it is still running. You may be able to capture the event as WM_SHOWWINDOW. As with any Python program on the PC, your script is not a process but is just a text file that is interpreted by the python.exe process. Luke ----- Original Message ----- From: Matt S. To: pythonce at python.org Sent: Thursday, February 22, 2007 2:12 PM Subject: [PythonCE] wxPython, handling close events I have a a wxPython application on the PPC 2003, Python 2.4, etc... I can gracefully exit on win32 from the frame close button or any button within the frame. My trouble arises on the PPC because the frame widgets (esp. close button) seem to not be associated with wx as much as the system and don't clean up properly. When I tap the close circle-X, the top level window goes away but the Python CE window remains. Then if I want to delete/replace the program my request gets refused because the original file is in use. Furthermore, if I start up the file again it will run but after loading up, the top level window is the old tlw. I've been experimenting with binding close events to a pre-exit function. I want to either kick up a message dialog to make sure the user wants to exit or just veto (event.Veto()) the frame level close button event. self.top_window.Bind(wx.EVT_CLOSE, self.PreExit) I've also fooled around with the following at the application level, self.Bind(wx.EVT_QUERY_END_SESSION, self.OnExit) self.Bind(wx.EVT_END_SESSION , self.OnExit) I'm afraid the frame close button event I'm trying to handle is some sort of hybrid. I won't describe it here but I also have a few other issues: 1) when the PPC goes into sleep mode bad things happen to my app 2) I've tried to use PocketConsole and the kill utility to find a resulting hung python program file but I don't see the file as a process. Python.exe gets listed as a process but I'm not sure I've successfully ended it. I assume that if I do, the hung python program will get cleaned up. 3) Basic PPC os questions: -If a python file that is being interpreted is not a process, what is it? -Anyone know how to clean up one of the files when it's not ended properly? If no one has a quick comment that breaks the dam, tomorrow I'll put together a simple example of my problem and post it for interrogation. Thanks! Matt Lastly, please let me know if you think this subject should be posted to a wxPython list (and which one). Maybe a wxPythonCE list would be helpful in the near future? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070224/c73da63a/attachment.htm From sleepingbull at gmail.com Fri Feb 23 20:54:43 2007 From: sleepingbull at gmail.com (Matt S.) Date: Fri, 23 Feb 2007 11:54:43 -0800 Subject: [PythonCE] wxPython, handling close events In-Reply-To: References: Message-ID: Luke, I'll have to chew on this a bit more. Yesterday afternoon I also discovered (maybe rediscovered) the wxPython port notes for CE at, http://wxwidgets.org/manuals/2.6.3/wx_wxmswport.html#wxmswport The notes and your comments should make my life easier. Thanks hombre, Matt On 2/23/07, Luke Dunstan wrote: > > As with any Pocket PC application (written in Python or otherwise), the X > "close" button merely hides a window and does not destroy it. The Pocket PC > platform is intended so that users don't need to "close" applications as > such, and if you open enough other applications that the memory starts to > become full, the OS will actually close (WM_CLOSE) some of the applications > that were hidden in the background. If you try clicking the X button on > any of the Microsoft's Pocket PC applications, e.g. Pocket Word, and then > look in the task manager you will notice that it is still running. > > You may be able to capture the event as WM_SHOWWINDOW. > > As with any Python program on the PC, your script is not a process but is > just a text file that is interpreted by the python.exe process. > > Luke > > > ----- Original Message ----- > *From:* Matt S. > *To:* pythonce at python.org > *Sent:* Thursday, February 22, 2007 2:12 PM > *Subject:* [PythonCE] wxPython, handling close events > > I have a a wxPython application on the PPC 2003, Python 2.4, etc... > > I can gracefully exit on win32 from the frame close button or any button > within the frame. My trouble arises on the PPC because the frame widgets > (esp. close button) seem to not be associated with wx as much as the system > and don't clean up properly. When I tap the close circle-X, the top level > window goes away but the Python CE window remains. Then if I want to > delete/replace the program my request gets refused because the original file > is in use. Furthermore, if I start up the file again it will run but after > loading up, the top level window is the old tlw. > > I've been experimenting with binding close events to a pre-exit function. > I want to either kick up a message dialog to make sure the user wants to > exit or just veto (event.Veto()) the frame level close button event. > > self.top_window.Bind(wx.EVT_CLOSE, self.PreExit) > > I've also fooled around with the following at the application level, > > self.Bind(wx.EVT_QUERY_END_SESSION, self.OnExit) > self.Bind(wx.EVT_END_SESSION , self.OnExit) > > I'm afraid the frame close button event I'm trying to handle is some sort > of hybrid. > > I won't describe it here but I also have a few other issues: > 1) when the PPC goes into sleep mode bad things happen to my app > 2) I've tried to use PocketConsole and the kill utility to find a > resulting hung python program file but I don't see the file as a process. > Python.exe gets listed as a process but I'm not sure I've successfully > ended it. I assume that if I do, the hung python program will get cleaned > up. > 3) Basic PPC os questions: > -If a python file that is being interpreted is not a process, what is it? > -Anyone know how to clean up one of the files when it's not ended > properly? > > If no one has a quick comment that breaks the dam, tomorrow I'll put > together a simple example of my problem and post it for interrogation. > > Thanks! > Matt > > Lastly, please let me know if you think this subject should be posted to a > wxPython list (and which one). Maybe a wxPythonCE list would be helpful in > the near future? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070223/6a472182/attachment.htm From marco.herrmann at web.de Sun Feb 25 12:56:07 2007 From: marco.herrmann at web.de (Marco Herrmann) Date: Sun, 25 Feb 2007 12:56:07 +0100 Subject: [PythonCE] GUI package for PythonCE Message-ID: <45E17957.7070801@web.de> Hello, I just started programming with PythonCE and still didn't find an appropriate package that delivers a good GUI functionality. I found Tkinter, WxPyCE, VensterCE and Win32GUI. The problem I have, is that the packages whether don't offer a native PocketPC look (like Tkinter), need a many lines of code for a simple GUI (like VensterCE) or the menu is not working / not being offered (WxPyCE). I have been searching for some documentation for these packages, but didn't find any. For instance, how to use the Win32All/GUI package or WxPyCE. Maybe the menus have to be programmed in a different way with WxPyCE on PPC compared to WxPython on PC? If someone can help me with documentation of Win32all/GUI or WxPyCE I'd be very thankful. Maybe there's another GUI package I haven't found yet. I need a native PocketPC look and functionalities: program window fits into screen and menus at the bottom. Important also is that I need to draw functions/dots. I am thankful for any suggestions. Marco From xrubenx.es at gmail.com Sun Feb 25 23:58:14 2007 From: xrubenx.es at gmail.com (Ruben M. G.) Date: Sun, 25 Feb 2007 22:58:14 +0000 Subject: [PythonCE] How do you stop your application? Message-ID: This question is for those that don't have a GUI on his application. On mine one, the only way to stop the application is going to 'Running tasks' and press over "Python CE" and then "Stop". It stop the application but I don't know how to handle it. Does anybody know how to handle this "stop" on the PDA ? Thanks in advance, Ruben. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070225/492bf424/attachment.html From sergeych at tancher.com Mon Feb 26 00:39:11 2007 From: sergeych at tancher.com (Sergey Chernov) Date: Mon, 26 Feb 2007 02:39:11 +0300 Subject: [PythonCE] GUI package for PythonCE In-Reply-To: <45E17957.7070801@web.de> References: <45E17957.7070801@web.de> Message-ID: <000901c75936$26e84210$f300a8c0@SergeyhCelsius> Just hope one of the experienced python ce guru would put something to the wiki :( so far looks much like bycicle reinventing community. Much fun, little gain ;) -----Original Message----- From: pythonce-bounces at python.org [mailto:pythonce-bounces at python.org] On Behalf Of Marco Herrmann Sent: Sunday, February 25, 2007 2:56 PM To: pythonce at python.org Subject: [PythonCE] GUI package for PythonCE Hello, I just started programming with PythonCE and still didn't find an appropriate package that delivers a good GUI functionality. I found Tkinter, WxPyCE, VensterCE and Win32GUI. The problem I have, is that the packages whether don't offer a native PocketPC look (like Tkinter), need a many lines of code for a simple GUI (like VensterCE) or the menu is not working / not being offered (WxPyCE). I have been searching for some documentation for these packages, but didn't find any. For instance, how to use the Win32All/GUI package or WxPyCE. Maybe the menus have to be programmed in a different way with WxPyCE on PPC compared to WxPython on PC? If someone can help me with documentation of Win32all/GUI or WxPyCE I'd be very thankful. Maybe there's another GUI package I haven't found yet. I need a native PocketPC look and functionalities: program window fits into screen and menus at the bottom. Important also is that I need to draw functions/dots. I am thankful for any suggestions. Marco _______________________________________________ PythonCE mailing list PythonCE at python.org http://mail.python.org/mailman/listinfo/pythonce From infopazo at hdsnet.hu Mon Feb 26 12:11:59 2007 From: infopazo at hdsnet.hu (infopazo at hdsnet.hu) Date: Mon, 26 Feb 2007 12:11:59 +0100 (CET) Subject: [PythonCE] iso8859-2 or latin2 Message-ID: <34997.80.98.78.23.1172488319.squirrel@80.98.78.23> #!/usr/bin/python # -*- coding: latin2 -*- import os, sys print sys.getdefaultencoding() print sys.getfilesystemencoding() The result is the folowing: mbcs ascii I use hungarian characters in my program. I write an application for polisters in PythonCE 2.5 I'd like use it with tkinter and sqlite. The sqlite database encoding can be utf-8 or iso8859-2. I tried both. The test code is folowing: # -*- coding:utf-8 -*- latin2_decoder = lambda s: s.encode("iso8859-2", "replace") # str(s) from sqlite3 import dbapi2 as sqlite con=sqlite.connect("\\SD Card\\work\\python\\cdata.db",isolation_level=None) con.text_factory=latin2_decoder cur=con.cursor() cur.execute("select ctyid,name from cities") row=cur.fetchone() while row: print row[0],row[1] row=cur.fetchone() con.close() Printing hungarian specific characters are failed or simply rectangles displayed in place of characters. sys.setdefaultencoding() procedure doesnt exists. Can anybody help me, please? best regards Zoltan From alexandre.delattre at enst-bretagne.fr Mon Feb 26 15:19:34 2007 From: alexandre.delattre at enst-bretagne.fr (DELATTRE Alexandre) Date: Mon, 26 Feb 2007 15:19:34 +0100 Subject: [PythonCE] GUI package for PythonCE References: 45E17957.7070801@web.de Message-ID: <45E2EC76.6090203@enst-bretagne.fr> Hello, When I began pyhtonce, finding no gui library that is both native and have a small memory footprint is what makes me look into another way and port venster. On desktop, I obviously prefer wx, but on my PDA the dll/pyd are so bigs that even if I succeed in importing it I can import nothing more. It's true that Venster is in some point quite low level, sometimes requires knowledge on Win32 GUI programming, and is not well documented (Pocket PC sdk help shipped with evc++ is although useful). Now that the core modules are working I can concentrate on making VensterCE more pythonic, add degrees of abstraction and write docs on using it. The upcoming release, will contains tutorials, a layout mechanism in the vein of wx/pygtk and unification of dialogs and window (Now you can make "emulated" modal dialogs like any other window, whithout using ugly fixed size dialogtemplate or resource in a dll). I suggest you to give it a try when it comes out this end of week, the tutorial will show you that the code for a simple window using common controls that fits to screen is comparable to wx. As for the menu, for now it works well on Win Mobile 5.0, but not on Pocket Pc 2003, I hope someone experienced in Win32 C programming can help me to fix it. I think that with additional work, vensterce will be the gui library we need : both native and simple. Alexandre Delattre. From alexandre.delattre at enst-bretagne.fr Mon Feb 26 15:26:24 2007 From: alexandre.delattre at enst-bretagne.fr (DELATTRE Alexandre) Date: Mon, 26 Feb 2007 15:26:24 +0100 Subject: [PythonCE] VensterCE release - Bugfix and Feedback In-Reply-To: <45DD9437.2090405@jan-ischebeck.de> References: <20070130165510.n9dxmi1vs4kcc8sw@webmail.enst-bretagne.fr> <7A93FCDF-D431-4A8D-B673-DED85592A5B5@ablelinktech.com> <20070201152601.z06ycwp6804o844g@webmail.enst-bretagne.fr> <45DD9437.2090405@jan-ischebeck.de> Message-ID: <45E2EE10.2000207@enst-bretagne.fr> Jan Ischebeck a ?crit : > Hello Alexandre, > > Today I downloaded your latest release of versterce > (vensterce-01022007.zip), which is great ! > > I just had some minor issues to get it running. > > Can you please change ce.py to make it WinCe 4.20 compatible? > aygshell.py in WinCe 4.20 just allow access via ordinal. Below code > made it work for me. > > try: > SHHandleWMActivate=ctypes.windll.aygshell.SHHandleWMActivate > SHHandleWMSettingChange = ctypes.windll.aygshell.SHHandleWMSettingChange > except: # WinCe 4.20 just allows dll access via ordinal > SHHandleWMActivate=ctypes.windll.aygshell[84] > SHHandleWMSettingChange=ctypes.windll.aygshell[83] > > Also the ZIP file includes only MoinMoin.pyc but not MoinMoin.py. > > Thanks, > > Jan > > PS: In case you are planning some improvements, what about the > following features? > - multiple file support > - debug support > - dynamic dll loading and navigation support > - remote keyboard support (Host python script, which sends > keypresses to the IDE on the PDA) > > alexandre.delattre at enst-bretagne.fr schrieb: >> A fresher version of vensterce is up on sourceforge >> (http://sourceforge.net/projects/vensterce/). >> Various glitches have been fixed and sip handling is enhanced. >> A control EditBox is implemented in venster.lib.edit and gives a >> text control with classic undo/copy/paste context menu. >> The IDE is updated (and "englishised") and shows an example of >> integrating >> HTML control in your apps. >> >> Enjoy ;-) >> >> _______________________________________________ >> PythonCE mailing list >> PythonCE at python.org >> http://mail.python.org/mailman/listinfo/pythonce >> > > Hi Jan, Thanks for the feedback I will put the bugfix in the next release. Do you have a problem with others dll or is it aygshell specific? The next release will use the SHDoneButton function, can you please send me the ordinal ? As for the ide, I think what it needs for now is "heavy refactoring" ;-), and I will move on improvements later, here are my thoughts about them : Multiple documents could be easy to implement, but I prefer waiting the menu issue on PPC2003 to be fixed to make a menu for opening/closing tabs. The idea of a module/class explorer sounds good to me and it may be interesting to implement it using the instrospection abilities of python. Maybe, i will look into the source of other ide like SPE. As for the remote keyboard, I don't have such device but if someone sends me an example script using it, I can host the support as a thread that inserts the characters in the editbox. I will upload the release soon, it will add 2 new things to the gui toolkit : - A simple layout system - Unification of windows and modal dialog. Alex From mail at jan-ischebeck.de Mon Feb 26 15:59:51 2007 From: mail at jan-ischebeck.de (Jan Ischebeck) Date: Mon, 26 Feb 2007 15:59:51 +0100 Subject: [PythonCE] VensterCE release - Bugfix and Feedback In-Reply-To: <45E2EE10.2000207@enst-bretagne.fr> References: <20070130165510.n9dxmi1vs4kcc8sw@webmail.enst-bretagne.fr> <7A93FCDF-D431-4A8D-B673-DED85592A5B5@ablelinktech.com> <20070201152601.z06ycwp6804o844g@webmail.enst-bretagne.fr> <45DD9437.2090405@jan-ischebeck.de> <45E2EE10.2000207@enst-bretagne.fr> Message-ID: <45E2F5E7.7050201@jan-ischebeck.de> Hi Alex, It is great that you put additional effort into venster. Although I don't have much time at the moment, at least I will do some beta testing. :) SHDoneButton should have a ordinal of 69. But it is likely that you can address it directly. I will try later. For other ordinals I have used the following webpage; http://cegcc.svn.sourceforge.net/viewvc/cegcc/trunk/cegcc/src/w32api/libce/aygshell.def?revision=842&view=markup Concerning the keyboard feature I will try to write some sample code myself. One idea would be to extend the console.py program. I'll try. CU Jan DELATTRE Alexandre wrote: > Jan Ischebeck a ?crit : > >> Hello Alexandre, >> >> Today I downloaded your latest release of versterce >> (vensterce-01022007.zip), which is great ! >> >> I just had some minor issues to get it running. >> >> Can you please change ce.py to make it WinCe 4.20 compatible? >> aygshell.py in WinCe 4.20 just allow access via ordinal. Below code >> made it work for me. >> >> try: >> SHHandleWMActivate=ctypes.windll.aygshell.SHHandleWMActivate >> SHHandleWMSettingChange = ctypes.windll.aygshell.SHHandleWMSettingChange >> except: # WinCe 4.20 just allows dll access via ordinal >> SHHandleWMActivate=ctypes.windll.aygshell[84] >> SHHandleWMSettingChange=ctypes.windll.aygshell[83] >> >> Also the ZIP file includes only MoinMoin.pyc but not MoinMoin.py. >> >> Thanks, >> >> Jan >> >> PS: In case you are planning some improvements, what about the >> following features? >> - multiple file support >> - debug support >> - dynamic dll loading and navigation support >> - remote keyboard support (Host python script, which sends >> keypresses to the IDE on the PDA) >> >> alexandre.delattre at enst-bretagne.fr schrieb: >> >>> A fresher version of vensterce is up on sourceforge >>> (http://sourceforge.net/projects/vensterce/). >>> Various glitches have been fixed and sip handling is enhanced. >>> A control EditBox is implemented in venster.lib.edit and gives a >>> text control with classic undo/copy/paste context menu. >>> The IDE is updated (and "englishised") and shows an example of >>> integrating >>> HTML control in your apps. >>> >>> Enjoy ;-) >>> >>> _______________________________________________ >>> PythonCE mailing list >>> PythonCE at python.org >>> http://mail.python.org/mailman/listinfo/pythonce >>> >>> >> > Hi Jan, > Thanks for the feedback I will put the bugfix in the next release. > Do you have a problem with others dll or is it aygshell specific? > The next release will use the SHDoneButton function, can you please send > me the ordinal ? > > As for the ide, I think what it needs for now is "heavy refactoring" > ;-), and I will move on improvements later, here are my thoughts about > them : > Multiple documents could be easy to implement, but I prefer waiting the > menu issue on PPC2003 to be fixed to make > a menu for opening/closing tabs. > The idea of a module/class explorer sounds good to me and it may be > interesting to implement it using the instrospection abilities of > python. Maybe, i will look into the source of other ide like SPE. > As for the remote keyboard, I don't have such device but if someone > sends me an example script using it, > I can host the support as a thread that inserts the characters in the > editbox. > > I will upload the release soon, it will add 2 new things to the gui > toolkit : > - A simple layout system > - Unification of windows and modal dialog. > > Alex > > > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From sleepingbull at gmail.com Mon Feb 26 21:53:13 2007 From: sleepingbull at gmail.com (Matt S.) Date: Mon, 26 Feb 2007 12:53:13 -0800 Subject: [PythonCE] wxPython, handling close events In-Reply-To: References: Message-ID: Luke, You wrote on 2/23/07, in response to my inquiry about how to handle what are generally close events on Windows (but not on CE), You may be able to capture the event as WM_SHOWWINDOW. > Should this event be captured through wxPython or do I have to use ctypes or something else? What follows is my rant about the painful small problems I'm encountering, my feeling that the Wiki really needs to get some love/content (especially for using wxPython and how to successfully emulate Python/wx on a PocketPC emulator), and some other leads I have for how to handle the closing problem. Any words of wisdom or insight are appreciated. *** I'm pretty much beat by this issue at this point. First off, I'm amazed how much work and functionality is available in wxPython for CE, but (now my rant), it's pretty frustrating (to say it lightly) when so much of Python works beautifully on CE and then (at least wrt wxPython) small things turn into such ghastly demons. I keep fighting (maybe believing) that my organization will be the better for rejecting a 500 pound gorilla and going with wx/Python on this project... but days (as in multiple) like these make me think either we shouldn't mess with CE/Mobile/whatever and just stick to Windows (and maybe Linux if only there were more users) or go with a language that is more targeted/supported by the CE environment (Visual Basic??? Please, no!) and documented. >From my standpoint, as a scientist who develops, I'm not really an expert wrt to anything. But I feel I can generally bridge the gap between a real world problem and derive a solution using (almost always) Python. But bosses, peers, even me want to see functionality and I don't want to have to be an expert on the intricacies of every os just to figure out how to gracefully close a program. That said, this seems to be a problem that anyone who is programming on the PocketPC and wants to use wxPython for their interface will have to solve. I hope to find a solution to this problem and get the issue and solution posted to the wiki (either with my own 10 fingers or through someone who knows the solution which surely someone does). The wiki: http://pythonce.sourceforge.net/Wikka/HomePage (there's not a single page about wxPython there!). Regarding new info I have about solving this problem, I'm thinking I either need to implement a WindowProc function that processes messages sent to the window, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowprocedures/windowprocedurereference/windowprocedurefunctions/windowproc.asp or, hope that the WS_NONAVDONEBUTTON gets supported by wx and then ported to the PPC (or learn to compile, etc. myself), http://msdn2.microsoft.com/en-us/library/aa458799.aspx One last thing, being a relative novice, solving this problem is seriously compounded because I haven't seen a simple explanation of (or mention that) Python/wx will work in any of the PPC emulators. I hope I'm not stepping on toes but instead making PythonCE/wxPython more accessible by asking the "stupid questions," Thanks everyone, Matt :-) On 2/23/07, Luke Dunstan wrote: > > As with any Pocket PC application (written in Python or otherwise), the X > "close" button merely hides a window and does not destroy it. The Pocket PC > platform is intended so that users don't need to "close" applications as > such, and if you open enough other applications that the memory starts to > become full, the OS will actually close (WM_CLOSE) some of the applications > that were hidden in the background. If you try clicking the X button on > any of the Microsoft's Pocket PC applications, e.g. Pocket Word, and then > look in the task manager you will notice that it is still running. > > You may be able to capture the event as WM_SHOWWINDOW. > > As with any Python program on the PC, your script is not a process but is > just a text file that is interpreted by the python.exe process. > > Luke > > > ----- Original Message ----- > *From:* Matt S. > *To:* pythonce at python.org > *Sent:* Thursday, February 22, 2007 2:12 PM > *Subject:* [PythonCE] wxPython, handling close events > > I have a a wxPython application on the PPC 2003, Python 2.4, etc... > > I can gracefully exit on win32 from the frame close button or any button > within the frame. My trouble arises on the PPC because the frame widgets > (esp. close button) seem to not be associated with wx as much as the system > and don't clean up properly. When I tap the close circle-X, the top level > window goes away but the Python CE window remains. Then if I want to > delete/replace the program my request gets refused because the original file > is in use. Furthermore, if I start up the file again it will run but after > loading up, the top level window is the old tlw. > > I've been experimenting with binding close events to a pre-exit function. > I want to either kick up a message dialog to make sure the user wants to > exit or just veto (event.Veto()) the frame level close button event. > > self.top_window.Bind(wx.EVT_CLOSE, self.PreExit) > > I've also fooled around with the following at the application level, > > self.Bind(wx.EVT_QUERY_END_SESSION, self.OnExit) > self.Bind(wx.EVT_END_SESSION , self.OnExit) > > I'm afraid the frame close button event I'm trying to handle is some sort > of hybrid. > > I won't describe it here but I also have a few other issues: > 1) when the PPC goes into sleep mode bad things happen to my app > 2) I've tried to use PocketConsole and the kill utility to find a > resulting hung python program file but I don't see the file as a process. > Python.exe gets listed as a process but I'm not sure I've successfully > ended it. I assume that if I do, the hung python program will get cleaned > up. > 3) Basic PPC os questions: > -If a python file that is being interpreted is not a process, what is it? > -Anyone know how to clean up one of the files when it's not ended > properly? > > If no one has a quick comment that breaks the dam, tomorrow I'll put > together a simple example of my problem and post it for interrogation. > > Thanks! > Matt > > Lastly, please let me know if you think this subject should be posted to a > wxPython list (and which one). Maybe a wxPythonCE list would be helpful in > the near future? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070226/65d49029/attachment.html From dpwhittaker at gmail.com Tue Feb 27 02:34:09 2007 From: dpwhittaker at gmail.com (Progor) Date: Mon, 26 Feb 2007 17:34:09 -0800 (PST) Subject: [PythonCE] weird Tkinter Message-ID: <9173378.post@talk.nabble.com> So, I think I might have my install kinda borked. I finally got it working, but I had to jump through some hoops to make it work. First, I installed PythonCE with CABINSTL directly into /Python (I switch SD cards all the time, wanted it in main memory (for speed too), but with as few spaces as possible for command line stuff). Then, I tried just doing an import Tkinter from the console, but it gave me the notorious missing TK DLL message. So, I found the dlls (celib, tk84, tcl84) and put them in /Windows, but it still gave me the error. So, I played around with it a bit. I found out if I import _tkinter first, then it doesn't give me the message... but that's an extra line in all my programs and may be weird if I ever want to give out my programs. I kept looking around on this mailing list and finally figured out I needed to install tcl as well, did that, but I still have to import _tkinter before I can import Tkinter without getting the "Could not find TK DLL" error. It sounds like some people have gotten it to work on their systems without the weird "import _tkinter" extra line. Have I done something wrong? Or is Tkinter just that persnickity? -- View this message in context: http://www.nabble.com/weird-Tkinter-tf3297520.html#a9173378 Sent from the Python - pythonce mailing list archive at Nabble.com. From dpwhittaker at gmail.com Tue Feb 27 06:15:59 2007 From: dpwhittaker at gmail.com (Progor) Date: Mon, 26 Feb 2007 21:15:59 -0800 (PST) Subject: [PythonCE] One other question: detecting SIP Message-ID: <9175562.post@talk.nabble.com> Is it possible to detect whether the SIP (software keyboard) is displayed or not? It would be nice to resize my main frame when the SIP is in the way. P.S. One good text editor I've found for editing code on the PPC is cke. It's a bit alpha-ish, so sometimes there are some display glitches (turn word wrap on, it's good and it cuts down on lots of them). It does indentation for you, colors text, and allows you to customize your font settings so you can get a lot more text on the screen. You can find it on Freewareppc under docs/Text Editors. I've got a syntax file for it based on TextPad's if anyone wants it. -- View this message in context: http://www.nabble.com/One-other-question%3A-detecting-SIP-tf3298456.html#a9175562 Sent from the Python - pythonce mailing list archive at Nabble.com. From coder_infidel at hotmail.com Tue Feb 27 10:56:20 2007 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Tue, 27 Feb 2007 18:56:20 +0900 Subject: [PythonCE] One other question: detecting SIP References: <9175562.post@talk.nabble.com> Message-ID: ----- Original Message ----- From: "Progor" To: Sent: Tuesday, February 27, 2007 2:15 PM Subject: [PythonCE] One other question: detecting SIP > > Is it possible to detect whether the SIP (software keyboard) is displayed > or > not? It would be nice to resize my main frame when the SIP is in the way. You need to do the following: 1. Allocate a SHACTIVATEINFO structure 2. When your main window receives a WM_SETTINGCHANGE message, call SHHandleWMSettingChange() passing the structure 3. When you receive WM_ACTIVATE, call SHHandleWMActivate() passing the same structure The resizing of your window will now be done for you. Luke class SHACTIVATEINFO(ctypes.Structure): _fields_ = [ ('cbSize', DWORD), ('hwndLastFocus', HWND), ('flags', UINT), ] def __init__(self): ctypes.Structure.__init__(self) self.cbSize = ctypes.sizeof(self) aygshell = ctypes.cdll.aygshell SHHandleWMSettingChange = aygshell[83] SHHandleWMSettingChange.argtypes = [ HWND, WPARAM, LPARAM, ctypes.POINTER(SHACTIVATEINFO) ] SHHandleWMSettingChange.restype = BOOLRESULT SHHandleWMActivate = aygshell[84] SHHandleWMActivate.argtypes = [ HWND, WPARAM, LPARAM, ctypes.POINTER(SHACTIVATEINFO), DWORD ] SHHandleWMActivate.restype = BOOLRESULT From dpwhittaker at gmail.com Tue Feb 27 17:27:59 2007 From: dpwhittaker at gmail.com (Progor) Date: Tue, 27 Feb 2007 08:27:59 -0800 (PST) Subject: [PythonCE] weird Tkinter In-Reply-To: <9178558.post@talk.nabble.com> References: <9173378.post@talk.nabble.com> <9178558.post@talk.nabble.com> Message-ID: <9185914.post@talk.nabble.com> I wish it were that easy. This process included 20-something soft resets, none of which were able to solve this problem. I am pretty new to python, so if you can help me understand why: import _tkinter import Tkinter works, but: import Tkinter alone doesn't work, then maybe we can find a solution to the whole problem. I assume import _tkinter is asking it to import the dll itself, and somehow the Tkinter package isn't making it that far. Ok. I made it a bit further. I found a Tkinter.py and Tkinter.pyc file in one of the threads on this topic a bit back and added them to my Lib directory. That did nothing, but then I renamed Tkinter.pyc in python25.zip/lib-tk to Tkinterold.pyc (Resco File Explorer ftw) so python would be sure to use the one in Lib, and finally, it works. Oddly enough, clicking on the .py version gives a could not find TCL DLL message (on the import _tkinter line), but clicking on the .pyc gives the little demo window. Even weirder, moving that .pyc file into the zip under lib-tk takes me back to the original problem (not finding TK DLL). Yes, I soft reset between every file move operation and test. Well, dangit, I must have gotten lucky on a soft reset here or there or still had the DLL loaded into memory from something else or... who knows... I'm still getting the "could not find TK DLL" message, with either version or location of Tkinter.pyc... most of the time. Bandung wrote: > > A soft reset is your friend. Do it and your python install/tkinter will > return to normal. I don't know why at times "stuff" happens but it does. > > > Progor wrote: >> >> So, I think I might have my install kinda borked. I finally got it >> working, but I had to jump through some hoops to make it work. >> >> First, I installed PythonCE with CABINSTL directly into /Python (I switch >> SD cards all the time, wanted it in main memory (for speed too), but with >> as few spaces as possible for command line stuff). >> >> Then, I tried just doing an import Tkinter from the console, but it gave >> me the notorious missing TK DLL message. >> >> So, I found the dlls (celib, tk84, tcl84) and put them in /Windows, but >> it still gave me the error. >> >> So, I played around with it a bit. I found out if I import _tkinter >> first, then it doesn't give me the message... but that's an extra line in >> all my programs and may be weird if I ever want to give out my programs. >> >> I kept looking around on this mailing list and finally figured out I >> needed to install tcl as well, did that, but I still have to import >> _tkinter before I can import Tkinter without getting the "Could not find >> TK DLL" error. >> >> It sounds like some people have gotten it to work on their systems >> without the weird "import _tkinter" extra line. Have I done something >> wrong? Or is Tkinter just that persnickity? >> > > -- View this message in context: http://www.nabble.com/weird-Tkinter-tf3297520.html#a9185914 Sent from the Python - pythonce mailing list archive at Nabble.com. From dpwhittaker at gmail.com Wed Feb 28 15:25:24 2007 From: dpwhittaker at gmail.com (Progor) Date: Wed, 28 Feb 2007 06:25:24 -0800 (PST) Subject: [PythonCE] weird Tkinter In-Reply-To: <9197668.post@talk.nabble.com> References: <9173378.post@talk.nabble.com> <9178558.post@talk.nabble.com> <9185914.post@talk.nabble.com> <9197668.post@talk.nabble.com> Message-ID: <9204694.post@talk.nabble.com> Hmmm, the only thing I'm not sure about is your (d) created a file which I call "pathextender.pth" file where I added all of the directories where my scripts are. In addition to adding all of my script directories (they are on storage cards), I then added the path to my python25\lib directory where my Tkinter.py and Tkinter.pyc resides. What is this pathextender.pth file, what format is it in, and how does python know what to do with it? Either way, I guess it's not that big of a deal. Adding import _tkinter doesn't seem to have any adverse effects, and it makes at least one machine more stable :) I'm almost finished making my Tkinter-based "almost native looking" App class. It's complete with no visible border or title bar, a menu at the bottom that leaves room for the SIP button, and a main frame that automatically resizes itself when the SIP appears. I just have to do a little bit more work to make it recognize hi-res devices and landscape orientation, and resize it's main frame and menus as needed. I may be reinventing a wheel, but I didn't find anything on this list like that. I'll post my files when I'm done. By the way, it's taking several seconds (5ish) to load my App (i.e. from the time the python interpreter appears to the time the GUI is displayed)... is that Tkinter taking so long, or should I look at some of my other imports and/or code? Bandung wrote: > > I've been through all of those permutations and combinations myself. What > I settled on was this; > > a) left the original python.zip file intact. that is to say, didn'tt > remove anything, didn't replace anything > b) added the latest Tkinter.py that I could find for python25 and placed > it in my Python2.5\lib directory. > c) clicked on the Tkinter.py file in my Lib directory to get it to create > a Tkinter.pyc If yours is anything like mine, it will not be the same > size as the one within python25.zip. This is good. Why? I don't know. > d) created a file which I call "pathextender.pth" file where I added all > of the directories where my scripts are. In addition to adding all of my > script directories (they are on storage cards), I then added the path to > my python25\lib directory where my Tkinter.py and Tkinter.pyc resides. > e) soft reset. > > Occasionally, I get that dll not found message. Particularly if the unit > goes into it's "hybernation" mode. Soft reset always brings it back. > Well on rare occasions, I have had to do numerous soft resets. (even > removed the battery one time and then did the "1 stylus salute" thingy) > > Assuming that your files are all in the correct place, soft reset should > work. My python is on the storage card. Don't know if that makes a > difference but someone else was struggling to get their install working > within main memory and it worked so... > > > > Progor wrote: >> >> I wish it were that easy. This process included 20-something soft >> resets, none of which were able to solve this problem. I am pretty new >> to python, so if you can help me understand why: >> >> import _tkinter >> import Tkinter >> >> works, but: >> >> import Tkinter >> >> alone doesn't work, then maybe we can find a solution to the whole >> problem. >> >> I assume import _tkinter is asking it to import the dll itself, and >> somehow the Tkinter package isn't making it that far. >> >> Ok. I made it a bit further. I found a Tkinter.py and Tkinter.pyc file >> in one of the threads on this topic a bit back and added them to my Lib >> directory. That did nothing, but then I renamed Tkinter.pyc in >> python25.zip/lib-tk to Tkinterold.pyc (Resco File Explorer ftw) so python >> would be sure to use the one in Lib, and finally, it works. Oddly >> enough, clicking on the .py version gives a could not find TCL DLL >> message (on the import _tkinter line), but clicking on the .pyc gives the >> little demo window. Even weirder, moving that .pyc file into the zip >> under lib-tk takes me back to the original problem (not finding TK DLL). >> Yes, I soft reset between every file move operation and test. >> >> Well, dangit, I must have gotten lucky on a soft reset here or there or >> still had the DLL loaded into memory from something else or... who >> knows... I'm still getting the "could not find TK DLL" message, with >> either version or location of Tkinter.pyc... most of the time. >> >> >> Bandung wrote: >>> >>> A soft reset is your friend. Do it and your python install/tkinter will >>> return to normal. I don't know why at times "stuff" happens but it >>> does. >>> >>> >>> Progor wrote: >>>> >>>> So, I think I might have my install kinda borked. I finally got it >>>> working, but I had to jump through some hoops to make it work. >>>> >>>> First, I installed PythonCE with CABINSTL directly into /Python (I >>>> switch SD cards all the time, wanted it in main memory (for speed too), >>>> but with as few spaces as possible for command line stuff). >>>> >>>> Then, I tried just doing an import Tkinter from the console, but it >>>> gave me the notorious missing TK DLL message. >>>> >>>> So, I found the dlls (celib, tk84, tcl84) and put them in /Windows, but >>>> it still gave me the error. >>>> >>>> So, I played around with it a bit. I found out if I import _tkinter >>>> first, then it doesn't give me the message... but that's an extra line >>>> in all my programs and may be weird if I ever want to give out my >>>> programs. >>>> >>>> I kept looking around on this mailing list and finally figured out I >>>> needed to install tcl as well, did that, but I still have to import >>>> _tkinter before I can import Tkinter without getting the "Could not >>>> find TK DLL" error. >>>> >>>> It sounds like some people have gotten it to work on their systems >>>> without the weird "import _tkinter" extra line. Have I done something >>>> wrong? Or is Tkinter just that persnickity? >>>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/weird-Tkinter-tf3297520.html#a9204694 Sent from the Python - pythonce mailing list archive at Nabble.com. From dpwhittaker at gmail.com Wed Feb 28 15:39:55 2007 From: dpwhittaker at gmail.com (Progor) Date: Wed, 28 Feb 2007 06:39:55 -0800 (PST) Subject: [PythonCE] One other question: detecting SIP In-Reply-To: References: <9175562.post@talk.nabble.com> Message-ID: <9204772.post@talk.nabble.com> Ah, thanks, you got me pointed in the right direction anyway. I'm using Tkinter, and as far as I can tell it's protocol method doesn't give you access to the param's, but with this pointer in the direction of API calls I was able to: 1. Allocate a SIPINFO structure. 2. Set up a polling loop that calls GetSipInfo 3. Manually resize my main frame if anything in rcVisibleDesktop changes. I'm really just looking at rcVisibleDesktop.bottom right now, but I'm going to buff it up a bit and check the rest of the parameters as well, soon, in order to better accomodate different orientations and hi-res devices. One thing I did notice was that when the SIP is up, the bottom parameter gives you the top of the SIP... which is great, but when the SIP is down, it gives you the bottom of the menu bar, so right now it looks like I have to special case it to accomodate hi-res devices and still leave room for a menu bar at the bottom. I'll figure it all out and post a nice, elegant solution in Tkinter pretty soon, I hope. Luke Dunstan wrote: > > > ----- Original Message ----- > From: "Progor" > To: > Sent: Tuesday, February 27, 2007 2:15 PM > Subject: [PythonCE] One other question: detecting SIP > > >> >> Is it possible to detect whether the SIP (software keyboard) is displayed >> or >> not? It would be nice to resize my main frame when the SIP is in the >> way. > > You need to do the following: > > 1. Allocate a SHACTIVATEINFO structure > 2. When your main window receives a WM_SETTINGCHANGE message, call > SHHandleWMSettingChange() passing the structure > 3. When you receive WM_ACTIVATE, call SHHandleWMActivate() passing the > same > structure > > The resizing of your window will now be done for you. > > Luke > > class SHACTIVATEINFO(ctypes.Structure): > _fields_ = [ > ('cbSize', DWORD), > ('hwndLastFocus', HWND), > ('flags', UINT), > ] > > def __init__(self): > ctypes.Structure.__init__(self) > self.cbSize = ctypes.sizeof(self) > > aygshell = ctypes.cdll.aygshell > > SHHandleWMSettingChange = aygshell[83] > SHHandleWMSettingChange.argtypes = [ HWND, WPARAM, LPARAM, > ctypes.POINTER(SHACTIVATEINFO) ] > SHHandleWMSettingChange.restype = BOOLRESULT > > SHHandleWMActivate = aygshell[84] > SHHandleWMActivate.argtypes = [ HWND, WPARAM, LPARAM, > ctypes.POINTER(SHACTIVATEINFO), DWORD ] > SHHandleWMActivate.restype = BOOLRESULT > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > -- View this message in context: http://www.nabble.com/One-other-question%3A-detecting-SIP-tf3298456.html#a9204772 Sent from the Python - pythonce mailing list archive at Nabble.com. From sleepingbull at gmail.com Wed Feb 28 22:15:58 2007 From: sleepingbull at gmail.com (Matt S.) Date: Wed, 28 Feb 2007 13:15:58 -0800 Subject: [PythonCE] a wxPython script that behaves like a CE application Message-ID: Hi, So I now thankfully have a simple wxPython script that creates a frame, etc... Now I want it to act like a well-behaved CE application. Ultimately, I'd like to post it to the wiki (at least as a hack). Hope the formatting in this email comes through alright! Any help is greatly appreciated. >From what I've learned recently, I want the script to: 1. start up the program without a shell, [see "\nopcceshell" registry arg] 2. and a simple tap on a unique icon for the program from the Start > Programs menu, Task bar, or File Explorer, etc. [make a shortcut in "\Windows\Start Menu\Programs"] 3. be minimized by the Smart Close button [no problem here] 4. then be uniquely iconized to the Start/Task Menu [sort of accomplished by #2] 5. and finally be brought forward again (maximized) when either the user again clicks on the Task menu (or any other shortcut to the script) [use win32gui.SetForegroundWindow(hwnd)] 6. (for now, trying to keep it simple, I'm not going to worry about the hibernation, memory events that could cause spurious problems) [wxEVT_ACTIVATE, etc.] I'm attaching the following script which almost accomplishes (5). How to accomplish (1-4) can be pieced together elsewhere. The main problem the script now has are: - if "\nopcceshell" is used, the busy clock persists [previous post but in example] but the running script is brought forward as expected. - if the pcceshell is used, and one calls [_pcceshell_support.Busy(0)], then the call on line 31, [frame_class = win32gui.GetClassName(frame.GetHandle())], returns the PythonCE shell and not the frame of the script. Best regards, Matt PS: In case the attachment gets scrubbed, simple_ce.py: import sys #, os, os.path, time > import win32gui > > window_handle_file = 'window_handle.txt' > > def buildUI(window_handle_file): > # Write a file to save the window handle info > f = open(window_handle_file, 'wb') > > # Start building the interface... > import wx > > class SingleAppFrame(wx.Frame): > def __init__(self,parent,id,title): > wx.Frame.__init__(self,parent,-1, title, size = ( 300, 300)) > self.Centre() > > class SingleApp(wx.App): > def OnInit(self): > ## Not implemented for PPC? > # name = "SingleApp-%s" % (wx.GetUserId()) > ## self.name = "SingleApp-%s" % (wx.GetUserId()) > # self.instance = wx.SingleInstanceChecker(name) > # if self.instance.IsAnotherRunning(): > # wx.MessageBox("Another instance is running", "ERROR") > # return False > frame = SingleAppFrame(None, -1, "SingleApp") > > frame.Show() > # Now get the window handle of the frame. > frame_class = win32gui.GetClassName(frame.GetHandle()) > print frame_class > active_window = frame.GetHandle() > f.write(str(active_window)) > f.close() > return True > > app = SingleApp(redirect=False) > app.MainLoop() > > > if sys.platform == 'win32': > pass > elif sys.platform == 'Pocket PC': > # This gets rid of annoying pin/progress wheel. ala Luke. > try: > import _pcceshell_support > except ImportError: > pass > else: > _pcceshell_support.Busy(0) > else: > print 'This operating system (%s) is not recognized.'%(sys.platform) > > try: > f = open(window_handle_file, 'rb') > #f.write('win32gui\n') > #SW_MAXIMIZE > #win32gui.GetClassName(frame.GetHandle()) > if sys.platform == 'win32': > # If Window is minimized, this will maximize it. > window = win32gui.FindWindow('wxWindowClassNR', 'SingleApp') > window = win32gui.SetForegroundWindow(window)#'SW_MAXIMIZE') > # window = win32gui.ShowWindow(window, 1)#'SW_MAXIMIZE')# This > doesn't set the window to the foreground. > print window > else: > ########################################## > # Unfortunately, when I use the following to bring the > # frame forward, I instead get the pcceshell (labeled PythonCE) > shell. > # If I don't use the pcceshell, by altering the registry with, > # \nopcceshell, > # Then I get the busy clock and the frame window that I want! > ########################################## > hwnd = int(f.readline()) > print hwnd > window = win32gui.SetForegroundWindow(hwnd)#'SW_MAXIMIZE') > > ## Just other options but not exactly what I wanted. > #window = win32gui.SetForegroundWindow(window)#'SW_MAXIMIZE') > > #window = win32gui.FindWindow('PythonClassNameNR', 'SingleApp') > #window = win32gui.ShowWindow(hwnd, 1)#window, 1)#'SW_MAXIMIZE') > #win32gui.SetActiveWindow(hwnd)#window, 1)#'SW_MAXIMIZE') > > # Now, if the window was successfully shown, we'll be done here. > # Otherwise, fire up the app... > if window == 0: # Will be zero if window not brought to foreground. > 'No window available, re-starting app' > else: > print 'The app should be visible!' > except: > > buildUI(window_handle_file) > On 2/26/07, Matt S. wrote: > > > Regarding new info I have about solving this problem, > > I'm thinking I either need to implement a WindowProc function that > processes messages sent to the window, > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windowprocedures/windowprocedurereference/windowprocedurefunctions/windowproc.asp > > or, hope that the WS_NONAVDONEBUTTON gets supported by wx and then ported > to the PPC (or learn to compile, etc. myself), > > http://msdn2.microsoft.com/en-us/library/aa458799.aspx > > > > On 2/23/07, Luke Dunstan wrote: > > > > As with any Pocket PC application (written in Python or otherwise), the > > X "close" button merely hides a window and does not destroy it. The Pocket > > PC platform is intended so that users don't need to "close" applications as > > such, and if you open enough other applications that the memory starts to > > become full, the OS will actually close (WM_CLOSE) some of the applications > > that were hidden in the background. If you try clicking the X button on > > any of the Microsoft's Pocket PC applications, e.g. Pocket Word, and > > then look in the task manager you will notice that it is still running. > > > > You may be able to capture the event as WM_SHOWWINDOW. > > > > As with any Python program on the PC, your script is not a process but > > is just a text file that is interpreted by the python.exe process. > > > > Luke > > > > > > ----- Original Message ----- > > *From:* Matt S. > > *To:* pythonce at python.org > > *Sent:* Thursday, February 22, 2007 2:12 PM > > *Subject:* [PythonCE] wxPython, handling close events > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20070228/412eb4a2/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: simple_ce.py Type: text/x-python Size: 3462 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20070228/412eb4a2/attachment-0001.py