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: Alex T. <al...@tw...> - 2004-06-22 17:05:25
|
At 11:40 22/06/2004 -0400, Schollnick, Benjamin wrote: >Folks, > > > Ditto - I remember this bug too, but like Steve, I can't > > remember what the fix was. :-( > >7.3.1 Has seemed to clear up the problem.... Cool ! >But I have noticed a few things.... > >* There seems to be no way for the user to resize the dialog/HTML window Sorry - can't answer this one (yet) >* Scroll Bars, I do not see a way to force the scroll bars to be active...? > Do I have to explicitly add scroll bars? No - they'll appear if needed. >Also... > >* HTMLWindow requires a .html file to be passed to it? When I attempted to > use a string, it pops up a dialog window reporting that's a invalid > file... If you want to use a string passed in, you MUST have the very first character be a "<" Pythoncard's HTMLWindow class checks the first char, and if it's not a "<" it assumes it's a file name and uses that instead. [ Hmmm - I think this will maybe change some day :-] I changed my example to use an HTMLwindow, and the code in mydialog.py to be > def __init__(self, parent, txt=''): > model.CustomDialog.__init__(self, parent) > self.components.HtmlWindow1.text = "<html><body>some <b>text</b> > here" > and that worked OK. Otherwise, it treats the string as a file - I changed my code in mydialog.py to > def __init__(self, parent, txt=''): > model.CustomDialog.__init__(self, parent) > self.components.HtmlWindow1.text = "calendar.html" calendar.html was an existing HTML file. You could use this, writing the string to a tmp file to use HTMLWindow -- Alex. |
From: Schollnick, B. <Ben...@us...> - 2004-06-22 16:21:42
|
Folks, > Ditto - I remember this bug too, but like Steve, I can't > remember what the fix was. :-( 7.3.1 Has seemed to clear up the problem.... But I have noticed a few things.... * There seems to be no way for the user to resize the dialog/HTML window * Scroll Bars, I do not see a way to force the scroll bars to be active...? Do I have to explicitly add scroll bars? Also... * HTMLWindow requires a .html file to be passed to it? When I attempted to use a string, it pops up a dialog window reporting that's a invalid file... - Ben |
From: Phil E. <ph...@li...> - 2004-06-22 14:42:12
|
On Tuesday 22 Jun 2004 3:04 pm, Steve Holden wrote: > This sounds like a very old bug. I seem to remember that Kevin fixed it > a long time ago - are you fully up to date on the prototype? Sadly I Ditto - I remember this bug too, but like Steve, I can't remember what the fix was. :-( If it's any help, I use an HTML-based custom dialog in my PIMP app to display license details, credits etc. I've ripped the code and resource file out and put it up on my website at: http://www.linux2000.com/downloads/HelpAbout.tar.gz Feel free to use/ignore as required. There's a screenshot of it in action here: http://www.linux2000.com/images/snapshot14.png Hope this helps -- Regards Phil Edwards Brighton, UK |
From: Steve H. <sh...@ho...> - 2004-06-22 14:04:17
|
Schollnick, Benjamin wrote: >Something is not kosher here... > >I can create the dialog properly in the Resource Editor, >but when I go to save it... It does not appear to save... > >If I close the window, it asks me if I wish to save the changes.. >No matter how many times I tell it to save, if I revert to the >disk file, it's the standard template file... (Without my changes) > >I am still running the prototype version.... I am under the impression >that the newer version would require changes in my code, due to changes >since the prototype? > >What version are you running? > > - Benjamin > > This sounds like a very old bug. I seem to remember that Kevin fixed it a long time ago - are you fully up to date on the prototype? Sadly I don't seem to have a record of the fix. regards Steve |
From: Alex T. <al...@tw...> - 2004-06-22 13:51:34
|
At 09:25 22/06/2004 -0400, Schollnick, Benjamin wrote: >Something is not kosher here... > >I can create the dialog properly in the Resource Editor, >but when I go to save it... It does not appear to save... > >If I close the window, it asks me if I wish to save the changes.. >No matter how many times I tell it to save, if I revert to the >disk file, it's the standard template file... (Without my changes) > >I am still running the prototype version.... I am under the impression >that the newer version would require changes in my code, due to changes >since the prototype? > >What version are you running? Prototype. 0.7.3.1 (on Windows 2000) Resource editor help says : Last updated: 2002-04-13 One unlikely suggestion .... Does the resource editor properly save for you when editing normal resource files ? Try going into res-editor, creating the dialog and saving it to your named file (without doing any editing). Then quit and restart res-editor and File/Open your file - make changes and see if they will save (i.e. just in case it's a problem specific to creating via File/New/Dialog Template). -- Alex. |
From: Schollnick, B. <Ben...@us...> - 2004-06-22 13:26:41
|
Something is not kosher here... I can create the dialog properly in the Resource Editor, but when I go to save it... It does not appear to save... If I close the window, it asks me if I wish to save the changes.. No matter how many times I tell it to save, if I revert to the disk file, it's the standard template file... (Without my changes) I am still running the prototype version.... I am under the impression that the newer version would require changes in my code, due to changes since the prototype? What version are you running? - Benjamin > -----Original Message----- > From: Alex Tweedly [mailto:al...@tw...] > Sent: Monday, June 21, 2004 4:04 PM > To: Schollnick, Benjamin; 'Alex Tweedly'; > pyt...@li... > Subject: RE: [Pythoncard-users] ScrolledMessageDialog Window Font > question s? > > > At 10:02 21/06/2004 -0400, Schollnick, Benjamin wrote: > >Maybe a silly question... But I do not see a easy way to make a > >custom dialog? > > > >I guess I could power up resourceditor, make a "second" application > >that looks like a custom dialog... > > > >But I would think there has to be a simple way to do that? > > Yes, it's pretty easy .... > > Fire up the resourceEditor > Click on File/New... Dialog Template > Move the "OK" and "Cancel" buttons down to make space > Add a new Component/TextArea - call it something imaginative > (TextArea1 in > my case) > Make it a suitable size, and set its font to Courier > File/Save As ... mydialog.rsrc.py > (see below) > > This also saves a file mydialog.py - edit this, to take an > extra parameter > "txt" and put it into self.components.TextArea1.text before > displaying the > dialog > (see below) > > And then in your program simply call it as > result = mydialog.myDialog(self, thetextstring) > > >The goal here is: > > > > * Switch to a monospaced font. The Scrolled Window font is > > completely ruining any "table" design that > I setup due > > to the non-monospaced font... > > > > I just looked again and there is no > wxpython nor pythoncard > > documentation that talks about setting up > the font for those > > dialogs... > > Courier font - see example > > > * Maybe some other font "goodies"... > > Don't see any easy way ... > > > HTML would be nice, but is not necessary.... > > Make it a HTMLWindow instead of a TextArea > > > example.rsrc.py by doing more or less what I described above > {'type':'CustomDialog', > 'name':'Template', > 'title':'Dialog Template', > 'position':(519, 120), > 'size':(342, 301), > 'components': [ > > {'type':'TextArea', > 'name':'TextArea1', > 'position':(10, 10), > 'size':(309, 177), > 'alignment':'left', > 'font':{'faceName': 'Courier', 'family': 'sansSerif', 'size': 8}, > 'text':'this is sample\ntext to show\nit is constant > width\nmmmmmmmmmmmmmm\niiiiiiiiiiiiiiiii\n', > }, > > {'type':'Button', > 'id':5100, > 'name':'btnOK', > 'position':(75, 204), > 'label':'OK', > }, > > {'type':'Button', > 'id':5101, > 'name':'btnCancel', > 'position':(177, 203), > 'label':'Cancel', > }, > > ] # end components > } # end CustomDialog > > corresponding mydialog.py (note - slight editing needed to > get this - > basically just fixup the parameters and add the setting of > self.components.TextArea1.text) > > from PythonCardPrototype import model > > class MyDialog(model.CustomDialog): > def __init__(self, parent, txt=''): > model.CustomDialog.__init__(self, parent) > self.components.TextArea1.text = txt > # if some special setup is necessary, do it here > # example from samples/dialogs/minimalDialog.py > # self.components.field1.text = txt > > #def myDialog(parent, txt): > def myDialog(parent, txt): > dlg = MyDialog(parent, txt) > dlg.showModal() > result = {'accepted':dlg.accepted()} > # stick your results into the result dictionary here > # example from samples/dialogs/minimalDialog.py > # result['text'] = dlg.components.field1.text > dlg.destroy() > return result > > and finally the code snippet from the program itself (I added > a button > "showdialog" to trigger it) > def on_showdialog_mouseClick(self, event): > result = mydialog.myDialog(self, self.thestring) > print result > > and sure enough it comes up, and is in Courier font. > > Hope this helps > -- Alex. > |
From: Alex T. <al...@tw...> - 2004-06-21 20:52:28
|
At 10:02 21/06/2004 -0400, Schollnick, Benjamin wrote: >Maybe a silly question... But I do not see a easy way to make a >custom dialog? > >I guess I could power up resourceditor, make a "second" application >that looks like a custom dialog... > >But I would think there has to be a simple way to do that? Yes, it's pretty easy .... Fire up the resourceEditor Click on File/New... Dialog Template Move the "OK" and "Cancel" buttons down to make space Add a new Component/TextArea - call it something imaginative (TextArea1 in my case) Make it a suitable size, and set its font to Courier File/Save As ... mydialog.rsrc.py (see below) This also saves a file mydialog.py - edit this, to take an extra parameter "txt" and put it into self.components.TextArea1.text before displaying the dialog (see below) And then in your program simply call it as result = mydialog.myDialog(self, thetextstring) >The goal here is: > > * Switch to a monospaced font. The Scrolled Window font is > completely ruining any "table" design that I setup due > to the non-monospaced font... > > I just looked again and there is no wxpython nor pythoncard > documentation that talks about setting up the font for those > dialogs... Courier font - see example > * Maybe some other font "goodies"... Don't see any easy way ... > HTML would be nice, but is not necessary.... Make it a HTMLWindow instead of a TextArea example.rsrc.py by doing more or less what I described above {'type':'CustomDialog', 'name':'Template', 'title':'Dialog Template', 'position':(519, 120), 'size':(342, 301), 'components': [ {'type':'TextArea', 'name':'TextArea1', 'position':(10, 10), 'size':(309, 177), 'alignment':'left', 'font':{'faceName': 'Courier', 'family': 'sansSerif', 'size': 8}, 'text':'this is sample\ntext to show\nit is constant width\nmmmmmmmmmmmmmm\niiiiiiiiiiiiiiiii\n', }, {'type':'Button', 'id':5100, 'name':'btnOK', 'position':(75, 204), 'label':'OK', }, {'type':'Button', 'id':5101, 'name':'btnCancel', 'position':(177, 203), 'label':'Cancel', }, ] # end components } # end CustomDialog corresponding mydialog.py (note - slight editing needed to get this - basically just fixup the parameters and add the setting of self.components.TextArea1.text) from PythonCardPrototype import model class MyDialog(model.CustomDialog): def __init__(self, parent, txt=''): model.CustomDialog.__init__(self, parent) self.components.TextArea1.text = txt # if some special setup is necessary, do it here # example from samples/dialogs/minimalDialog.py # self.components.field1.text = txt #def myDialog(parent, txt): def myDialog(parent, txt): dlg = MyDialog(parent, txt) dlg.showModal() result = {'accepted':dlg.accepted()} # stick your results into the result dictionary here # example from samples/dialogs/minimalDialog.py # result['text'] = dlg.components.field1.text dlg.destroy() return result and finally the code snippet from the program itself (I added a button "showdialog" to trigger it) def on_showdialog_mouseClick(self, event): result = mydialog.myDialog(self, self.thestring) print result and sure enough it comes up, and is in Courier font. Hope this helps -- Alex. |
From: Schollnick, B. <Ben...@us...> - 2004-06-21 14:05:38
|
> > I'm probably missing something simple here.... > > > You could use a custom dialog, and use an HTMLWindow inside > it. If you even > need it to be a dialog - might be just as easy to display the > file within > the primary window ? Maybe a silly question... But I do not see a easy way to make a custom dialog? I guess I could power up resourceditor, make a "second" application that looks like a custom dialog... But I would think there has to be a simple way to do that? The goal here is: * Switch to a monospaced font. The Scrolled Window font is completely ruining any "table" design that I setup due to the non-monospaced font... I just looked again and there is no wxpython nor pythoncard documentation that talks about setting up the font for those dialogs... * Maybe some other font "goodies"... HTML would be nice, but is not necessary.... - Benjamin |
From: Alex T. <al...@tw...> - 2004-06-18 18:52:49
|
At 09:39 18/06/2004 -0400, Schollnick, Benjamin wrote: >Folks, > > I'm probably missing something simple here.... > > I am working on a file viewer, and using a scrolledMessagedialog... > >PythonCardPrototype.dialog.scrolledMessageDialog (self, "".join(display), >"License File Contents") > > And while I am mainly using ASCII text, I would like to add some >"spice" and flavor to the text. This could be as simple as Bold, etc, but I >do not see any options documented regarding how to control the text display >in the ScrolledMessageDialog Windows... > > I even checked the WxPython pages, and do not see anything there >talking about the text format of the scrolledMessage Windows.... > > Am I limited to pure ASCII? no HTML, or other tricks to support >anything else? You could use a custom dialog, and use an HTMLWindow inside it. If you even need it to be a dialog - might be just as easy to display the file within the primary window ? (I haven't actually used an HTMLWindow yet - but I used FindFiles on the samples directory, searched for "html" and took it from there ..... looks like it should be straightforward .... If you haven't used it, FindFiles is *really* useful to find examples of almost anything within PythonCard's own programs and samples.) -- Alex Tweedly. |
From: Schollnick, B. <Ben...@us...> - 2004-06-18 13:39:37
|
Folks, I'm probably missing something simple here.... I am working on a file viewer, and using a scrolledMessagedialog... PythonCardPrototype.dialog.scrolledMessageDialog (self, "".join(display), "License File Contents") And while I am mainly using ASCII text, I would like to add some "spice" and flavor to the text. This could be as simple as Bold, etc, but I do not see any options documented regarding how to control the text display in the ScrolledMessageDialog Windows... I even checked the WxPython pages, and do not see anything there talking about the text format of the scrolledMessage Windows.... Am I limited to pure ASCII? no HTML, or other tricks to support anything else? - Benjamin |
From: Alex T. <al...@tw...> - 2004-06-15 18:23:57
|
I replied on this thread a couple of days ago, but the message didn't get to the list (it did get to Kevin - he replied and it's now a separate thread .... sorry for any confusion in the archives). Here's the final result ... At 16:25 12/06/2004 -0700, Kevin Altis wrote: >That sounds like a fun sample. If you want to post a URL where people can >download it I'll add it to the PythonCard More Apps page or if suitable we >can even make it a sample and include it with PythonCard. It's now available (source code only) at www.tweedly.net/Python -- Alex Tweedly. |
From: Kevin A. <al...@se...> - 2004-06-15 17:33:10
|
I stopped coding a few weeks ago while waiting on the next release of wxPython. Robin has already done one preliminary build of 2.5.2.x for people on wxPython-dev and will do more next week, which is when I'll start testing it. I will be away from email tomorrow - Monday. When I get back and can start testing the next wxPython release I will start looking at doing some kind of interim 0.8 release so people not working from cvs can start testing and give some feedback. BTW, in addition to OSCON 2004/Python 12 which is being held in Portland, Oregon at the end of July I will also be attending the VanPy Workshop in Vancouver, BC immediately following OSCON. VanPy runs from Saturday (July 31st) - Monday (August 2nd). The VanPy organizers convinced me to do a presentation on PythonCard. http://conferences.oreillynet.com/os2004/ http://www.vanpyz.org/conference/index.html Note that early-bird registration discounts for OSCON end this Friday, June 18th and the VanPy early-bird registration ends June 30th. ka |
From: Kevin A. <al...@se...> - 2004-06-14 18:41:43
|
On Jun 14, 2004, at 10:56 AM, Luis M. Gonzalez wrote: > Hello people! > > I just discovered Pythoncard yesterday and I fell in love with it. > I agree that there are a lot of room for improvement, but anyway, it is > great just the way it is now. > Very easy, very simple, very python... > > Well, the only problem I have is how to get rid of the annoying DOS > box when > starting a program. > I managed to hide it by setting the coordinate of its position out of > the > screen's range, but I'm sure there's a better way to do it... > (please forgive my bad English..) > > Any hint would be highly appreciated... > This is a Python FAQ. If you run a Python script on Windows with pythonw.exe instead of python.exe then you won't get a "DOS" console. You can also change the extension of your script to .pyw, which will also avoid the console appearing. Note that you probably want to have a console appear unless you have completely debugged your program since you won't see any exceptions or error messages displayed without a console window. ka |
From: Luis M. G. <lu...@gm...> - 2004-06-14 17:56:36
|
Hello people! I just discovered Pythoncard yesterday and I fell in love with it. I agree that there are a lot of room for improvement, but anyway, it is great just the way it is now. Very easy, very simple, very python... Well, the only problem I have is how to get rid of the annoying DOS box when starting a program. I managed to hide it by setting the coordinate of its position out of the screen's range, but I'm sure there's a better way to do it... (please forgive my bad English..) Any hint would be highly appreciated... |
From: Kevin A. <al...@se...> - 2004-06-12 23:26:21
|
On Jun 12, 2004, at 1:49 PM, Alex Tweedly wrote: > At 14:50 07/06/2004 -0700, Kevin Altis wrote: > >> On Jun 7, 2004, at 11:34 AM, Alex Tweedly wrote: >> >> >>> Is there an easy way to "clone" a button ? [ ... ] >>> Any suggestions ? >> You were on the right track. What you want is the starting resource >> for the component or alternatively, iterate over the keys of the >> attributes (baseBtn._spec.getAttributes()) and use the ones you want >> from the component. > > Thanks for the help Kevin (took me a few days to get time to try it > all out properly). > > I ran into a problem with this first suggestion - couldn't figure out > how to get the info I needed out of it - decided to wait until I had > more experience looking through the PCard source before tackling this > one. On to Plan B ... Check out the code in samples/widgets/widgets.py to see how getAttributes is used to create component spec docs. That should give you some ideas. > >> If the component attributes may have changed since initialization, >> then the associated resource description will be out of sync, but >> that doesn't sound like an issue for what you're trying to do. If you >> look at the Widget class in the widget.py module, you'll see that the >> starting resource is stored in a private variable called _resource. >> So what you want is to use that. Since _resource is actually an >> instance of the Resource class, go ahead and grab the dictionary >> directly, then modify as necessary for the new components you create. > > widget.py has no mention of a variable called "_resource" My bad on the suggestion above, I was working from the PythonCard source in cvs which will become PythonCard release 0.8. As you found the _resource instance variable isn't in release 0.7.3.1. >> baseResource = self.component.baseBtn._resource.__dict__ >> # shallow copy >> tBtn = baseResource.copy() >> ... >> self.components[tBtn.name] = tBtn > > and naturally this complained about _resource. > OK - once again I need to spend some time reading through source code > before I'm ready for this one. > On to Plan C ... > >> You can also look at the on_componentDuplicate_command and >> copyWidgetDescriptionToClipboard methods in the resourceEditor.py >> file if you want to get some ideas about how you could roll your own >> "create array" command for the resourceEditor. > > This worked a treat ! > I didn't actually add anything to the resource editor - but lifted the > code from there to put into my application. I now have a nice little > function that takes a button and a static box, and spreads an array of > buttons to fill the box. > > My "Boggle" game is much cleaner now - Thanks again. > > -- Alex Tweedly. > That sounds like a fun sample. If you want to post a URL where people can download it I'll add it to the PythonCard More Apps page or if suitable we can even make it a sample and include it with PythonCard. http://pythoncard.sourceforge.net/moreapplications.html ka |
From: Kevin A. <al...@se...> - 2004-06-07 21:50:34
|
On Jun 7, 2004, at 11:34 AM, Alex Tweedly wrote: > > Is there an easy way to "clone" a button ? > > I want to have a grid (array) of buttons (or ImageButtons), which=20 > should be all same type, size, etc.=A0=A0 Ideally, I'd use the "array"=20= > feature in the Resource Editor :-) > > Since that doesn't exist,=A0 I decide to create them in the program=20= > start-up, so that if I later want to change the size, spacing, etc. I=20= > can do so easily. > > I thought I might get lucky, and tried > > basename =3D self.component.baseBtn.name > (basex, basey) - self.components.baseBtn.position > for row in range(5): > =A0=A0 for col in range(5): > =A0=A0=A0=A0=A0 tBtn =3D copy.copy(self.components.baseBtn) > =A0=A0=A0=A0=A0 tBtn.name =3D basename + "_%02d%02d" * (row, col) > =A0=A0=A0=A0=A0 tBtn.position =3D (basey+50*row, basex + 50*col) > =A0=A0=A0=A0=A0 self.components[tBtn.name] =3D tBtn > > or something like that. Of course, that fails, the components are not=20= > a simple dictionary. > > So my next thought was more like > > basename =3D self.component.baseBtn.name > (basex, basey) - self.components.baseBtn.position > for row in range(5): > =A0=A0 for col in range(5): > =A0=A0=A0=A0=A0 tBtn =3D {} > =A0=A0=A0=A0=A0 # copy all existing attributes > =A0=A0=A0=A0=A0 for k,v in self.components.baseBtn.iteritems(): > =A0=A0=A0=A0=A0=A0=A0=A0 tBtn[k] =3D v > =A0=A0=A0=A0=A0 # and fix-up as needed > =A0=A0=A0=A0=A0 tBtn.name =3D basename + "_%02d%02d" * (row, col) > =A0=A0=A0=A0=A0 tBtn.position =3D (basey+50*row, basex + 50*col) > =A0=A0=A0=A0=A0 self.components[tBtn.name] =3D tBtn > > But that also fails - can't get an iteritems() from components. > > Any suggestions ? > You were on the right track. What you want is the starting resource=20 for the component or alternatively, iterate over the keys of the=20 attributes (baseBtn._spec.getAttributes()) and use the ones you want=20 from the component. If the component attributes may have changed since=20= initialization, then the associated resource description will be out of=20= sync, but that doesn't sound like an issue for what you're trying to=20 do. If you look at the Widget class in the widget.py module, you'll see=20= that the starting resource is stored in a private variable called=20 _resource. So what you want is to use that. Since _resource is actually=20= an instance of the Resource class, go ahead and grab the dictionary=20 directly, then modify as necessary for the new components you create. baseResource =3D self.component.baseBtn._resource.__dict__ # shallow copy tBtn =3D baseResource.copy() ... self.components[tBtn.name] =3D tBtn You can also look at the on_componentDuplicate_command and=20 copyWidgetDescriptionToClipboard methods in the resourceEditor.py file=20= if you want to get some ideas about how you could roll your own "create=20= array" command for the resourceEditor. ka= |
From: Alex T. <al...@tw...> - 2004-06-07 18:29:29
|
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.699 / Virus Database: 456 - Release Date: 04/06/2004 |
From: Kevin A. <al...@se...> - 2004-06-05 17:50:55
|
On Jun 5, 2004, at 9:50 AM, Tony Maniaci wrote: > I followed the instructions for Mac OS 10.3 Panther and the Pythoncard > and wxPython folders are in the site packages folder but when a double > click on a py app it does not find wx, it can't import wx. > Well there are a number of possible problems. Can you run the wxPython demo? Which version of wxPython is installed? Can you run Pythoncard apps from the command-line? For example: [mac:~/python/PythonCard] altis% pythonw samples/minimal/minimal.py If you can run from the command-line, but not from the Finder, then I'm assuming what is messed up is your PythonLauncher setup and you need to recheck that. If you had an older version of Python and wxPython on your box, perhaps because you upgraded from Jaguar to Panther, then there could be a problem with multiple versions of conflicting libs and paths. Just for completeness, here is what Python and wxPython report for me, again from the command-line shell. [mac:~/python/PythonCard] altis% pythonw Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from wxPython import wx >>> wx.__version__ '2.5.1.5' ka |
From: Tony M. <tma...@tr...> - 2004-06-05 17:13:24
|
I followed the instructions for Mac OS 10.3 Panther and the Pythoncard and wxPython folders are in the site packages folder but when a double click on a py app it does not find wx, it can't import wx. |
From: Tim B. <tb...@bi...> - 2004-06-03 16:10:18
|
These are good points, Steven. My app is obviously very vulnerable. The good news (for me) is that (a) my app will not leave these walls, and (b) I trust my end users to refrain from inserting malicious statements into their constants file. Even so, I should probably heed your warning and make the system a little more robust. Thanks, Tim |
From: Steven D'A. <st...@cy...> - 2004-06-03 02:24:31
|
On Tue, Jun 01, 2004 at 01:05:31PM -0700, Tim Black wrote: > But I wanted to be able to > empower the user to dynamically update the constants used in their app > without having to update the entire distribution folder. So I made the > following change: If this is aimed an end users, then this is an enormous security hole, and if your application ever becomes popular, then you can guarantee that somebody will find a way to take advantage of it. What happens when users edit your Constants file and accidently trash the file, or delete many of the constants that you rely on? What happens if, instead of being careless, a malicious user gets access to another person's PC and edits their Constants file to include Python code which breaks your code? Or worse, manages to get a line like: import shutil; shutil.rmtree("/") into the Constants file? Python has total access to your user's machine. It doesn't run in a sand-box like Java. If you and your users are comfortable with giving your program the ability to reformat their disk, delete files, launch applications, install software or similar, then using exec and execfile is acceptable. Otherwise, the safe way to implement user updated data will be something like this: - read your default constants from a Python file. Since you control the file, it is as safe as any Python app can be. - look for a configuration file from the user in the appropriate places, eg $HOME/myconfig.ini under Linux, C:/My Documents And Settings/ under Windows, etc. - if the file exists, read updated constants only from it. Do not use exec or execfile unless you can guarentee the file is safe. If the file is trashed, your application can give a warning and then just ignore the errors. Python has a module for reading ini files. Use it, or write your own. -- Steven D'Aprano Operations Manager Cybersource Pty Ltd, ABN 13 053 904 082 Level 4, 10-16 Queen St, Melbourne VIC 3000 Tel: +61 3 9621 2377 Fax: +61 3 9621 2477 Web: http://www.cybersource.com.au |
From: Tim B. <tb...@bi...> - 2004-06-02 22:58:03
|
I believe that my console-less py2exe-generated wxPython and PythonCard standalones are crashing because of unhandled FutureWarnings(explanation below). Does anyone know if/how FutureWarnings would/would not be handled in a console-less py2exe-generated wxPython and PythonCard standalones? I recently added some eval and execfile calls at the top of some of my apps to allow the dynamic evaluation of constants contained in an external file provided in its distribution. The resulting apps ran wonderfully under python.exe, pythonw.exe, and even the console version of the py2exe app. But the console-less version of the py2exe app crashes. It turned out that the problem was that one of the statements I was evaluating generated an unhandled FutureWarning. Each eval is inside a try/except block, but I was only attempting to catch exceptions.StandardError. When I remove the line that was generating the FutureWarning, the console-less version of the py2exe app works fine. This behaviour can be reproduced by sticking: eval(compile("x=0xffffffff","","single")) into the top of any wxPython or PythonCard app and building it into a console-less standalone. Presumably, these warnings are what caused my console-less py2exe app crash. So, a couple questions: 1. Why would FutureWarnings be treated so fatal in a console-less py2exe app? In the console py2exe app, the FutureWarning is just printed to the console and the app proceeds happily. 2. I would like to make my dynamic code execution more robust to these warnings, but I have not been able to successfully catch them. I can see that FutureWarning is in the built-in namespace as well as in the exceptions module, but when I try: eval(compile("x=0xffffffff","","single")) except FutureWarning: print "caught it!" OR try: eval(compile("x=0xffffffff","","single")) except exceptions.FutureWarning: print "caught it!" , the warning is not caught. This might be a more general Python question, but how does one catch and/or ignore FutureWarnings? Thanks, Tim |
From: Ruben M. <rmc...@ya...> - 2004-06-02 20:45:42
|
--- Tim Black wrote: > The only difference is the main app source file > parameter in my setup > distutils script is changed from "console" to > "windows". Well, the only thing I can think of is to add a try/except block to your app and have the traceback writen to a file so that you can read it. -Ruben __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
From: Tim B. <tb...@bi...> - 2004-06-02 15:51:36
|
The only difference is the main app source file parameter in my setup distutils script is changed from "console" to "windows". So I change from: setup( name = "Messenger", console = ["Messenger.py"], data_files = [(".", [ "Readme.txt", "Format.txt", "Tim.ico", "Messenger.rsrc.py", "Constants.py" ] ) ] ) to: setup( name = "Messenger", windows = ["Messenger.py"], data_files = [(".", [ "Readme.txt", "Format.txt", "Tim.ico", "Messenger.rsrc.py", "Constants.py" ] ) ] ) All the extra data_files are in the same directory as the main app script file. Tim -----Original Message----- From: Ruben Marquez [mailto:rmc...@ya...] Sent: Wednesday, June 02, 2004 7:51 AM To: PythonCard Mailing List Subject: Re: [Pythoncard-users] evaluating compiled Python expressions makes my py2exe-compiled P ythonCard app crash --- Tim Black wrote: > fine under python.exe, > pythonw.exe, and the py2exe-generated console .exe, > but the windows .exe > won't run. What is the difference between how you build the py2exe-generated console .exe and the windows .exe? -Ruben __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Pythoncard-users mailing list Pyt...@li... https://lists.sourceforge.net/lists/listinfo/pythoncard-users |
From: Ruben M. <rmc...@ya...> - 2004-06-02 14:51:19
|
--- Tim Black wrote: > fine under python.exe, > pythonw.exe, and the py2exe-generated console .exe, > but the windows .exe > won't run. What is the difference between how you build the py2exe-generated console .exe and the windows .exe? -Ruben __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |