You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(116) |
Sep
(146) |
Oct
(78) |
Nov
(69) |
Dec
(70) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(188) |
Feb
(142) |
Mar
(143) |
Apr
(131) |
May
(97) |
Jun
(221) |
Jul
(127) |
Aug
(89) |
Sep
(83) |
Oct
(66) |
Nov
(47) |
Dec
(70) |
2003 |
Jan
(77) |
Feb
(91) |
Mar
(103) |
Apr
(98) |
May
(134) |
Jun
(47) |
Jul
(74) |
Aug
(71) |
Sep
(48) |
Oct
(23) |
Nov
(37) |
Dec
(13) |
2004 |
Jan
(24) |
Feb
(15) |
Mar
(52) |
Apr
(119) |
May
(49) |
Jun
(41) |
Jul
(34) |
Aug
(91) |
Sep
(169) |
Oct
(38) |
Nov
(32) |
Dec
(47) |
2005 |
Jan
(61) |
Feb
(47) |
Mar
(101) |
Apr
(130) |
May
(51) |
Jun
(65) |
Jul
(71) |
Aug
(96) |
Sep
(28) |
Oct
(20) |
Nov
(39) |
Dec
(62) |
2006 |
Jan
(13) |
Feb
(19) |
Mar
(18) |
Apr
(34) |
May
(39) |
Jun
(50) |
Jul
(63) |
Aug
(18) |
Sep
(37) |
Oct
(14) |
Nov
(56) |
Dec
(32) |
2007 |
Jan
(30) |
Feb
(13) |
Mar
(25) |
Apr
(3) |
May
(15) |
Jun
(42) |
Jul
(5) |
Aug
(17) |
Sep
(6) |
Oct
(25) |
Nov
(49) |
Dec
(10) |
2008 |
Jan
(12) |
Feb
|
Mar
(17) |
Apr
(18) |
May
(12) |
Jun
(2) |
Jul
(2) |
Aug
(6) |
Sep
(4) |
Oct
(15) |
Nov
(45) |
Dec
(9) |
2009 |
Jan
(1) |
Feb
(3) |
Mar
(18) |
Apr
(8) |
May
(3) |
Jun
|
Jul
(13) |
Aug
(2) |
Sep
(1) |
Oct
(9) |
Nov
(13) |
Dec
|
2010 |
Jan
(2) |
Feb
(3) |
Mar
(9) |
Apr
(10) |
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(4) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(44) |
May
(9) |
Jun
(22) |
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(3) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kevin A. <al...@se...> - 2005-03-08 18:56:32
|
I will be taking care of the backlog of messages that either never got a response or that I feel need a bit more explanation over the next two weeks as I gear up for Pycon. This will result in an abnormally large amount of emails for this list in a short period of time, but once I'm through the backlog the list should calm down again. ka |
From: Kevin A. <al...@se...> - 2005-03-08 18:53:44
|
On Dec 14, 2004, at 11:14 AM, bri...@sy... wrote: > > Kevin asked for input about a logo earlier this year. Of course, if > you > don't have a logo to submit, there > isn't much to input. Being that PythonCard isn't really about cards > (other > than Hypercard), I can't think of > a suitable logo. Be nice if it also looked good as a program icon. > > The consensus among my users is that the python icon (py.ico) is as > cute > as a bug, so how to top that? > I've always liked the Europython logo as a possible PythonCard logo, but its already taken :( Maybe without the Euro stars and some other tweaks it could be suitable for us. http://www.europython.org/logo.jpg People are free to make submissions for a logo and if there is overwhelming positive response we can adopt one of the submissions. ka |
From: Kevin A. <al...@se...> - 2005-03-08 18:47:08
|
On Mar 5, 2005, at 3:58 AM, Liam Clarke wrote: > Hi all, > > Is there a way to call setFocus on the window when it opens? > > I have 3 windows - > > Main > | > ChildA > | > ChildB > > ChildA opens ChildB, assigns Main as the parent of ChildB and then > closes itself. This is fine except Main is now in the foreground, and > B behind it.... > > I tried self.backgrounds['bgTemplate'].setFocus(), but that doesn't > work, > I'm currently using > > def on_initialize(self, event): > self.components[self.components.keys()[0]].setFocus() > > in ChildB. > > This works, but it seems a bit hacky, and I get a flicker as Main > moves to the front, and then B does, which is distracting. > > There's probably something very obvious I'm missing, there usually is, > but any help would be appreciated. I used findfiles.py and all the > returns for 'focus' related to findFocus and setFocus being called on > widgets. > > > Regards, > > > Liam Clarke > I think the method you're looking for is the wxPython one, Raise(), which brings a "top-level" window to the front. So something like this in your main code... self.childB.Raise() ka |
From: Kevin A. <al...@se...> - 2005-03-08 18:43:09
|
Does anyone else running Linux have this problem? I have no way of =20 testing this or trying to resolve it myself since I only run Windows =20 and Mac OS X. If there is no response here, please bring it up on =20 wxPython-users and cc this list. http://www.wxpython.org/maillist.php ka On Feb 25, 2005, at 7:32 AM, Paulo S=E9rgio wrote: > Hi, i have an wxPython application running on windows perfectly, but > when i > tried to run it on linux (debian) it gave the following error: > > Traceback (most recent call last): > File "confServ.py", line 88, in ? > app =3D model.Application(CConfServ) > File "/usr/lib/python2.3/site-packages/PythonCard/model.py", line =20= > 365, in > __init__ > wx.App.__init__(self, 0) > File =20 > "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", > line 5311, in __init__ > self._BootstrapApp() > File =20 > "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/_core.py", > line 4990, in _BootstrapApp > return _core_.PyApp__BootstrapApp(*args, **kwargs) > File "/usr/lib/python2.3/site-packages/PythonCard/model.py", line =20= > 417, in > OnInit > self._initBackgrounds(self.resource) > File "/usr/lib/python2.3/site-packages/PythonCard/model.py", line =20= > 410, in > _initBackgrounds > bg =3D self.frameClass(None, bgRsrc) > File "/usr/lib/python2.3/site-packages/PythonCard/model.py", line =20= > 626, in > __init__ > aBgRsrc.name) > File > "/usr/lib/python2.3/site-packages/wx-2.5.3-gtk2-unicode/wx/=20 > _windows.py", > line 408, in __init__ > newobj =3D _windows_.new_Frame(*args, **kwargs) > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position =20= > 21: > ordinal not in range(128) > > On windows i had a similarly problem with coding but the statement # =20= > "#-*- > coding: cp1252 -*-" resolved the problem. > > Thanks in advance, > Paulo S=E9rgio. |
From: Kevin A. <al...@se...> - 2005-03-08 18:29:18
|
On Mar 4, 2005, at 11:00 AM, Bo Green wrote: > > I have been trying to piece together how to do a sizer in a > CustomDialog. So far it doesn't work. If I leave the resource button > positions as is, the buttons always appear there. If I comment out the > resource button positions, the buttons end up both in the top left > corner of the dialog, on top of each other. Here is the dialog's > __init__ method in its current state (I've tried many variations of > the same code). Part of the problem is my lack of understanding of the > sizer methods, but possibly also how to add the components of the > dialog to the sizer. > > def _init_(self, mainBG): > "Initialise the project dialog" > model.CustomDialog.__init__(self, mainBG) > self.parent = mainBG > sizer = wx.BoxSizer(wx.VERTICAL) > sizer.Add(self.components.buttonCreate,flag=wx.GROW) > sizer.Add(self.components.buttonOpen,flag=wx.GROW) > sizer.Fit(self) > self.SetSizer(sizer) > self.SetAutoLayout(true) > self.Layout() > Thanks for any help. > Bo > There are a number of potential problems here. One, you need to be setting the sizer with self.panel, not just self. The panel is what all the components actually sit on and the panel sits in the frame. Yes this is one of those things that would be nice to completely hide, which is what the Background sort of does, but it gets exposed when you do the raw wxPython stuff like sizers. sizer.Fit(self) sizer.SetSizeHints(self) # you might need this line, not sure self.panel.SetSizer(sizer) self.panel.SetAutoLayout(True) self.panel.Layout() The other problem is that I don't think you mean to use the wx.GROW flag like that, but maybe that's okay. I only do sizers periodically, they make my head hurt, and then I don't do them again for a while, so I could be wrong ;-) There is a fairly complicated CustomDialog that uses a sizer in PythonCard/templates/dialogs/runOptionsDialog.py which is used by the codeEditor and resourceEditor. ka |
From: Brian D. <deb...@ho...> - 2005-03-08 18:26:22
|
Hi, This is the old e-mail, hope this helps. Regards, Brian ------------------------------------------- message-------------------------------------------------- Which version of py2exe are you running? The "pygame setup.py" script says py2exe-0.3.1 but the latest version is 0.5 and 0.5 won't even run the "pygame setup.py" script. Anyway, I took the minimalStandalone setup.py script and modified it as follows... setup.py: from distutils.core import setup import py2exe setup( name = "Discretas", console = ["Discretas.py"], data_files = [ (".", ["Discretas.rsrc.py", "Graficos.rsrc.py"]) ] ) # should probably copy the Data dir as well... Then I modified the Discretas.py file by adding an import os call and changing on_openBackground to build an explicit path for Graficos.rsrc.py. I don't remember offhand why the module resource file can't be found in library.zip with py2exe. I thought we had found a workaround for that, but it is late and I'll have to discuss that with Thomas to be sure, so my bad on that issue. Anyway, providing an explicit path in the old-style still works assuming the .rsrc.py files are copied to the dist directory. Discretas.py: <snippet> import os class Principal(model.Background): def on_openBackground(self, event): path = os.path.join(self.stack.app.applicationDirectory, \ model.internationalResourceName('Graficos')) self.dibujo = model.childWindow(self, Graficos.Grafico, path) #self.dibujo = model.childWindow(self, Graficos.Grafico) self.dibujo.setPosition((200,50)) I ran the following line to build the exe... python setup.py py2exe --excludes=Image I manually copied the Data dir into the dist directory. The Discretas.exe file starts up fine without errors. ka _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |
From: Kevin A. <al...@se...> - 2005-03-08 18:19:08
|
On Mar 8, 2005, at 8:32 AM, Brian Debuire wrote: > Hi there, > > I have asked this before, but I hope anyone has the answer by now. > > How do I compile and app with child windows??? > > Kevin Altis gave me a fix because of a path problem on the child > windows, but this should be fixed with the 1.0 release of Python Card. > > Should I do this manual fix again??? > > Regards, > > Brian > You'll have to refresh my memory on the problem and fix, I didn't find the earlier reference in email. ka |
From: Kevin A. <al...@se...> - 2005-03-08 18:15:32
|
On Jan 6, 2005, at 3:07 PM, Chad Crabtree wrote: > Have anchors been/started on implemnted? I'm just curious becuase I > think that is something that I can contribute. > There is no support for anchors or sizers in the framework or resourceEditor at this time, but as the samples and tools show you can just use plain wxPython code in your applications to get the functionality if needed. Did you have some ideas for wrapping anchors to simplify their usage as well as how they would be handled in the resourceEditor? ka |
From: Kevin A. <al...@se...> - 2005-03-08 18:13:18
|
On Jan 6, 2005, at 9:04 AM, Brian Debuire wrote: > Hi everyone, > > I have a problem, well my app has child windows and each one has the > validation on closing like this: > > def on_close(self, event): > self.Show(0) > > but when I close any child window by clicking on the close window [X] > icon all the app shuts down. > > I dont know why this happens, and I dont this this happened before to > me. > > Thanks in advance, > > Brian > > PD: > > I am using PythonCard 0.8 and Python 2.3 on windows. > I just verified that an on_close handler works as expected on Windows and Mac using release 0.8.1. If event.skip() isn't called then the window isn't closed and calling event.skip(), most likely on your main application window allows the application to close normally after any other on_close handler code you want to do. ka |
From: Brian D. <deb...@ho...> - 2005-03-08 16:32:29
|
Hi there, I have asked this before, but I hope anyone has the answer by now. How do I compile and app with child windows??? Kevin Altis gave me a fix because of a path problem on the child windows, but this should be fixed with the 1.0 release of Python Card. Should I do this manual fix again??? Regards, Brian _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |
From: Kevin A. <al...@se...> - 2005-03-08 01:09:09
|
If you will be attending Pycon, Python UK, or OSCON this year, please add your name to the PythonCard conferences wiki page. http://wiki.wxpython.org/index.cgi/PythonCardConferences I will be attending and doing a presentation on PythonCard at each of those conferences. I would also like to do one or more Open Spaces or evening Birds of a Feather (BoF) sessions depending on interest and how many people are attending. At Pycon, I only have 30 minutes for the presentation, so almost the entire presentation will be building an application from scratch with minimal intro and closing slides and comments. I can go into more depth during an Open Space session or help people that want to start working on their own applications. I will not be arriving until Tuesday evening, so I will miss the sprints prior to Pycon. ka |
From: Peter C. N. <spa...@le...> - 2005-03-07 19:31:01
|
On Mon, Mar 07, 2005 at 11:29:17AM -0800, Kevin Altis wrote: > On Mar 6, 2005, at 2:42 PM, Peter C. Norton wrote: > > >Here is an installer built with python 2.4: > > > >http://spacey.org/Members/spacey/PythonCard-0.8.1-python2.4- > >pn.win32.exe/download > > > >Please let me know if this works with python2.3! > > > >-Peter > > > > It died during the install-pythoncard.py phase when I tried installing > with Python 2.3. just like the current .exe installer dies with Python > 2.4. So, the PythonCard package installs fine, it just doesn't do the > programs group and links for the Start menu. Bummer. > Since Thomas Heller wrote this script, I'm going to cc him and sees if > he knows how to incorporate it into our existing setup.py script as > well as make it work with both Python 2.3 and Python 2.4 so we can have > a single .exe installer instead of having to have one for 2.3 and > another for 2.4 which would be a real drag. Hoping... -Peter -- The 5 year plan: In five years we'll make up another plan. Or just re-use this one. |
From: Kevin A. <al...@se...> - 2005-03-07 19:29:24
|
On Mar 6, 2005, at 2:42 PM, Peter C. Norton wrote: > Here is an installer built with python 2.4: > > http://spacey.org/Members/spacey/PythonCard-0.8.1-python2.4- > pn.win32.exe/download > > Please let me know if this works with python2.3! > > -Peter > It died during the install-pythoncard.py phase when I tried installing with Python 2.3. just like the current .exe installer dies with Python 2.4. So, the PythonCard package installs fine, it just doesn't do the programs group and links for the Start menu. Since Thomas Heller wrote this script, I'm going to cc him and sees if he knows how to incorporate it into our existing setup.py script as well as make it work with both Python 2.3 and Python 2.4 so we can have a single .exe installer instead of having to have one for 2.3 and another for 2.4 which would be a real drag. ka |
From: Kevin A. <al...@se...> - 2005-03-07 01:39:49
|
I hope Andy's answer below gave you the info you needed. If you just want to call a short script and get a result then calling it from within a handler is probably the right thing to do. However, the application will be unresponsive until the handler finishes. For longer tasks you probably want to start a separate thread for the script. There are examples of using threads in the PythonCard samples. If you need a script to run continuously and communicate with your GUI and let each stay responsive then again you probably want to use a thread and probably pass data back and forth between the threads using the Queue module. Again, there are a number of samples that do this, so just use the findfiles tool to search for Queue in the samples. http://docs.python.org/lib/module-Queue.html http://docs.python.org/lib/module-threading.html I would like to hear more about your project, it sounds fun. Is there any info up on the web...? ka On Jan 24, 2005, at 2:20 AM, Andy Todd wrote: > Dr. Brooks wrote: >> Mr. Todd >> Thank you for your interest . >> While preparing an email in reply to your request for more information >> I launched the PythonCard script from the Pythonwin 2.3.2 interface >> and the PythonVideo image window opened. I have since changed my >> default python launching program to Pythonw (from python 2.3.4) and >> all works well. >> However I do have another question. >> What I am trying to do is have a user interface to a modified >> Evolutions ER1 robot. This interface accepts voice input from Dragon >> Speak NatLink and opens a TCP IP socket and RS232 Com port to my >> robot. It also allows to user to issue commands to the robot's >> Behavior program (a python script). I would like to have the robot's >> behavior program run and send and receive input from the user >> interface. Unfortunately I do not understand the method by which the >> PythonCard GUI communications with other modules. Can I have my my >> behavior program run and communicate with the TextArea of the GUI? >> Can the Behavior Module Call elements of the GUI ? >> It seems that the GUI runs in a loop and thus prevents the Behavior >> Module from executing in parallel. A pointer to an example or >> tutorial would be greatly appreciated. >> Again Thank for Your Interest >> On Mon, 03 Jan 2005 11:06:35 +1100, Andy Todd <an...@ha...> >> wrote: > [snip] >>> > > The answer is a qualified 'depends'. Yes, PythonCard (well, actually > wxPython) executes in a loop and is essentially the controlling > process whenever it runs. > > What you can do, though is import your behaviour program and call it > from your PythonCard application, e.g. > > import myProgram > > class MyApp(model.background): > > def on_<component>_<event name>(self, event): > myProgram.do_something() > > etc ... > > Where it may be troublesome is if your application is asynchronous. > This means that you ask it to do something and then have to keep > checking if it has finished. If that is the case then the > documentation on Timers and Threads may be useful to you; > > http://pythoncard.sourceforge.net/timers-threads.html > > If any of your calls are synchronous (i.e. return control to > PythonCard when they have finished) then writing the program is > easier. Just included in your PythonCard program anything that you > would normally type at the Python prompt. > > I've cc'ed this message to the PythonCard users list as you will > always get good feedback from the good people there. They will > generally be more prompt in answering your questions, as you can see I > get round to my email in fits and starts and your chances of a useful > and timely reply increase with the number of people who see it. > > Regards, > Andy |
From: Kevin A. <al...@se...> - 2005-03-07 00:21:51
|
This issue was brought up on a thread or two due to an out-of-date walkthrough. The use of select in this case is not encouraged becasue PythonCard has a built-in command menu handler to deal with exiting the application so you don't need a handler in your code. Instead, the command 'exit' is associated with the menu item used. Pretty much all the samples and tools have something like the following in their resource files and no exit handler in the user code. { 'type':'MenuItem', 'name':'menuFileExit', 'label':'E&xit\tAlt+X', 'command':'exit' } ] } So, the short story is that if you use the resource editor templates you don't need your own exit handler. If you are wanting to prompt the user before exiting, such as for saving files, you should probably put that code in an on_close handler. The relevant code for dealing with all of this is in model.py but don't worry about it unless you like looking at guts ;-) # KEA 2002-05-02 # always create at least a File menu with Quit on the Mac # so we automatically get the Apple menu... def _createMacMenu(self): mnu = wx.Menu() id = wx.NewId() mnu.Append(id, 'E&xit\tAlt+X') menubar = self.GetMenuBar() if menubar is None: menubar = wx.MenuBar() self.SetMenuBar(menubar) menubar.Append(mnu, 'File') wx.EVT_MENU(self, id, self.on_exit_command) def exit(self): """Exit the application by calling close() on the main application window.""" # regardless of whether this is a child window # or primary window of the application, this should # give us the right window to close to quit the application appWindow = self.application.getCurrentBackground() appWindow.close() def on_exit_command(self, evt): self.exit() ka |
From: Peter C. N. <sp...@le...> - 2005-03-06 22:42:51
|
Here is an installer built with python 2.4: http://spacey.org/Members/spacey/PythonCard-0.8.1-python2.4-pn.win32.exe/download Please let me know if this works with python2.3! -Peter -- The 5 year plan: In five years we'll make up another plan. Or just re-use this one. |
From: Kevin A. <al...@se...> - 2005-03-05 13:47:04
|
I will be there and PythonCard is one of the projects we will be working on. See the message below for full details. ka ---------------------------- Original Message ---------------------------- Subject: XP / Python Code Sprint 4/9-10 in Portland, Oregon From: "Arlo Belshee" <a_...@ar...> Date: Fri, February 25, 2005 12:23 pm To: pyt...@py... po...@po... sea...@li... ext...@ya... xpp...@ya... ------------------------------------------------------------------------ -- XPDX will be hosting a code sprint on April 9-10, 2005 in downtown Portland, Oregon. A code sprint is a gathering of a bunch of programmers to complete a short, rapid development project. It allows developers from different companies to work together and learn from each other. It's also a fun weekend where we can make some impressive advances in interesting projects. This code sprint will be focused on two things: Extreme Programming and Python. Come pair with long-time XPers to learn from their experience. Or, pair with people from other backgrounds to get a fresh look at your own practices. We are focusing on Python because it is a new language to many in XPDX, and one that works well with XP. Also, Python integrates tightly with other common XP languages, allowing us to easily blend in XP work in a number of different areas. Currently, people have expressed interest in the following languages. * Pure Python. * Python and C++, via boost.org's boost::python interoperability template library. * Python and Java, via Jython. * Python and .Net, via Iron Python. * And probably some Smalltalk, just because. This is not a pure Python sprint. Please feel free to come if you've never even heard of the language. Many of us will be learning it this weekend. Also, if you have no interest in Python, come anyway. There will be a lot of work in Java and C++, and a smattering of other options. We are organizing this sprint via the XPDX area of the C2 wiki, at [http://c2.com/cgi/wiki?XpCodeSprint].Please visit that page for up to date information or to sign up. If anyone has a project that they want to work on, please add it to the wiki. Here are some get us started. * http://pythoncard.sourceforge.net/ * http://moinmoin.wikiwikiweb.de/, or MoinMoin plugins. * http://scons.sourceforge.net/ * Agile programming infrastructure. Some (as yet poorly defined) set of integrated tools to allow unit testing, automated build, automated smoke testing, release control, SCM, and other necessary activities. Glue together existing products, and provide a single installer that will configure the whole suite. If anyone knows of one of these currently in progress, please update the page to add a link. * How about a rocket telemetry data analysis or visualization tool for http://psas.pdx.edu/? We could even provide live hardware. LOCATION AND LOGISTICS Critical Path Software his kindly invited us to use a floor of its downtown facilities for this sprint. The office is at 711 SW Alder St. in downtown Portland. It is about a block from Pioneer Courthouse Square, so is an easy MAX ride from many places in the city. The code sprint will run on April 9th and 10th. We will start each day at 10:00, and run until evening. Saturday night, several of us will probably troop on down to one of the local beer establishments. If you have additional questions, please email me. I look forward to pairing with you. Arlo Belshee Organizer, XPDX a_...@rl... |
From: Liam C. <cy...@gm...> - 2005-03-05 11:58:17
|
Hi all, Is there a way to call setFocus on the window when it opens? I have 3 windows - Main | ChildA | ChildB ChildA opens ChildB, assigns Main as the parent of ChildB and then closes itself. This is fine except Main is now in the foreground, and B behind it.... I tried self.backgrounds['bgTemplate'].setFocus(), but that doesn't work, I'm currently using def on_initialize(self, event): self.components[self.components.keys()[0]].setFocus() in ChildB. This works, but it seems a bit hacky, and I get a flicker as Main moves to the front, and then B does, which is distracting. There's probably something very obvious I'm missing, there usually is, but any help would be appreciated. I used findfiles.py and all the returns for 'focus' related to findFocus and setFocus being called on widgets. Regards, Liam Clarke -- 'There is only one basic human right, and that is to do as you damn well please. And with it comes the only basic human duty, to take the consequences. |
From: Bo G. <bo...@sy...> - 2005-03-04 19:00:35
|
I have been trying to piece together how to do a sizer in a CustomDialog. So far it doesn't work. If I leave the resource button positions as is, the buttons always appear there. If I comment out the resource button positions, the buttons end up both in the top left corner of the dialog, on top of each other. Here is the dialog's __init__ method in its current state (I've tried many variations of the same code). Part of the problem is my lack of understanding of the sizer methods, but possibly also how to add the components of the dialog to the sizer. def _init_(self, mainBG): "Initialise the project dialog" model.CustomDialog.__init__(self, mainBG) self.parent = mainBG sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.components.buttonCreate,flag=wx.GROW) sizer.Add(self.components.buttonOpen,flag=wx.GROW) sizer.Fit(self) self.SetSizer(sizer) self.SetAutoLayout(true) self.Layout() Thanks for any help. Bo |
From: Kevin A. <al...@se...> - 2005-03-04 18:54:28
|
http://lists.sourceforge.net/lists/listinfo/pythoncard-devel I've added a new mailing list specifically for issues regarding the development of PythonCard, documentation maintenance, discussion of bugs and bug fixes, planning for PythonCard 2, etc. I expect the list to have minimal traffic initially and it will still be okay to discuss any issue on the pythoncard-users mailing list, since it has the largest audience. But given that there probably won't be many more API or resource level changes to the current generation of PythonCard, I expect that we'll have a "1.0" API release relatively soon and development discussion on the tools such as the resourceEditor and codeEditor as well as PythonCard 2 will be better on a separate list. I apologize for taking so long on a PythonCard 1.0 release. I haven't been doing much PythonCard coding myself since last November and have only recently been getting back into it in preparation for Pycon, Python UK, etc. I'll be doing a lot of traveling in March and April, often without access to email, so I don't expect to do a major release until May at the earliest. I do hope to try and get out a maintenance release before Pycon to address the Python 2.4 installer issue, update some of the docs, etc. ka |
From: edward <ed...@kr...> - 2005-03-02 05:59:50
|
> > >Hi there, > >I was working on my text length limited widget, also I worked on a text >field that only accepts numbers, and this is my code, hope it helps. > > >def on_initialize(self, event): > self.type = True > >def on_txtText_keyPress(self, event): > keyCode = event.keyCode > if keyCode in range(48,58) or keyCode in >[8,316,317,318,319,127,314,315]: > event.Skip() > >def on_txtText_keyPress(self, event): > keyCode = event.keyCode > if len(self.components.txtText.text) == 10: > if keyCode in [8,316,317,318,319,127,314,315]: > self.type = True > else: > self.type = False > else: > self.type = True > if self.type: > event.Skip() > else: > self.type = True > > >Any suggestions or ideas on how to optmize this code, specially the text >leght validation, are more than welcome. > >Regards, > >Brian > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today it's FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > I've been playing around a little with the wx.lib.masked.numctrl package. There's a control named NumCtrl that basically does what you're looking for. I reckon you might want to tinker around with it a little and see if it works for you. You might have to write your code in a way that it creates and binds the control to your pythoncard frame at init (override the __init__ method of the PythonCard.model.Background or PythonCard.model.PageBackground to load up the control) eg. from PythonCard import model, from wx.lib.masked import numctrl class myframe(model.Background): def __init__(self, aParent, aBgRsrc): model.Background.__init__(self, aParent, aBgRsrc) self._initControls() def _initControls(self): self.txtText = numctrl.NumCtrl(self.panel, value=1234) self.txtText.SetParameters(groupDigits=False, allowNegative=False, useFixedWidthFont=False, max=5, limited=True) Edward |
From: Liam C. <cy...@gm...> - 2005-02-28 21:05:28
|
Sheesh. What I've come up with is this - store each textfield/area's restrictions on init - from Pythoncard import model import re def on_initialize(self, event): self.limits = {'text1':{'length':20, 'phone':True}} #complete for each limited widget self.PhoneRE = re.compile('[0-9\(\)\-\\b]') def on_keyPress(self, event): eventSource = event.target sourceClass = str(event.target.__class__) if not (sourceClass.endswith(" Textfield>\' ") or sourceClass.endswith(" Textarea>\' "): #Could just check hasattr('editable') and then if editable is set to Treu event.skip() return length = self.limits[eventSource.name]['length'] isPhoneNumber = self.limits[eventSource.name]['phone'] if len(eventSource.text) < length or keyCode == 8 #(backspace): If isPhoneNumber: if not self.PhoneRE.search(chr(event.keyCode)): return event.skip() return This is rough code, but basically it checks the length to make sure the new char won't exceed it, (unless it's backspace, I'll probably have to check for enter/tab as well.) And then it runs it through a RE if needed, in this case just a simple one [0-9\(\)\-\\b] which sould limit valid keystrokes to 0123456789()- and backspace Which should be enough to write a phone number. So, I just plan to write a minimalist child window with this method and subclass whenever I need to validate text. That said, I was recently made aware of the fact that I have, in effect, just re-invented the wheel, on account of wxPython's validators. But, they look scary in the demo, so I'm happy. But thanks for the info, I like the __nav_keys__ stuff. Regards, Liam Clarke On Mon, 28 Feb 2005 10:25:21 -0500, Aaron Howard <arc...@gm...> wrote: > On Mon, 2005-02-28 at 14:25 +0000, Alex Tweedly wrote: > > > def on_txtText_keyPress(self, event): > > > if len(self.components.txtText.text) < 10 or event.keyCode > > in > > > [8,316,317,318,319,127,314,315]: > > > event.Skip() > > Here's what I do: > > 1. create a class module to handle keypress tests > 2. in it, define some lists and functions like this: > > __digit_keys__ = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, > wx.WXK_NUMPAD0, wx.WXK_NUMPAD1, wx.WXK_NUMPAD2, wx.WXK_NUMPAD3, > wx.WXK_NUMPAD4, wx.WXK_NUMPAD5, wx.WXK_NUMPAD6, wx.WXK_NUMPAD7, > wx.WXK_NUMPAD8, wx.WXK_NUMPAD9] > > __money_keys__ = [36, 44, 46] > > __ctrl_keys__ = [wx.WXK_NUMLOCK, wx.WXK_CAPITAL, wx.WXK_SCROLL] > > __nav_keys__ = [wx.WXK_DELETE, wx.WXK_BACK, wx.WXK_TAB, > wx.WXK_RETURN, wx.WXK_LEFT, wx.WXK_RIGHT] > > __date_keys__ = [wx.WXK_DIVIDE, wx.WXK_SUBTRACT, 45, 47] > __zip_keys__ = [wx.WXK_SUBTRACT, 45] > __phone_keys__ = [32, 40, 41, 45, 120, wx.WXK_SUBTRACT] > > __valid_date_keycodes__ = __digit_keys__ + __date_keys__ + > __ctrl_keys__ > __valid_money_keycodes__ = __digit_keys__ + __money_keys__ + > __ctrl_keys__ > __valid_zipcode_keycodes__ = __digit_keys__ + __zip_keys__ + > __ctrl_keys__ > __valid_phone_keycodes__ = __digit_keys__ + __phone_keys__ + > __ctrl_keys__ > __valid_integer_keycodes__ = __digit_keys__ + __ctrl_keys__ > > def isNavKey(self, keyCode): > """ Tells whether a key pressed was a navigational key (like > tab, delete, etc.) """ > return keyCode in self.__nav_keys__ > > def validkey_date(self, keyCode): > return self.isNavKey(keyCode) or keyCode in > self.__valid_date_keycodes__ > > def validkey_zip(self, keyCode): > return self.isNavKey(keyCode) or keyCode in > self.__valid_zipcode_keycodes__ > > def validkey_money(self, keyCode): > return self.isNavKey(keyCode) or keyCode in > self.__valid_money_keycodes__ > > def validkey_phone(self, keyCode): > return self.isNavKey(keyCode) or keyCode in > self.__valid_phone_keycodes__ > > def validkey_integer(self, keyCode): > return self.isNavKey(keyCode) or keyCode in > self.__valid_integer_keycodes__ > > 3. in my app's init attribute/method: > import keyCodeTests > kct = keyCodeTests.keyCodeTests() > > 4. in keyPress events, something like this: > > def on_MyIntegerField_keyPress(self, event): > if kct.isNavKey(event.keyCode) or (kct.validkey_integer > (event.keyCode) and len(event.target.text) < > self.__MyIntegerField_MAXLEN__): > event.skip() > > FWIW, you should probably set things like max acceptable field length, > max acceptable values, etc., for your fields in a config file and then > write code to read the config first thing (during init). That way you > easily change stuff without having to re-write code. > > Hope this helps. > > -Aaron > > > -- 'There is only one basic human right, and that is to do as you damn well please. And with it comes the only basic human duty, to take the consequences. |
From: Aaron H. <arc...@gm...> - 2005-02-28 15:23:11
|
On Mon, 2005-02-28 at 14:25 +0000, Alex Tweedly wrote: > > def on_txtText_keyPress(self, event): > > if len(self.components.txtText.text) < 10 or event.keyCode > in=20 > > [8,316,317,318,319,127,314,315]: > > event.Skip() Here's what I do: 1. create a class module to handle keypress tests 2. in it, define some lists and functions like this: __digit_keys__ =3D [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, wx.WXK_NUMPAD0, wx.WXK_NUMPAD1, wx.WXK_NUMPAD2, wx.WXK_NUMPAD3, wx.WXK_NUMPAD4, wx.WXK_NUMPAD5, wx.WXK_NUMPAD6, wx.WXK_NUMPAD7, wx.WXK_NUMPAD8, wx.WXK_NUMPAD9] __money_keys__ =3D [36, 44, 46] __ctrl_keys__ =3D [wx.WXK_NUMLOCK, wx.WXK_CAPITAL, wx.WXK_SCROLL] __nav_keys__ =3D [wx.WXK_DELETE, wx.WXK_BACK, wx.WXK_TAB, wx.WXK_RETURN, wx.WXK_LEFT, wx.WXK_RIGHT] __date_keys__ =3D [wx.WXK_DIVIDE, wx.WXK_SUBTRACT, 45, 47] __zip_keys__ =3D [wx.WXK_SUBTRACT, 45] __phone_keys__ =3D [32, 40, 41, 45, 120, wx.WXK_SUBTRACT] __valid_date_keycodes__ =3D __digit_keys__ + __date_keys__ + __ctrl_keys__ __valid_money_keycodes__ =3D __digit_keys__ + __money_keys__ + __ctrl_keys__ __valid_zipcode_keycodes__ =3D __digit_keys__ + __zip_keys__ + __ctrl_keys__ __valid_phone_keycodes__ =3D __digit_keys__ + __phone_keys__ + __ctrl_keys__ __valid_integer_keycodes__ =3D __digit_keys__ + __ctrl_keys__ def isNavKey(self, keyCode): """ Tells whether a key pressed was a navigational key (like tab, delete, etc.) """ return keyCode in self.__nav_keys__ def validkey_date(self, keyCode): return self.isNavKey(keyCode) or keyCode in self.__valid_date_keycodes__ def validkey_zip(self, keyCode): return self.isNavKey(keyCode) or keyCode in self.__valid_zipcode_keycodes__ def validkey_money(self, keyCode): return self.isNavKey(keyCode) or keyCode in self.__valid_money_keycodes__ def validkey_phone(self, keyCode): return self.isNavKey(keyCode) or keyCode in self.__valid_phone_keycodes__ def validkey_integer(self, keyCode): return self.isNavKey(keyCode) or keyCode in self.__valid_integer_keycodes__ 3. in my app's init attribute/method: import keyCodeTests kct =3D keyCodeTests.keyCodeTests() 4. in keyPress events, something like this: def on_MyIntegerField_keyPress(self, event): if kct.isNavKey(event.keyCode) or (kct.validkey_integer (event.keyCode) and len(event.target.text) < self.__MyIntegerField_MAXLEN__): event.skip() FWIW, you should probably set things like max acceptable field length, max acceptable values, etc., for your fields in a config file and then write code to read the config first thing (during init). That way you easily change stuff without having to re-write code. Hope this helps. -Aaron |
From: Alex T. <al...@tw...> - 2005-02-28 14:59:58
|
Brian Debuire wrote: > Hi there, > > Thanks Alex the code works fine and it really is easier to read. > > But requesting more help how do I mix the text length and the numbers > only validation??? > def on_txtText_keyPress(self, event): if ( len(self.components.txtText.text) < 10 and event.keyCode in [45-58] ) or \ event.keyCode in [8,316,317,318,319,127,314,315]: event.Skip() Not quite so readable unfortunately. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.5.1 - Release Date: 27/02/2005 |
From: Brian D. <deb...@ho...> - 2005-02-28 14:32:02
|
Hi there, Thanks Alex the code works fine and it really is easier to read. But requesting more help how do I mix the text length and the numbers only validation??? Thanks in advance. Brian _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |