From mark.melvin at gmail.com Mon Jun 13 15:52:21 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Mon, 13 Jun 2011 09:52:21 -0400 Subject: [Pygui] 30 second delay when creating main app Message-ID: Hi All, I've noticed recently since upgrading to PyGUI 2.4, there seems to be a 30 second delay when creating my main application. Is seems to be when I call the constructor for Application, but I don't recall it ever doing this before. I can't figure out what is causing the delay. Is there a debug mode or something I can do to narrow this down? I am on Windows XP with Python 2.5. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Jun 14 01:14:40 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 14 Jun 2011 11:14:40 +1200 Subject: [Pygui] 30 second delay when creating main app In-Reply-To: References: Message-ID: <4DF699E0.6070502@canterbury.ac.nz> Mark Melvin wrote: > I've noticed recently since upgrading to PyGUI 2.4, there seems to be a > 30 second delay when creating my main application. ... Is there a > debug mode or something I can do to narrow this down? No, you'll just have to use good old-fashioned debugging techniques, e.g. putting print statements in the code to see where it's getting to before it pauses. -- Greg From greg.ewing at canterbury.ac.nz Tue Jun 14 13:16:47 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 14 Jun 2011 23:16:47 +1200 Subject: [Pygui] Solved: Window Always Starts Behind Others In-Reply-To: References: <4D8CDE4A.9080001@inteli-com.com> <4D8D331D.4080103@canterbury.ac.nz> Message-ID: <4DF7431F.8010101@canterbury.ac.nz> Mark Melvin wrote: > However, it still pops up behind the console window I launch it from, > and the py2exe'd executable version of the application pops up behind > the Windows Explorer window from which I launched it. After much uprooting of hair, I found out what was causing this. It turns out to be a bizarre side effect of the support I put in recently for printing, of all things! I'll be making a new release soon that incorporates a fix. In the meantime, if you're not interested in printing, you should be able to patch around it by commenting out the line of Application.__init__ in GUI/Generic/GApplications.py that looks like this: self.page_setup = PageSetup() -- Greg From mark.melvin at gmail.com Tue Jun 14 15:50:49 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Tue, 14 Jun 2011 09:50:49 -0400 Subject: [Pygui] Solved: Window Always Starts Behind Others In-Reply-To: <4DF7431F.8010101@canterbury.ac.nz> References: <4D8CDE4A.9080001@inteli-com.com> <4D8D331D.4080103@canterbury.ac.nz> <4DF7431F.8010101@canterbury.ac.nz> Message-ID: On Tue, Jun 14, 2011 at 7:16 AM, Greg Ewing wrote: > Mark Melvin wrote: > >> However, it still pops up behind the console window I launch it from, and >> the py2exe'd executable version of the application pops up behind the >> Windows Explorer window from which I launched it. >> > > After much uprooting of hair, I found out what was causing this. > It turns out to be a bizarre side effect of the support I put > in recently for printing, of all things! > > I'll be making a new release soon that incorporates a fix. > In the meantime, if you're not interested in printing, you > should be able to patch around it by commenting out the line > of Application.__init__ in GUI/Generic/GApplications.py > that looks like this: > > self.page_setup = PageSetup() > > > Hi Greg, Excellent. And guess what? That fixes my 30 second startup issue as well. It all makes sense now. We recently had a print server go down, and bringing up the printer dialog for my default network printer now takes....you guessed it - about 30 seconds! Thanks for the double fix! ;-) Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Fri Jun 17 05:18:28 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Fri, 17 Jun 2011 15:18:28 +1200 Subject: [Pygui] ANN: PyGUI 2.5 Message-ID: <4DFAC784.1010609@canterbury.ac.nz> PyGUI 2.5 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Lots of new stuff in this version. Highlights include: - Improved facilities for customising the standard menus. - Functions for creating PyGUI Images from PIL images and numpy arrays. - ListButton - a pop-up or pull-down menu of choices. - GridView - a user-defined view consisting of a regular grid of cells. - PaletteView - a GridView specialised for implementing tool palettes. There is also a big pile of other improvements and bug fixes. See the CHANGES file for full details. What is PyGUI? -------------- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. -- Gregory Ewing greg.ewing at canterbury.ac.nz http://www.cosc.canterbury.ac.nz/greg.ewing/ From baykiwi at gmail.com Fri Jun 17 13:21:20 2011 From: baykiwi at gmail.com (Colin Brown) Date: Fri, 17 Jun 2011 23:21:20 +1200 Subject: [Pygui] Installing PyGUI-2.5 on Mac OSX 10.5.8 fails Message-ID: <9DF6A6F7-948E-4DB9-A585-F0EE01E60598@gmail.com> Macintosh:PyGUI-2.5 colin$ python setup.py install Traceback (most recent call last): File "setup.py", line 12, in from distutils_extensions import pygui_build_py ImportError: No module named distutils_extensions From emanuel.angelo at gmail.com Fri Jun 17 21:57:55 2011 From: emanuel.angelo at gmail.com (Emanuel Angelo) Date: Fri, 17 Jun 2011 20:57:55 +0100 Subject: [Pygui] Installing PyGUI-2.5 on Mac OSX 10.5.8 fails In-Reply-To: <9DF6A6F7-948E-4DB9-A585-F0EE01E60598@gmail.com> References: <9DF6A6F7-948E-4DB9-A585-F0EE01E60598@gmail.com> Message-ID: Same thing with Ubuntu 11.04, 64bit. Emanuel Angelo OpenPGP ID: 8437C18E 2011/6/17 Colin Brown > Macintosh:PyGUI-2.5 colin$ python setup.py install > Traceback (most recent call last): > File "setup.py", line 12, in > from distutils_extensions import pygui_build_py > ImportError: No module named distutils_extensions > ______________________________**_________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/**mailman/listinfo/pygui > -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Sat Jun 18 06:31:28 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sat, 18 Jun 2011 16:31:28 +1200 Subject: [Pygui] Installing PyGUI-2.5 on Mac OSX 10.5.8 fails In-Reply-To: <9DF6A6F7-948E-4DB9-A585-F0EE01E60598@gmail.com> References: <9DF6A6F7-948E-4DB9-A585-F0EE01E60598@gmail.com> Message-ID: <4DFC2A20.6080806@canterbury.ac.nz> Colin Brown wrote: > Macintosh:PyGUI-2.5 colin$ python setup.py install > Traceback (most recent call last): > File "setup.py", line 12, in > from distutils_extensions import pygui_build_py > ImportError: No module named distutils_extensions Sorry about that! The missing file is attached, and I'll upload a fixed distribution soon. -- Greg -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: distutils_extensions.py URL: From greg.ewing at canterbury.ac.nz Sat Jun 18 07:05:39 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sat, 18 Jun 2011 17:05:39 +1200 Subject: [Pygui] [Pyobjc-dev] ANN: PyGUI 2.5 In-Reply-To: References: <4DFAC784.1010609@canterbury.ac.nz> Message-ID: <4DFC3223.4050702@canterbury.ac.nz> Invisible Bob wrote: > I am on the PyObjC list and got this email, will it work on an > i-(phone/touch)? I have absolutely no idea. Someone will have to try it to find out. -- Greg From greg.ewing at canterbury.ac.nz Sat Jun 18 08:14:30 2011 From: greg.ewing at canterbury.ac.nz (Gregory Ewing) Date: Sat, 18 Jun 2011 18:14:30 +1200 Subject: [Pygui] ANN: PyGUI 2.5.1 Message-ID: <4DFC4246.2060502@canterbury.ac.nz> PyGUI 2.5.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Minor update to fix missing distutils_extensions.py file. What is PyGUI? -------------- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. -- Gregory Ewing greg.ewing at canterbury.ac.nz http://www.cosc.canterbury.ac.nz/greg.ewing/ This email may be confidential and subject to legal privilege, it may not reflect the views of the University of Canterbury, and it is not guaranteed to be virus free. If you are not an intended recipient, please notify the sender immediately and erase all copies of the message and any attachments. Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more information. From mark.melvin at gmail.com Mon Jun 20 23:43:30 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Mon, 20 Jun 2011 17:43:30 -0400 Subject: [Pygui] Cannot Exit Application Process Message-ID: Hi There, I just upgraded to the latest PyGUI and I find that when I run my application now, I cannot exit it. All of the system menus are disabled, and if I click the Close button in the top right corner, the application window closes, but the console stays there and Python will not exit unless I kill the process. I have narrowed this down to the way I import the main Application class. If you take the 01-application.py sample and change the import line to the following: from GUI.Applications import Application from GUI.Windows import Window Then run the sample, all menu items will be disabled and it will hang on exit. Is this import structure not allowed with the module loading changes? I was only doing it to make py2exe work. (I am on Windows XP with Python 2.5) Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Jun 21 00:19:55 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 21 Jun 2011 10:19:55 +1200 Subject: [Pygui] Cannot Exit Application Process In-Reply-To: References: Message-ID: <4DFFC78B.1070508@canterbury.ac.nz> Mark Melvin wrote: > If you take the > 01-application.py sample and change the import line to the following: > > from GUI.Applications import Application > from GUI.Windows import Window That doesn't work any more. You must import them directly from the GUI namespace: from GUI import Application from GUI import Window See the notes on 2.5 modifications in CHANGES.txt for full details > I was only doing it to make py2exe work. You don't have to do that any more. Py2exe and py2app will find them automatically now if you import them as shown. -- Greg From sidney at sidney.com Tue Jun 21 11:21:13 2011 From: sidney at sidney.com (Sidney Markowitz) Date: Tue, 21 Jun 2011 21:21:13 +1200 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: <4DE0B884.10206@canterbury.ac.nz> References: <4DE0B884.10206@canterbury.ac.nz> Message-ID: <4E006289.2010801@sidney.com> Greg Ewing wrote, On 28/05/11 8:55 PM: > Can anyone think of an efficient way to convert a string > full of RGBA image data to BGRA, using only what's available > in the standard library? How fast is this approach compared to what you have tried? input = cStringIO.StringIO(myrgba) c1 = input.read(1) while c1: c2 = input.read(1) c3 = input.read(1) c4 = input.read(1) output.write(c3) output.write(c2) output.write(c1) output.write(c4) c1 = input.read(1) mybgra = output.getvalue() From sidney at sidney.com Tue Jun 21 12:15:35 2011 From: sidney at sidney.com (Sidney Markowitz) Date: Tue, 21 Jun 2011 22:15:35 +1200 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: <4DE0B884.10206@canterbury.ac.nz> References: <4DE0B884.10206@canterbury.ac.nz> Message-ID: <4E006F47.3010006@sidney.com> I suppose it is obvious, but to be complete here is the code again with a few lines I accidentally left out import cStringIO myrgba = "rgbaRGBA1234" output = cStringIO.StringIO() input = cStringIO.StringIO(myrgba) c1 = input.read(1) while c1: c2 = input.read(1) c3 = input.read(1) c4 = input.read(1) output.write(c3) output.write(c2) output.write(c1) output.write(c4) c1 = input.read(1) mybgra = output.getvalue() From sidney at sidney.com Tue Jun 21 13:00:54 2011 From: sidney at sidney.com (Sidney Markowitz) Date: Tue, 21 Jun 2011 23:00:54 +1200 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: <4E006F47.3010006@sidney.com> References: <4DE0B884.10206@canterbury.ac.nz> <4E006F47.3010006@sidney.com> Message-ID: <4E0079E6.60902@sidney.com> Not so fast after all. I ended up comparing it with using PIL. Here is a complete test and the results: import timeit from PIL import Image import cStringIO myrgba = "rgbaRGBA1234"*512*512 mybgra = "" def csconv(): global myrgba global mybgra input = cStringIO.StringIO(myrgba) output = cStringIO.StringIO() c1 = input.read(1) while c1: c2 = input.read(1) c3 = input.read(1) c4 = input.read(1) output.write(c3) output.write(c2) output.write(c1) output.write(c4) c1 = input.read(1) mybgra = output.getvalue() def pilconv(): global myrgba global mybgra im = Image.fromstring("RGBA", (1536, 512), myrgba, "raw", "BGRA") mybgra = im.tostring() t1 = timeit.Timer(csconv) t2 = timeit.Timer(pilconv) print "With cStringIO: ", t1.timeit(1) And the output on my first gen MacBook was With cStringIO: 4.43397188187 With PIL: 0.0196070671082 From imageguy1206 at gmail.com Tue Jun 21 14:23:14 2011 From: imageguy1206 at gmail.com (geoff) Date: Tue, 21 Jun 2011 09:23:14 -0300 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: <4DE0B884.10206@canterbury.ac.nz> References: <4DE0B884.10206@canterbury.ac.nz> Message-ID: On Sat, May 28, 2011 at 5:55 AM, Greg Ewing wrote: > Can anyone think of an efficient way to convert a string > full of RGBA image data to BGRA, using only what's available > in the standard library? > > I'm trying to add a function to PyGUI for creating an Image > object from arbitrary data. The problem I'm having is that > GDI+ on Windows expects BGRA, whereas most other platforms > deal with RGBA. I don't want to require the user to supply > the data in different formats on different platforms, so > PyGUI needs to be able to convert where necessary. > > I know the conversion can be done easily using something > like PIL or numpy, but I'm after a solution that doesn't > depend on any third-party libraries. > > -- > Greg > ______________________________**_________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/**mailman/listinfo/pygui > Greg, I had to solve this problem in another application and ended up using the array module and the with the slice syntax. import array input = "rgbaRGBA1234" ba = array.array('c', input) ba[0::4], ba[2::4] = ba[2::4], ba[0::4] print ba.tostring() >> bgraBGRA3214 It is fairly fast too. Good luck and keep up the great work. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.melvin at gmail.com Tue Jun 21 16:44:29 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Tue, 21 Jun 2011 10:44:29 -0400 Subject: [Pygui] Cannot Exit Application Process In-Reply-To: <4DFFC78B.1070508@canterbury.ac.nz> References: <4DFFC78B.1070508@canterbury.ac.nz> Message-ID: On Mon, Jun 20, 2011 at 6:19 PM, Greg Ewing wrote: > Mark Melvin wrote: > >> If you take the 01-application.py sample and change the import line to the >> following: >> >> from GUI.Applications import Application >> from GUI.Windows import Window >> > > That doesn't work any more. You must import them directly > from the GUI namespace: > > from GUI import Application > from GUI import Window > > See the notes on 2.5 modifications in CHANGES.txt for full > details > > > I was only doing it to make py2exe work. >> > > You don't have to do that any more. Py2exe and py2app will > find them automatically now if you import them as shown. > > OK - my app closes without hanging now. I'll try py2exe and see if the new import scheme works. Thanks! Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.melvin at gmail.com Tue Jun 21 17:49:22 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Tue, 21 Jun 2011 11:49:22 -0400 Subject: [Pygui] 2.5.1 issues Message-ID: Hi There, I am trying out the new ListButton item on Windows XP (Python 2.5). I have a list of 23 items that I am using to create a ListButton. The problem is, it only seems to ever show me 18 items at once. And it shows me a different group of items depending on what is selected in the list. Also, it seems there is another bug in 2.5.1...when I run my GUI from a console, as soon as I click on another window and my app loses focus, it shuts down. I tried running some of the examples in the Tests folder and they all do the same thing. Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sidney at sidney.com Tue Jun 21 20:26:55 2011 From: sidney at sidney.com (Sidney Markowitz) Date: Wed, 22 Jun 2011 06:26:55 +1200 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: References: <4DE0B884.10206@canterbury.ac.nz> Message-ID: <4E00E26F.7000401@sidney.com> geoff wrote, On 22/06/11 12:23 AM: > Greg, I had to solve this problem in another application and ended up using > the array module and the with the slice syntax. That works quite well, just 3.5 times slower than PIL. Adding it to the test I posted before (with a slight tweak to the cStringIO version to assign (c1,c2,c3,c4) = instead of four separate assignments), which saves about 0.3 seconds: With cStringIO: 4.10693502426 With PIL: 0.019492149353 With array slice: 0.0696752071381 From greg.ewing at canterbury.ac.nz Wed Jun 22 01:18:20 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 22 Jun 2011 11:18:20 +1200 Subject: [Pygui] Convert RGBA to BGRA using standard library? In-Reply-To: References: <4DE0B884.10206@canterbury.ac.nz> Message-ID: <4E0126BC.806@canterbury.ac.nz> geoff wrote: > Greg, I had to solve this problem in another application and ended up > using the array module and the with the slice syntax. > > import array > > input = "rgbaRGBA1234" > ba = array.array('c', input) > ba[0::4], ba[2::4] = ba[2::4], ba[0::4] Yep, I was thinking the same thing myself. I'll give it a try next time I'm working on the problem. Thanks, Greg From greg.ewing at canterbury.ac.nz Wed Jun 22 01:47:44 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 22 Jun 2011 11:47:44 +1200 Subject: [Pygui] 2.5.1 issues In-Reply-To: References: Message-ID: <4E012DA0.101@canterbury.ac.nz> Mark Melvin wrote: > I am trying out the new ListButton item on Windows XP (Python 2.5). I > have a list of 23 items that I am using to create a ListButton. The > problem is, it only seems to ever show me 18 items at once. Does it let you scroll the list? ListButton on Windows is implemented using a ComboBox control, so it has whatever behaviour you get from that. There are some oddities, for example it seems that the initial height given to the Windows control object determines the maximum height of the drop-down box. Currently, PyGUI picks an arbitrary value for this that seems reasonable; I might provide a way to customise it at some point. > Also, it seems there is another bug in 2.5.1...when I run my GUI from a > console, as soon as I click on another window and my app loses focus, it > shuts down. Argh, you're right. Sorry about that, I'll see what I can do to fix it. -- Greg From greg.ewing at canterbury.ac.nz Wed Jun 22 01:53:26 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 22 Jun 2011 11:53:26 +1200 Subject: [Pygui] PyGUI Example and a New Game Message-ID: <4E012EF6.9030003@canterbury.ac.nz> If anyone would like to see a substantial application built with PyGUI, you might like to take a look at my latest game, currently posted on the Pyggy Awards site: http://pyggy.pyweek.org/e/SimChip/ Any feedback you care to provide on the game would be welcome as well. :-) -- Greg From mark.melvin at gmail.com Thu Jun 23 16:59:53 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Thu, 23 Jun 2011 10:59:53 -0400 Subject: [Pygui] 2.5.1 issues In-Reply-To: <4E012DA0.101@canterbury.ac.nz> References: <4E012DA0.101@canterbury.ac.nz> Message-ID: On Tue, Jun 21, 2011 at 7:47 PM, Greg Ewing wrote: > Mark Melvin wrote: > >> I am trying out the new ListButton item on Windows XP (Python 2.5). I >> have a list of 23 items that I am using to create a ListButton. The problem >> is, it only seems to ever show me 18 items at once. >> > > Does it let you scroll the list? > > No, there is no scrollbar, so it appears that there are only 18 items in the list, even though I added 23, and when I change selection a different group of items are shown. > ListButton on Windows is implemented using a ComboBox control, > so it has whatever behaviour you get from that. There are some > oddities, for example it seems that the initial height given to > the Windows control object determines the maximum height of > the drop-down box. Currently, PyGUI picks an arbitrary value > for this that seems reasonable; I might provide a way to customise > it at some point. > > > Also, it seems there is another bug in 2.5.1...when I run my GUI from a >> console, as soon as I click on another window and my app loses focus, it >> shuts down. >> > > Argh, you're right. Sorry about that, I'll see what I can do to fix > it. > > OK -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Fri Jun 24 07:13:29 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Fri, 24 Jun 2011 17:13:29 +1200 Subject: [Pygui] 2.5.1 issues In-Reply-To: References: <4E012DA0.101@canterbury.ac.nz> Message-ID: <4E041CF9.6000803@canterbury.ac.nz> Mark Melvin wrote: > No, there is no scrollbar, so it appears that there are only 18 items in > the list, On Windows 2000 I can scroll the list using the up and down arrow keys, even though there is no scroll bar. Does that work for you? -- Greg From mark.melvin at gmail.com Fri Jun 24 15:36:32 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Fri, 24 Jun 2011 09:36:32 -0400 Subject: [Pygui] 2.5.1 issues In-Reply-To: <4E041CF9.6000803@canterbury.ac.nz> References: <4E012DA0.101@canterbury.ac.nz> <4E041CF9.6000803@canterbury.ac.nz> Message-ID: On Fri, Jun 24, 2011 at 1:13 AM, Greg Ewing wrote: > Mark Melvin wrote: > >> No, there is no scrollbar, so it appears that there are only 18 items in >> the list, >> > > On Windows 2000 I can scroll the list using the up and down > arrow keys, even though there is no scroll bar. Does that > work for you? > > Hi Greg, Yes - with the keyboard the list will scroll for me. It just isn't obvious at all that there are more than 18 items in the list. Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: