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: Ed L. <ed...@le...> - 2005-04-12 11:08:44
|
On Apr 12, 2005, at 2:29 AM, Liam Clarke wrote: > columnHeadings':[ > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ 'Job = number',-1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ = 'Inquiry date', -1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ 'Job = date',=A0 -1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ 'Job = time', -1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ = 'Fixed?', -1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ 'Job = type', -1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 [ 'Job = subtype'-1,2], > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ], > > which I thought would work gives this error - > [snip] > TypeError: unsupported operand type(s) for -: 'str' and 'int' You are missing a comma after 'Job subtype'. ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://dabodev.com/ |
From: Liam C. <cy...@gm...> - 2005-04-12 06:29:55
|
Hehe,=20 Just an update, having the columnHeading stuff in the resource file look=20 like this -=20 columnHeadings':[ [ 'Job number',-1,2], [ 'Inquiry date', -1,2], [ 'Job date', -1,2], [ 'Job time', -1,2], [ 'Fixed?', -1,2], [ 'Job type', -1,2], [ 'Job subtype'-1,2], ],=20 which I thought would work gives this error -=20 Traceback (most recent call last): File "C:\Python23\lib\site-packages\PythonCard\widget.py", line 402, in=20 _dispatch handler(background, aWxEvent) File "C:\Python23\SEDB\search.py", line 61, in=20 on_searchResults_itemActivated (parent, clientWindow) =3D self.clientChild() File "C:\Python23\SEDB\search.py", line 69, in clientChild clientWindow =3D model.childWindow(parent, client.ClientDetails) File "C:\Python23\lib\site-packages\PythonCard\model.py", line 176, in=20 childWindow rsrc =3D resource.ResourceFile(filename).getResource() File "C:\Python23\lib\site-packages\PythonCard\resource.py", line 45, in=20 __init__ self.dictionary =3D util.readAndEvalFile(rsrcFileName) File "C:\Python23\lib\site-packages\PythonCard\util.py", line 33, in=20 readAndEvalFile return eval(txt, globals()) File "<string>", line 0, in ? TypeError: unsupported operand type(s) for -: 'str' and 'int' but, the following do work -=20 leftAligned =3D self.components.jobs.GetColumnHeadingInfo() centreAligned =3D [] for item in leftAligned: k =3D [item[0],item[1], 2] centreAligned.append(k) self.components.jobs.columnHeadings =3D centreAligned or foo =3D self.components.jobs foo.columnHeadings =3D [[item[0], item[1], 2] for item in=20 foo.GetColumnHeadingInfo()] Hmm.... Or am I doing the resource file part wrong? On Apr 12, 2005 11:38 AM, Liam Clarke <cy...@gm...> wrote: >=20 > Hi Alex,=20 >=20 > There's a hint in the sample/multicolumnexample.py in the comments at > the head. > Playing around a bit with that, I think you pass in a list like > [ ["header", width, format], ...] > width is an integer value : > -1 =3D auto_size > positive value is an actual column width > (note you must have ALL columns set to auto_size to get autosizing) >=20 > format is one of > wxLIST_FORMAT_LEFT : 0 > wxLIST_FORMAT_RIGHT : 1 > wxLIST_FORMAT_CENTRE : 2 >=20 > On Apr 12, 2005 8:53 AM, Alex Tweedly <al...@tw...> wrote: > >=20 > > Liam Clarke wrote: > >=20 > > > Hello again, > > > > > > Feeling kind of silly, just looked more closely at MCL, and found > > > lines 330-338 under the method > > > _setColumnHeadings(self, aList): > > > > > > elif w =3D=3D 3 and \ > > > isinstance(aList[0][0], StringType) and \ > > > isinstance(aList[0][1], IntType) and \ > > > isinstance(aList[0][2], IntType): > > > flag =3D 0 > > > for i in xrange(numcols): > > > if aList[i][1] !=3D wx.LIST_AUTOSIZE: > > > flag =3D 1 > > > self.InsertColumn(i, aList[i][0], > > > format=3DaList[i][2], width=3DaList[i][1]) > > > > > > So, I get the feeling that if I create my ColumnHeadings as a list of > > > [ "Column name", x, y] > > > where x and y are both integers, then it'll come through to this > > > InsertColumn method... > > > > > > But, what values are legitimate values? If x and y have to be ints, > > > how does that fit in with InsertColumn? I'm used to wx.LIST_AUTOSIZE > > > and so forth. > >=20 > > There's a hint in the sample/multicolumnexample.py in the comments at > > the head. > > Playing around a bit with that, I think you pass in a list like > > [ ["header", width, format], ...] > > width is an integer value : > > -1 =3D auto_size > > positive value is an actual column width > > (note you must have ALL columns set to auto_size to get autosizing) > >=20 > > format is one of > > wxLIST_FORMAT_LEFT : 0 > > wxLIST_FORMAT_RIGHT : 1 > > wxLIST_FORMAT_CENTRE : 2 > >=20 > > Here's a snippet from my "play" code version of multicolumnexample.py > > (from on_loadButton_mouseClick > >=20 > > I changed > >=20 > > > self.components.theList.columnHeadings =3D items[0] > > > self.components.theList.items =3D items[1:] > >=20 > > to > >=20 > > > self.components.theList.columnHeadings =3D items[0] > > > headings =3D self.components.theList.GetColumnHeadingInfo() > > > print "here with", headings > > > headings[0][1] =3D 80 > > > headings[1][2] =3D 1 -- try various values here > > > self.components.theList.columnHeadings =3D headings > > > headings =3D self.components.theList.GetColumnHeadingInfo() > > > print "and now", headings > > > self.components.theList.items =3D items[1:] > > > > >=20 > > P.S. I couldn't figure out the right way to use the wxLIST_FORMAT_* > > constants. I'm sure you should be able to do something like > > import wx > > and then use wx.wxLIST_FORMAT_LEFT > > but that didn't work - I finished up doing > > import wx > > print wx._controls.wxLIST_FORMAT_LEFT > > to check what the values were. > >=20 > >=20 > > -- > > Alex Tweedly http://www.tweedly.net > >=20 > > -- > > No virus found in this outgoing message. > > Checked by AVG Anti-Virus. > > Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 07/04/2005 > >=20 > >=20 > Of course.... I should've tried -1... thanks for that Alex. >=20 >=20 > Regards,=20 >=20 >=20 > Liam Clarke >=20 > --=20 > 'There is only one basic human right, and that is to do as you damn well= =20 > please. > And with it comes the only basic human duty, to take the consequences.'= =20 >=20 --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences.' |
From: Ade <sk...@bl...> - 2005-04-12 04:07:35
|
Hi, Im not sure this is the right place for this especially at this time but here goes... I am trying to get the contents of a control in a window, say a TextArea control or a List or a button etc I can programmatically get the window its in and then the controls handle by enumming the child windows of that window. I cannot get the contents of that control. I'm a tester and I need to be able to confirm the contents programmatically before moving on with the test. I know there are 3rd party applications out there that can do it so it must be possible and I can not use these it has to be python. I have dug through the python forums and not found anything so far. I thought that since this was all about manipulating controls that this would be a good place for answers Thankyou, looking forward to version 1 of PythonCard. Adrian Smith |
From: Liam C. <cy...@gm...> - 2005-04-11 23:38:23
|
Hi Alex,=20 There's a hint in the sample/multicolumnexample.py in the comments at the head. Playing around a bit with that, I think you pass in a list like [ ["header", width, format], ...] width is an integer value : -1 =3D auto_size positive value is an actual column width (note you must have ALL columns set to auto_size to get autosizing) format is one of wxLIST_FORMAT_LEFT : 0 wxLIST_FORMAT_RIGHT : 1 wxLIST_FORMAT_CENTRE : 2 On Apr 12, 2005 8:53 AM, Alex Tweedly <al...@tw...> wrote: >=20 > Liam Clarke wrote: >=20 > > Hello again, > > > > Feeling kind of silly, just looked more closely at MCL, and found > > lines 330-338 under the method > > _setColumnHeadings(self, aList): > > > > elif w =3D=3D 3 and \ > > isinstance(aList[0][0], StringType) and \ > > isinstance(aList[0][1], IntType) and \ > > isinstance(aList[0][2], IntType): > > flag =3D 0 > > for i in xrange(numcols): > > if aList[i][1] !=3D wx.LIST_AUTOSIZE: > > flag =3D 1 > > self.InsertColumn(i, aList[i][0], > > format=3DaList[i][2], width=3DaList[i][1]) > > > > So, I get the feeling that if I create my ColumnHeadings as a list of > > [ "Column name", x, y] > > where x and y are both integers, then it'll come through to this > > InsertColumn method... > > > > But, what values are legitimate values? If x and y have to be ints, > > how does that fit in with InsertColumn? I'm used to wx.LIST_AUTOSIZE > > and so forth. >=20 > There's a hint in the sample/multicolumnexample.py in the comments at > the head. > Playing around a bit with that, I think you pass in a list like > [ ["header", width, format], ...] > width is an integer value : > -1 =3D auto_size > positive value is an actual column width > (note you must have ALL columns set to auto_size to get autosizing) >=20 > format is one of > wxLIST_FORMAT_LEFT : 0 > wxLIST_FORMAT_RIGHT : 1 > wxLIST_FORMAT_CENTRE : 2 >=20 > Here's a snippet from my "play" code version of multicolumnexample.py > (from on_loadButton_mouseClick >=20 > I changed >=20 > > self.components.theList.columnHeadings =3D items[0] > > self.components.theList.items =3D items[1:] >=20 > to >=20 > > self.components.theList.columnHeadings =3D items[0] > > headings =3D self.components.theList.GetColumnHeadingInfo() > > print "here with", headings > > headings[0][1] =3D 80 > > headings[1][2] =3D 1 -- try various values here > > self.components.theList.columnHeadings =3D headings > > headings =3D self.components.theList.GetColumnHeadingInfo() > > print "and now", headings > > self.components.theList.items =3D items[1:] > > >=20 > P.S. I couldn't figure out the right way to use the wxLIST_FORMAT_* > constants. I'm sure you should be able to do something like > import wx > and then use wx.wxLIST_FORMAT_LEFT > but that didn't work - I finished up doing > import wx > print wx._controls.wxLIST_FORMAT_LEFT > to check what the values were. >=20 >=20 > -- > Alex Tweedly http://www.tweedly.net >=20 > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 07/04/2005 >=20 >=20 Of course.... I should've tried -1... thanks for that Alex. Regards,=20 Liam Clarke --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences.' |
From: Alex T. <al...@tw...> - 2005-04-11 20:53:50
|
Liam Clarke wrote: > Hello again, > > Feeling kind of silly, just looked more closely at MCL, and found > lines 330-338 under the method > _setColumnHeadings(self, aList): > > elif w == 3 and \ > isinstance(aList[0][0], StringType) and \ > isinstance(aList[0][1], IntType) and \ > isinstance(aList[0][2], IntType): > flag = 0 > for i in xrange(numcols): > if aList[i][1] != wx.LIST_AUTOSIZE: > flag = 1 > self.InsertColumn(i, aList[i][0], > format=aList[i][2], width=aList[i][1]) > > So, I get the feeling that if I create my ColumnHeadings as a list of > [ "Column name", x, y] > where x and y are both integers, then it'll come through to this > InsertColumn method... > > But, what values are legitimate values? If x and y have to be ints, > how does that fit in with InsertColumn? I'm used to wx.LIST_AUTOSIZE > and so forth. There's a hint in the sample/multicolumnexample.py in the comments at the head. Playing around a bit with that, I think you pass in a list like [ ["header", width, format], ...] width is an integer value : -1 = auto_size positive value is an actual column width (note you must have ALL columns set to auto_size to get autosizing) format is one of wxLIST_FORMAT_LEFT : 0 wxLIST_FORMAT_RIGHT : 1 wxLIST_FORMAT_CENTRE : 2 Here's a snippet from my "play" code version of multicolumnexample.py (from on_loadButton_mouseClick I changed > self.components.theList.columnHeadings = items[0] > self.components.theList.items = items[1:] to > self.components.theList.columnHeadings = items[0] > headings = self.components.theList.GetColumnHeadingInfo() > print "here with", headings > headings[0][1] = 80 > headings[1][2] = 1 -- try various values here > self.components.theList.columnHeadings = headings > headings = self.components.theList.GetColumnHeadingInfo() > print "and now", headings > self.components.theList.items = items[1:] > P.S. I couldn't figure out the right way to use the wxLIST_FORMAT_* constants. I'm sure you should be able to do something like import wx and then use wx.wxLIST_FORMAT_LEFT but that didn't work - I finished up doing import wx print wx._controls.wxLIST_FORMAT_LEFT to check what the values were. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 07/04/2005 |
From: Sells, F. <fr...@ad...> - 2005-04-11 15:48:06
|
I'm cool with that, as long as I'm off the hook for liability, the usual GPL verbage. Would appreciate a brief credit though. -----Original Message----- From: Schollnick, Benjamin [mailto:Ben...@xe...] Sent: Monday, April 11, 2005 11:37 AM To: pyt...@li... Subject: RE: [Pythoncard-users] newbie, tool to print resource structure Importance: Low > But if I did, what I'd probably do is add some code to the "saveFile" > function in the resourceEditor, so that each time I saved the > resource > file, I also saved the equivalent nice, readable version. > > I wrote a couple of lines of code to do a very basic version > of that - > here's a context diff ... > (it's the same little code fragment inserted in two places). Very useful.... I would suggest that Kevin consider adding it to the Resource editor and maybe even expanding on it.... Possibly noting any non-default values that have been configured for the widgets... - Ben ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Schollnick, B. <Ben...@xe...> - 2005-04-11 15:38:08
|
> But if I did, what I'd probably do is add some code to the "saveFile"=20 > function in the resourceEditor, so that each time I saved the=20 > resource=20 > file, I also saved the equivalent nice, readable version.=20 >=20 > I wrote a couple of lines of code to do a very basic version=20 > of that -=20 > here's a context diff ... > (it's the same little code fragment inserted in two places). Very useful.... I would suggest that Kevin consider adding it to the Resource editor and maybe even expanding on it.... Possibly noting any non-default values that have been configured for the widgets... - Ben |
From: Liam C. <cy...@gm...> - 2005-04-10 19:59:50
|
Hello again,=20 Feeling kind of silly, just looked more closely at MCL, and found lines=20 330-338 under the method=20 _setColumnHeadings(self, aList): elif w =3D=3D 3 and \ isinstance(aList[0][0], StringType) and \ isinstance(aList[0][1], IntType) and \ isinstance(aList[0][2], IntType): flag =3D 0 for i in xrange(numcols): if aList[i][1] !=3D wx.LIST_AUTOSIZE: flag =3D 1 self.InsertColumn(i, aList[i][0], format=3DaList[i][2], width=3DaList[i][1]= ) So, I get the feeling that if I create my ColumnHeadings as a list of [=20 "Column name", x, y] where x and y are both integers, then it'll come through to this=20 InsertColumn method... But, what values are legitimate values? If x and y have to be ints, how doe= s=20 that fit in with InsertColumn? I'm used to wx.LIST_AUTOSIZE and so forth. Those isinstance()'s in the elif clause are a bit confusing actually.... Not overly much documentation on InsertColumn at wxpython.org<http://wxpython.org>either. :( Any help would be gratefully appreciated,=20 Liam Clarke On Apr 10, 2005 10:12 PM, Liam Clarke <cy...@gm...> wrote: >=20 > Hi there,=20 >=20 > Sorry to resurrect an old topic, but just working with the multi-column= =20 > list. >=20 > I have the column headings stored in the resource file, but I want to=20 > change how the column headings are formatted. AFAIK, in wxPython you can= =20 > only set formatting when calling wx.ListCtrl.InsertColumn, which is I=20 > believe what MultiColumnList (MCL) does for my column headings upon=20 > instantiation. >=20 > What I was wondering was would it be possible to have a optional attribut= e=20 > for that list like=20 > 'format': None in the resource file? Then you could add in the basic=20 > formats (list_left) if you needed them. >=20 > I dunno, MultiColumnList is so easy to use compared to the wxPython=20 > ListCtrl, so, in my pursuit of maximum effect for minimum effort, I'd rat= her=20 > avoid wx stuff as much as possible. I'm having nightmares after trying to= =20 > figure out how to use wx.DC's effectively.=20 >=20 > Alternatively, would it be possible to stick a method in MCL to=20 > effectively, destroy the existing MCL and create it again, but with=20 > formatting?=20 >=20 > I know that it would be a 95% un-needed method/attribute, so I'm asking= =20 > 'just in case' someone's poking at MCL and feels creative. >=20 >=20 > Regards,=20 >=20 >=20 > Liam Clarke >=20 > --=20 > 'There is only one basic human right, and that is to do as you damn well= =20 > please. > And with it comes the only basic human duty, to take the consequences.'= =20 >=20 --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences.' |
From: Liam C. <cy...@gm...> - 2005-04-10 10:13:06
|
Hi there,=20 Sorry to resurrect an old topic, but just working with the multi-column=20 list. I have the column headings stored in the resource file, but I want to chang= e=20 how the column headings are formatted. AFAIK, in wxPython you can only set= =20 formatting when calling wx.ListCtrl.InsertColumn, which is I believe what= =20 MultiColumnList (MCL) does for my column headings upon instantiation. What I was wondering was would it be possible to have a optional attribute= =20 for that list like=20 'format': None in the resource file? Then you could add in the basic format= s=20 (list_left) if you needed them. I dunno, MultiColumnList is so easy to use compared to the wxPython=20 ListCtrl, so, in my pursuit of maximum effect for minimum effort, I'd rathe= r=20 avoid wx stuff as much as possible. I'm having nightmares after trying to= =20 figure out how to use wx.DC's effectively.=20 Alternatively, would it be possible to stick a method in MCL to effectively= ,=20 destroy the existing MCL and create it again, but with formatting?=20 I know that it would be a 95% un-needed method/attribute, so I'm asking=20 'just in case' someone's poking at MCL and feels creative. Regards,=20 Liam Clarke --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences.' |
From: <bra...@om...> - 2005-04-09 21:57:48
|
For my part, the main motivation for this has gone away. In another thread, "childWindow.Raise() works on Windows, not on Mac", Liam kindly explained the following: "See, what happens is that when a child window is created, the method that [called model.childWindow] finishes before the child window's on_initialise gets called." Assuming this is true, and so far it seems to be, it's safe for the calling parent to go ahead and assign additional attributes to the child window, as long as it's done in the same method that created the child window. Another technique I've been using to get around this problem is for the child window's on_initialize to interrogate the parent for additional data using self.getParent(). Looking over the tutorial on how to create a child window, there is a reference to using getParent(), but it still might be worthwhile to include this in an FAQ...something like this: ---------- Q: "I want to pass parameters to model.childWindow when I create a child window. How do I accomplish that?" A: Instead of passing parameters to model.childWindow, you can have the child window's on_initialize method request additional data from the parent using self.getParent().whatever.you.want. ---------- I'm not sure if the other approach is worth mentioning in an FAQ; it seems counterintuitive to expect that on_initialize is going to fire at some later time... Kevin Altis wrote on 03/30/2005 12:38:14 AM: > I'm still not sure on the best way to deal with the > desire to pass args to a child window, but I would > like to propose one possible solution as well as > clarify some of the issues surrounding child windows. > > As a test, I duplicated the minimal source and > resource and added the following test code. > > def on_initialize(self, event): > print "child initialize" > > def postInit(self, a, b): > print "postInit" > print a, b > > I modified the minimal sample by adding a button and > the following code to create the child window as well > as call an additional method once the other events > have fired by using wx.CallAfter. > > def on_btn_mouseClick(self, event): > print "mouseClick" > self.myChild = model.childWindow(self, > minchild.Minimal) > wx.CallAfter(self.myChild.postInit, "hello", > 2) > > This appears to work as expected, but may not be what > Liam and others are looking for. I'll let them reply > with their current solutions and what they want. > > model.childWindow is just a convenience function. > > PythonCard does not use __init__ in user code since > that can be a dangerous place for user code as you > might try and access or modify controls or methods > that have not finished initializing in > wxWidgets/wxPython. Thus the initialize event has been > the way of doing initialization and the "event" is > supposed to fire after all other wx initialization is > done and the underlying control or window has > "settled", so it is safe to do whatever manipulations > you need. Furthermore, initialize is an event in an > attempt to be more consistent, but that means it only > has one argument, "event", just like all the other > events. > > In the case of the childWindow function, the > initialize event that fires is disconnected from the > function call. Even if *args and **kwargs arguments > were used in the childWindow function I couldn't pass > them to initialize in a clean way. Making a separate > method call that you have control over when it happens > in relation to other events seems like the simplest > solution. Given that this might be a common need, > maybe we should have a PythonCard alias for > wx.CallAfter? > > Additional thoughts? I can dig into this issue more > next week. > > ka > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Alex T. <al...@tw...> - 2005-04-09 20:08:38
|
I said: > Sells, Fred wrote: > >> I realize that the PythonCard resouce structure is a straight forward >> combination of {} and []. >> >> before I reinvent the wheel, has anyone written a simple script to print >> this out (text or html) in a form more human (well programmer >> actually ;) >> readable form. I find myself going back to check resource names too >> frequently and would like a quick reference. >> >> > Haven't felt a need to do that. But if I did, what I'd probably do is add some code to the "saveFile" function in the resourceEditor, so that each time I saved the resource file, I also saved the equivalent nice, readable version. I wrote a couple of lines of code to do a very basic version of that - here's a context diff ... (it's the same little code fragment inserted in two places). > *** resourceEditor.py Thu Sep 30 15:16:24 2004 > --- ../myresourceEditor/resourceEditor.py Sat Apr 9 21:04:19 2005 > *************** > *** 828,833 **** > --- 828,845 ---- > f.close() > self.documentChanged = False > self.fileHistory.AddFileToHistory(self.filename) > + > + f = open(self.filename+'txt', 'w') > + desc = '' > + for w in self.components.order: > + if w not in self.sizingHandleNames: > + aWidget = self.components[w] > + desc += "%s: %s %s \n" % > (aWidget.__class__.__name__, aWidget.name, aWidget.position) > + f.write(desc) > + f.close() > + > + > + > return True > except Exception, e: > message = 'The resource file could not be saved.\n' > + str( e ) > *************** > *** 961,966 **** > --- 973,987 ---- > f.close() > self.filename = path > self.documentChanged = False > + f = open(self.filename+'txt', 'w') > + desc = '' > + for w in self.components.order: > + if w not in self.sizingHandleNames: > + aWidget = self.components[w] > + desc += "%s: %s %s \n" % > (aWidget.__class__.__name__, aWidget.name, aWidget.position) > + f.write(desc) > + f.close() > + > return True > except: > return False this saves a file such as "name.rsrc.pytxt" with the readable version. -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 07/04/2005 |
From: Alex T. <al...@tw...> - 2005-04-09 18:16:53
|
Sells, Fred wrote: >I realize that the PythonCard resouce structure is a straight forward >combination of {} and []. > >before I reinvent the wheel, has anyone written a simple script to print >this out (text or html) in a form more human (well programmer actually ;) >readable form. I find myself going back to check resource names too >frequently and would like a quick reference. > > Haven't felt a need to do that. For code editing, I use the "oneEditor" that comes with Pythoncard. It's an experimental (though pretty stable) extension to the basic code editor - supports tabbed notebook for multiple file edits, and a drop-down menu of components and their events. Even if you want to use a different editor, you may find the code that does that helpful - see setResourceFile, fillEventNames and on_popComponentEvents in tools/oneEditor/tabcodeEditor.py -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.5 - Release Date: 07/04/2005 |
From: Sells, F. <fr...@ad...> - 2005-04-09 13:38:58
|
I realize that the PythonCard resouce structure is a straight forward combination of {} and []. before I reinvent the wheel, has anyone written a simple script to print this out (text or html) in a form more human (well programmer actually ;) readable form. I find myself going back to check resource names too frequently and would like a quick reference. |
From: Liam C. <cy...@gm...> - 2005-04-09 12:46:16
|
Yeah, thatt's the way to do it, gets all the GUI bits up and running, and= =20 you can use on_initialize events to run the whole thing without any user=20 input if need be. If you're just looking to do quick and dirty GUI's as needed within your=20 code, instead of shaping your code to fit a GUI, have a look at=20 http://www.ferg.org/easygui/ Easygui. They're pretty quick and dirty, but they're easy. Regards, Liam Clarke On Apr 10, 2005 12:33 AM, Sells, Fred <fr...@ad...> wrote: >=20 > Thanks to all who responded; I see the light :) >=20 > I'm makeing ~worldclock my initial "controller" and having it instantiate= =20 > my > real Controller. >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users >=20 --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences. |
From: Sells, F. <fr...@ad...> - 2005-04-09 12:33:42
|
Thanks to all who responded; I see the light :) I'm makeing ~worldclock my initial "controller" and having it instantiate my real Controller. |
From: Liam C. <cy...@gm...> - 2005-04-09 03:44:35
|
I am confused. What are you trying to do exactly? >I cannot seem to find a way to reference the worldclock instance object so= =20 that my controller can >use it's methods to update the GUI. the snippet I= =20 think relates is: So, are you trying to access the original worldclock, or your own class? Consider making your Pythoncard class your controller, as it will be the on= e=20 responding to events. I have a similar case -=20 from PythonCard import model, dialog import dao import ConfigParser import search class Main(model.Background): def on_initialize(self, event): db =3D self.getCfg() self.SQLWrapper =3D dao.DAO(db) self.Show() def getCfg(self): cfg =3D ConfigParser.ConfigParser() cfg.read('./config.ini') dbFile =3D cfg.get('Database details', 'filename') return dbFile def on_clients_mouseClick(self, event): searchWindow =3D model.childWindow(self, search.SearchClient) searchWindow.DAO =3D self.SQLWrapper if __name__=3D=3D'__main__': app=3Dmodel.Application(Main) app.MainLoop() From the main class, references to the database access object are passed to= =20 each child window. Child windows can open other children windows, but they= =20 always assign the above class as the parent, so the Main class will always= =20 stick around. On Apr 9, 2005 2:30 AM, Sells, Fred <fr...@ad...> wrote: >=20 > I have a single window PythonCard app plus a few more classes to wrap=20 > access to a DB, Serial IO and a directory of jpg's. > I would like to pull everything together in a Controller.py module which= =20 > would be able to access the my PythonCard module (i.e. the one that=20 > matches the PythonCard resource file). I started off using the worldclock= =20 > demo from the samples directory and have significantly gutted it to fit m= y=20 > needs. > I cannot seem to find a way to reference the worldclock instance object= =20 > so that my controller can use it's methods to update the GUI. the snippet= I=20 > think relates is: > app =3D model.Application(WorldClock) > app.MainLoop() > I tried doing a "dir()" on app, but didn't recognize anything as giving= =20 > me access to the instance of WordClock.=20 > I realize I could make WorldClock my "Controller", but that's just not= =20 > the way I see the design. After all this, by questions are: > 1. is there a way to reference the instance of WorldClock, or > 2. am I looking into the wrong end of the pipe for PythonCard and should = I=20 > make WorldClock.py my primary controller? > I've included the entire source for WorldClock.py below, for what it's= =20 > worth: > #!/usr/bin/python > =20 > import urllib > import os > import time > import wx > from cStringIO import StringIO > from PythonCard import graphic, log, model, timer > #from PythonCard.log import Log > class WorldClock(model.Background): > def on_initialize(self, event): > self.clockTimer =3D timer.Timer(self.components.staticTextClock, -1) > self.clockTimer.start(1000) # 1 second > self.updateDateAndTime() > def on_staticTextClock_timer(self, event): > self.updateDateAndTime() > def updateDateAndTime(self):=20 > t =3D time.strftime("%I:%M %p") > if t[0] =3D=3D "0": t =3D t[1:] > d =3D time.strftime("%A, %B %d, %Y") > self.components.staticTextClock.text =3D d+" "+t >=20 > def on_imageButtonWorld_timer(self, event): > print "imageButtonWorld_timer" >=20 > def on_Leave_mouseClick(self, event): > print "clicked leave" > def on_Arrive_mouseClick(self, event): > print "arrive" > def on_showHistory_mouseClick(self, event): > print "history" > def on_close(self, event): > self.clockTimer.stop() > event.skip() >=20 > def setEmployee(self, employee): > self.components.Name.text =3D employee.getFullName() > bmp =3D graphic.Bitmap(employee.getPictureFilename()) > if employee.LName=3D=3D'BURRILL': > bmp.rotate180(1) > =20 > def createApplication(): > app =3D model.Application(WorldClock) > for d in dir(app):print d > app.MainLoop() > ##mainloop never returns. > if __name__ =3D=3D '__main__': > createApplication() > =20 --=20 'There is only one basic human right, and that is to do as you damn well=20 please. And with it comes the only basic human duty, to take the consequences. |
From: Alex T. <al...@tw...> - 2005-04-08 17:42:06
|
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.2 - Release Date: 05/04/2005 |
From: Sells, F. <fr...@ad...> - 2005-04-08 14:30:19
|
I have a single window PythonCard app plus a few more classes to wrap access to a DB, Serial IO and a directory of jpg's. I would like to pull everything together in a Controller.py module which would be able to access the my PythonCard module (i.e. the one that matches the PythonCard resource file). I started off using the worldclock demo from the samples directory and have significantly gutted it to fit my needs. I cannot seem to find a way to reference the worldclock instance object so that my controller can use it's methods to update the GUI. the snippet I think relates is: app = model.Application(WorldClock) app.MainLoop() I tried doing a "dir()" on app, but didn't recognize anything as giving me access to the instance of WordClock. I realize I could make WorldClock my "Controller", but that's just not the way I see the design. After all this, by questions are: 1. is there a way to reference the instance of WorldClock, or 2. am I looking into the wrong end of the pipe for PythonCard and should I make WorldClock.py my primary controller? I've included the entire source for WorldClock.py below, for what it's worth: #!/usr/bin/python import urllib import os import time import wx from cStringIO import StringIO from PythonCard import graphic, log, model, timer #from PythonCard.log import Log class WorldClock(model.Background): def on_initialize(self, event): self.clockTimer = timer.Timer(self.components.staticTextClock, -1) self.clockTimer.start(1000) # 1 second self.updateDateAndTime() def on_staticTextClock_timer(self, event): self.updateDateAndTime() def updateDateAndTime(self): t = time.strftime("%I:%M %p") if t[0] == "0": t = t[1:] d = time.strftime("%A, %B %d, %Y") self.components.staticTextClock.text = d+" "+t def on_imageButtonWorld_timer(self, event): print "imageButtonWorld_timer" def on_Leave_mouseClick(self, event): print "clicked leave" def on_Arrive_mouseClick(self, event): print "arrive" def on_showHistory_mouseClick(self, event): print "history" def on_close(self, event): self.clockTimer.stop() event.skip() def setEmployee(self, employee): self.components.Name.text = employee.getFullName() bmp = graphic.Bitmap(employee.getPictureFilename()) if employee.LName=='BURRILL': bmp.rotate180(1) def createApplication(): app = model.Application(WorldClock) for d in dir(app):print d app.MainLoop() ##mainloop never returns. if __name__ == '__main__': createApplication() |
From: <bra...@om...> - 2005-04-05 20:09:15
|
Kevin Altis wrote on 04/05/2005 02:18:38 PM: > Create a PYTHONPATH environment variable and set it to the special > directory which holds the PythonCard directory. Python will search in > the PYTHONPATH before the standard lib dirs. Your examples and others that turned up on a Google search use "/Users/username/python" as the PYTHONPATH. That seems to imply that PythonCard should be dumped directly into said directory, so that import PythonCard statements will find it. However, if I download using CVS into this directory, it dumps a lot of other stuff into the same place, including the folders CVS and CVSROOT. Will this create CVS problems if I start downloading other Python packages into this directory using CVS? Also, I'm curious how to start making use of the new platform-specific resource file feature. Do these just automagically work under PythonCard .82 as long as the resource files have the special naming convention examples from your original posting? > ['minimal.win.en_US.rsrc.py', > 'minimal.win.en.rsrc.py', 'minimal.en_US.rsrc.py', > 'minimal.en.rsrc.py', 'minimal.win.rsrc.py', 'minimal.rsrc.py'] |
From: <bra...@om...> - 2005-04-05 19:22:12
|
What is the normal way of managing large numbers of resource files? Do you typically group them into Python packages separate from the rest of your project's modules, but with the associated background modules still alongside in the same folder? Or do you split all your resource files into a separate folder and somehow tell PythonCard a special path for locating resource files? Or do you just let the resource files reside alongside all the other modules? For example, my current project structure looks something like this, but the number for resource files in the client package keeps growing, and may end up growing to somewhere from 30 to 50 rsrc files by the time things settle down. Of course, there will also be equally many background modules, and just a small number of non-PythonCard modules buried in the mix. ProjectFolder client __init__.py <modules involving client app logic and increasingly many rsrc files> common __init__.py <modules required by both client and server> server __init__.py <modules involving database and business logic> |
From: Kevin A. <al...@se...> - 2005-04-05 19:18:41
|
On Apr 5, 2005, at 12:03 PM, bra...@om... wrote: > > "Kevin Altis" <al...@se...> wrote on 04/05/2005 01:35:41 PM: > > > When I post a change like this it means that the code in the CVS > > repository changed and will be in the next release distribution. If > you > > want to stay current with changes and test before the next release > you > > need to work off of a copy of PythonCard from the SF CVS repository. > > > > The next release is not scheduled until sometime in May, after I get > > back from the UK. > > Ok, I downloaded from CVS into a special directory (separate from my > Mac's /Library/Python/2.3 directory). So, if I add this to my > sys.path, so as to import the CVS copy of PythonCard, I should be able > to start using platform-specific resource filenames and PythonCard > will automatically detect the platform and select the correct resource > file? > Create a PYTHONPATH environment variable and set it to the special directory which holds the PythonCard directory. Python will search in the PYTHONPATH before the standard lib dirs. On the Mac, you'll want to create an environment.plist file so that the PYTHONPATH is used regardless of whether you're running from the Terminal or Finder, since on the Mac those are considered different as far as how environment variables are found. The file will look something like this, substitute your own username for "username" below. You only need the CVS_RSH key if you do CVS checkins for some package. The environment.plist is a leftover from the Next days of OS X, IIRC ;-) If you search on Google you should find more about PYTHONPATH and environment.plist. Also, I think the file needs to end in linefeeds (Unix) not carriage returns (Mac Finder) and yes it is annoying that Apple brought that legacy of classic Mac into Mac OS X. If you run your application with one of the debug options like -d you can check the About dialog to make sure you have the right versions of Python, wxPython, and PythonCard. The PythonCard version number in CVS is 0.8.2. cat ~/.MacOSX/environment.plist <?xml version="1.0 encoding="UTF-8"?> <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> <plist version="0.9"> <dict> <key>CVS_RSH</key> <string>ssh</string> <key>PYTHONPATH</key> <string>/Users/username/python</string> </dict> </plist> ka |
From: Bo G. <bo...@sy...> - 2005-04-05 19:07:14
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> <a class="moz-txt-link-abbreviated" href="mailto:bra...@om...">bra...@om...</a> wrote: <blockquote cite="mid...@om..." type="cite"><br> <font size="2"><tt>Kevin Altis wrote on 04/01/2005 11:11:20 AM:<br> <br> > I've come up with a potential solution to raising<br> > child windows when the main window is selected in the<br> > resourceEditor. This is actually a problem for any<br> > PythonCard application with child windows, but seems<br> > to be more of annoyance in the resourceEditor as the<br> > Property Editor window is always being lost behind<br> > other application windows.<br> > <br> > You can just drop the following code into<br> > resourceEditor.py and see whether this gives the<br> > behavior you would expect. I would like to get some<br> > feedback before I check it into cvs. If you have<br> > overlapping windows, most likely because you're<br> > working on a small screen, this solution of forcing a<br> > Raise could be very annoying, so I would likely add a<br> > menu item under Options that would allow you to<br> > disable the Raise.<br> > <br> > def on_activate(self, event):<br> > if not hasattr(self, 'inActivate') or not<br> > self.inActivate:<br> > self.inActivate = True<br> > for c in self.GetChildren():<br> > c.Raise()<br> > self.Raise()<br> > self.inActivate = False<br> > #event.skip()<br> </tt></font> <br> <br> <font size="2"><tt>Thanks, I will try this.</tt></font> <br> <br> <font size="2"><tt><br> > On a related note, I never added lowercase aliases for<br> > Raise and Lower to the Background class because I<br> > wasn't sure if this would be legal since raise is a<br> > keyword and we need it for raising exceptions. If<br> > someone knows the correct syntax so that we can have a<br> > lowercase alias to Raise I'll add it to the class;<br> > perhaps I could just do a setattr or something?!<br> > <br> > raise = wx.Frame.Raise<br> </tt></font> <br> <font size="2"><tt>Are lowercase aliases used for a lot of other names in PythonCard or wx? <br> </tt></font> </blockquote> <br> I tried plugging this into resourceEditor.py on my Windows install, it didn't work. Quite likely that I screwed up somehow, but the focus keeps reverting to the property editor on every attempt to select the resource editor. I tried to be extra careful with indentation, but still not working here. <br> Bo<br> </body> </html> |
From: <bra...@om...> - 2005-04-05 19:04:28
|
"Kevin Altis" <al...@se...> wrote on 04/05/2005 01:35:41 PM: > When I post a change like this it means that the code in the CVS > repository changed and will be in the next release distribution. If you > want to stay current with changes and test before the next release you > need to work off of a copy of PythonCard from the SF CVS repository. > > The next release is not scheduled until sometime in May, after I get > back from the UK. Ok, I downloaded from CVS into a special directory (separate from my Mac's /Library/Python/2.3 directory). So, if I add this to my sys.path, so as to import the CVS copy of PythonCard, I should be able to start using platform-specific resource filenames and PythonCard will automatically detect the platform and select the correct resource file? Thanks! |
From: Kevin A. <al...@se...> - 2005-04-05 18:50:11
|
I've checked in the changes suggested by Bob Ippolito. The new setup.py file looks like... from distutils.core import setup import sys if sys.platform == 'darwin': import py2app buildstyle = 'app' else: import py2exe buildstyle = 'console' setup( name = "minimal", data_files = [ (".", ["readme.txt", "minimal.rsrc.py"]) ], **{buildstyle: ["minimal.py"]} ) ka Begin forwarded message: > From: "Bob Ippolito" <bo...@re...> > Date: March 23, 2005 4:04:42 PM PST > To: al...@se... > Subject: PythonCard and py2app > > Using svn head of py2app (r436 or later), the following diff will > allow minimalStandalone's setup.py to build for both py2exe and > py2app. > > -bob > > > =================================================================== > RCS file: > /cvsroot/pythoncard/PythonCard/samples/minimalStandalone/setup.py,v > retrieving revision 1.2 > diff -u -r1.2 setup.py > --- setup.py 26 Mar 2004 16:37:37 -0000 1.2 > +++ setup.py 24 Mar 2005 00:01:09 -0000 > @@ -12,10 +12,16 @@ > """ > > from distutils.core import setup > -import py2exe > +import sys > +if sys.platform == 'darwin': > + import py2app > + buildstyle = 'app' > +else: > + import py2exe > + buildstyle = 'console' > > setup( name = "minimal", > - console = ["minimal.py"], > - data_files = [ (".", ["readme.txt", "minimal.rsrc.py"]) ] > + data_files = [ (".", ["readme.txt", "minimal.rsrc.py"]) ], > + **{buildstyle: ["minimal.py"]} > ) > > |
From: Kevin A. <al...@se...> - 2005-04-05 18:35:46
|
On Apr 5, 2005, at 11:22 AM, bra...@om... wrote: > > > Thanks, Kevin. I hope to test out this feature sometime in the coming > week. > > Kevin Altis wrote on 03/30/2005 12:07:09 PM: > > > I've revised the internationalResourceName function in > > model.py to support platform-specific resource files > > as well as language and country specific names. You > > don't have to use platform-specific files, but it is > > an option for those that want to tweak a static layout > > for each platform. > > > > For example, using the -l (log) option under Windows > > on my system, I get the following DEBUG output which > > shows the possible valid resource filenames and the > > order they are searched for. Valid platform prefixes > > are: win, gtk, mac. > > > > DEBUG: : Wed Mar 30 09:54:22 2005: default: ('en_US', > > 'cp1252') > > DEBUG: : Wed Mar 30 09:54:22 2005: en US > > DEBUG: : Wed Mar 30 09:54:22 2005: > > ['minimal.win.en_US.rsrc.py', > > 'minimal.win.en.rsrc.py', 'minimal.en_US.rsrc.py', > > 'minimal.en.rsrc.py', 'minimal.win.rsrc.py', 'minimal.rsrc.py'] > When I post a change like this it means that the code in the CVS repository changed and will be in the next release distribution. If you want to stay current with changes and test before the next release you need to work off of a copy of PythonCard from the SF CVS repository. The next release is not scheduled until sometime in May, after I get back from the UK. ka |