[PythonCE] graphical libs for pocket pc

Isr Gish isrgish at fastem.com
Thu Sep 9 12:54:12 CEST 2004


Hi Michale,

   >From: "Michael Foord"<mike at pcblokes.com>
   >Sent: 9/9/04 6:30:54 AM
   >To: "Isr Gish"<isrgish at fastem.com>, "jaderholm at gmail.com"<jaderholm at gmail.com>
   >Cc: "pythonce at python.org"<pythonce at python.org>
   >Subject: Re: [PythonCE] graphical libs for pocket pc
     >
   >----- Original Message -----
   >From: "Isr Gish" <isrgish at fastem.com>
   >To: <mike at pcblokes.com>; <jaderholm at gmail.com>
   >Cc: <pythonce at python.org>
   >Sent: Thursday, September 09, 2004 12:19 AM
   >Subject: Re: [PythonCE] graphical libs for pocket pc
   >
   >
   >>
   >>    >From: "Voidspace"<mike at pcblokes.com>
   >>    >Sent: 9/8/04 5:20:07 AM
   >>    >To: "Scott Jaderholm"<jaderholm at gmail.com>
   >>    >Cc: "pythonce at python.org"<pythonce at python.org>
   >>    >Subject: Re: [PythonCE] graphical libs for pocket pc
   >>    >
   >>
   >>    >There are a
   >>    >*few* differences due to differences in the underlying C libraries
   >that
   >>    >are specific to the PocketPC, e.g. raw_input doesn't work which makes
   >>    >interaction with the user virtually impossible unless you use Tkinter
   >or
   >>    >something 'similar'.
   >>
   >> I think it should be possible to do a patch for that. What seems to be
   >needed is a "readline" function for the shell. With that function the input
   >functions should work fine.
   >>
   >> In previous versions there was such a readline function in the
   >pcceshell.py module. But it seems to have been removed in the latest
   >version.
   >>
   >> I think it should be possible to implement it again. What was actually
   >used, was the readline with another function that was automatically called
   >(I guess by windows) for each character that was typed into the shell. I
   >think this function was called "onEditChr" or something like that.
   >>
   >> If someone is interested you can find these functions in the pcceshell.py,
   >or in the newer pcceshell package in the simpleshell.py module.
   >> I attach the pcceshell in a zip file, for anyone who is interested to look
   >at it. I hope the list will let it through.
   >>
   >> I would love to do this myself, but I have zero experience and almost the
   >same amount of knowledge in this area. What I do know is *only* from looking
   >a the source code for version 2.3.4 (found at
   >http://www.validus.com/~kashtan
   >>  ) and at the pcceshell files.
   >>
   >> All the best,
   >> Isr
   >>
   >
   >The problem that David kashtan identified was that the previous versions of
   >pcceshell that allowed raw_input relied on C code (by Telion I think) that
   >has since been lost. So just using the modified versions of pcceshell isn't
   >sufficient and David doesn't feel up to reimplementing the missing C.

I don't think it relied on any C code besides the win32 pyd's (which are dll's), and these are still available.
If you take a look at the old pcceshell.py (please find it attached), at the 2 functions, 'readline' and 'OnEditChar' you will see how it was done, and that it isn't relying on C code.

What it's doing is that the readline is called auto matticaly when you use the input functions. And this sets some kind of wait function to wait on input.  OnEditChar gets automatically called whenever a key is typed to the shell window (this may only be true in the old shell that was a class, I'm not sure about this.). So there is a instance variable of shell called reading that collects each letter typed, and when <enter> is typed it sends a message to the event that is waiting to stop waiting. After that the readline function fiishes and returns tae data from the reading variable.

I hope this will help in the matter. If you have any more qustions please feel free to ask.

P.S. I reacntly tried to make a crude  function to get input, using a simmelar approch.

>>> import _pcceshell_support, sys
>>> def f():
... 	z = _pcceshell_support.Wait()
... 	if z == 1:
... 		a = _pcceshell_support.Get_Edit_Window_Line(-1)
... 		sys.stdout.write('\n')
... 		return a[4:]
... 
>>> s = f()

>>> hello
>>> print s
hello
>>> 
To use this, after running the f function, you need to firs press enter and then first type the input.

All the best,
Isr
   >
   >Regards,
   >
   >Fuzzy
   >
   >http://www.voidspace.otg.uk/atlantibots/pythonutils.html
   >
   >>    >Regards,
   >>    >
   >>    >Fuzzy
   >>    >
   >>    >http://www.voidspace.org.uk/atlantibots/pythonutils.html
   >>    >
   >>    >
   >>    >
   >>    >>Has anyone written PocketPC apps w/ python? Any screenshots?
   >>    >>
   >>    >>Thanks,
   >>    >>_______________________________________________
   >>    >>PythonCE mailing list
   >>    >>PythonCE at python.org
   >>    >>http://mail.python.org/mailman/listinfo/pythonce
   >>    >>
   >>    >>
   >>    >>
   >>    >>
   >>    >>
   >>    >
   >>    >--
   >>    >
   >>    >http://www.Voidspace.org.uk
   >>    >The Place where headspace meets cyberspace. Online resource site -
   >covering science, technology, computing, cyberpunk, psychology,
   >spirituality, fiction and more.
   >>    >
   >>    >---
   >>    >http://www.Voidspace.org.uk/atlantibots/pythonutils.html
   >>    >Python utilities, modules and apps.
   >>    >Including Nanagram, Dirwatcher and more.
   >>    >---
   >>    >http://www.fuchsiashockz.co.uk
   >>    >http://groups.yahoo.com/group/void-shockz
   >>    >---
   >>    >
   >>    >Everyone has talent. What is rare is the courage to follow talent
   >>    > to the dark place where it leads. -Erica Jong
   >>    >Ambition is a poor excuse for not having sense enough to be lazy.
   >>    >         -Milan Kundera
   >>    >
   >>    >
   >>    >
   >>    >_______________________________________________
   >>    >PythonCE mailing list
   >>    >PythonCE at python.org
   >>    >http://mail.python.org/mailman/listinfo/pythonce
   >>
   >>
   >>
   >
   >
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcceshell.zip
Type: application/octet-stream
Size: 10277 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonce/attachments/20040909/59c7b478/pcceshell-0001.obj


More information about the PythonCE mailing list