From mark.melvin at gmail.com Thu Feb 3 20:57:45 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Thu, 3 Feb 2011 14:57:45 -0500 Subject: [Pygui] List or Combo Boxes Message-ID: Hi There, I am new to PyGUI, and right off the bat I think I can say that I am going to like this. :) I am impressed with the simplicity of the code involved in making a GUI. I was wondering if anyone has done any work to create the equivalent of a combo box or list box - perhaps using a hacked menu or something? I'm trying to see if I can implement my GUI without them, but I find the very first control I need is a combo box selecting a connection (think of a COM port selection). I guess there are other ways to do it, but combo boxes are just so darn handy... Thanks in advance, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.melvin at gmail.com Sun Feb 6 01:39:10 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Sat, 5 Feb 2011 19:39:10 -0500 Subject: [Pygui] Check 1 2 Message-ID: Hi, My last post never made it to the list (at least not on the archives) - so this is a test before I try another topic. Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Feb 8 21:47:00 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 09 Feb 2011 09:47:00 +1300 Subject: [Pygui] PyGUI Mailing List? In-Reply-To: References: <4D4F0FBC.3040901@canterbury.ac.nz> Message-ID: <4D51ABC4.6000902@canterbury.ac.nz> Mark Melvin wrote: > 1) I was wondering if anyone has done any work to create the equivalent > of a combo box or list box Not that I know of. This seems to be a Frequently Requested Feature though, so I'll try to do something about it soon. > 2) I am having trouble with Menus. I would like to get rid of the main > system menus so I have set the main application "menus" property to an > empty list. This works to get rid of the main menus, but when I assign > a new menu list to either the application or my main window, I see the > menu item, and the key bindings seem to work, but clicking on the menu > does not call the method. Hard to tell what's going on there. If you can send me an example I'll try to find out what's wrong. > And I can't seem to figure out how to exit > the application programmatically. If I override the application's menus > property, the "quit_cmd" doesn't seem to work anymore. I don't know about that one either. Calling the application's quit_cmd() method directly should work regardless of the condition of the menus. > 3) I am having trouble py2exe'ing my application. We a bare-bones > setup.py, my resulting .exe will not run because it fails to locate > GUI.Resources. I ended up adding "packages" : ["GUI"] to my py2exe > options, Yes, you have to do that at the moment, sorry, because py2exe can't follow the dynamic way that PyGUI locates its platform-dependent modules. I'm thinking about ways to improve the situation, but it's not easy. > now when I run it I get an exception dialog from the Microsoft Visual > C++ runtime saying that the application requested the Runtime to > terminate in an unusual way. Not sure what that means. Sounds like there might be a bug in pywin32 or some other dll. It doesn't sound like the sort of thing you should be able to provoke by a mistake in Python coding. Can you find out anything about how far it's getting before crashing? -- Greg From mark.melvin at gmail.com Fri Feb 11 03:09:29 2011 From: mark.melvin at gmail.com (Mark Melvin) Date: Thu, 10 Feb 2011 21:09:29 -0500 Subject: [Pygui] PyGUI Mailing List? In-Reply-To: <4D51ABC4.6000902@canterbury.ac.nz> References: <4D4F0FBC.3040901@canterbury.ac.nz> <4D51ABC4.6000902@canterbury.ac.nz> Message-ID: On Tue, Feb 8, 2011 at 3:47 PM, Greg Ewing wrote: > Mark Melvin wrote: > > 1) I was wondering if anyone has done any work to create the equivalent of >> a combo box or list box >> > > Not that I know of. This seems to be a Frequently Requested Feature > though, so I'll try to do something about it soon. > > > 2) I am having trouble with Menus. I would like to get rid of the main >> system menus so I have set the main application "menus" property to an empty >> list. This works to get rid of the main menus, but when I assign a new menu >> list to either the application or my main window, I see the menu item, and >> the key bindings seem to work, but clicking on the menu does not call the >> method. >> > > Hard to tell what's going on there. If you can send me an example I'll > try to find out what's wrong. > > > And I can't seem to figure out how to exit the application >> programmatically. If I override the application's menus property, the >> "quit_cmd" doesn't seem to work anymore. >> > > I don't know about that one either. Calling the application's quit_cmd() > method directly should work regardless of the condition of the menus. > > > 3) I am having trouble py2exe'ing my application. We a bare-bones >> setup.py, my resulting .exe will not run because it fails to locate >> GUI.Resources. I ended up adding "packages" : ["GUI"] to my py2exe options, >> > > Yes, you have to do that at the moment, sorry, because py2exe can't > follow the dynamic way that PyGUI locates its platform-dependent > modules. I'm thinking about ways to improve the situation, but it's > not easy. > > > now when I run it I get an exception dialog from the Microsoft Visual C++ >> runtime saying that the application requested the Runtime to terminate in an >> unusual way. >> > > Not sure what that means. Sounds like there might be a bug in pywin32 > or some other dll. It doesn't sound like the sort of thing you should > be able to provoke by a mistake in Python coding. Can you find out > anything about how far it's getting before crashing? > > -- > Greg > Hi Greg, By the way - I am on Windows XP. ;) I found the answer to the py2exe problem. It turns out the pythoncom dlls can't be bundled in the EXE. Unbundling them works around the crash. In terms of the menu issue - attached is a small example showing the issues I am seeing. Notice how the mouse does not fire the menu action, but the keybinding does. Also - how would you recommend to properly exit the application from the new File > Exit menu item? Thanks! Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: menus.py Type: application/octet-stream Size: 882 bytes Desc: not available URL: From greg.ewing at canterbury.ac.nz Mon Feb 14 06:44:08 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Mon, 14 Feb 2011 18:44:08 +1300 Subject: [Pygui] PyGUI Mailing List? In-Reply-To: References: <4D4F0FBC.3040901@canterbury.ac.nz> <4D51ABC4.6000902@canterbury.ac.nz> Message-ID: <4D58C128.2000004@canterbury.ac.nz> Mark Melvin wrote: > I see the menu item, and the key > bindings seem to work, but clicking on the menu does not call > the method. I found out what was causing this. Turns out the last item in the last menu in the menu bar has never worked properly on Windows. I'll upload a fixed version soon. In the meantime, you should be able to work around it by adding a dummy item to the end of your menu. > And I can't seem to figure out how to exit the application > programmatically. Putting this line in your on_exit() method seems to work for me: app.quit_cmd() -- Greg From casey.duncan at gmail.com Fri Feb 18 01:22:28 2011 From: casey.duncan at gmail.com (Casey Duncan) Date: Thu, 17 Feb 2011 17:22:28 -0700 Subject: [Pygui] Getting idle events, or periodic time from the event loop Message-ID: Hi PyGUI! I got a little inspiration to write a terminal emulator app today, and I want to give PyGUI a spin as well. My first crack is to just write a dumb terminal that can print the output of the shell process to a window, and then take some input. Later on this is going to get more sophisticated, so this will actually make sense to use a GUI, but bear with me for now. I found a module to handle the actually text part of the terminal handling, so that's nice. It doesn't seem too hard to use a Label or something to draw some text on the screen for a first try, though truth be told, a lower-level font rendering api would be very nice, which is something I could possibly help with at some point, if I get that far. So my PyGUI program creates a window with a view in it. It spawns a subprocess to run the shell that will be displayed in the window. The GUI needs to listen to user events, of course, but it must also poll the subprocess to see if it has generated any output to display. Once I start the application main loop, I don't know how to do this polling. I could do it in a separate thread, but that seems bogus plus I don't know how the thread would communicate back to the main loop, I just want to check the output several times a second, most of the time there will be none. I'm going to be careful not to block the main process by reading from the subprocess only when I know there's data to be read. What I'd like are either idle events, an idle callback hook, or a way to schedule some callable to be executed in the future (like pyglet's clock). Looking at the code, I don't see any way to do this. Any ideas? Thanks. -Casey From greg.ewing at canterbury.ac.nz Fri Feb 18 01:33:00 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Fri, 18 Feb 2011 13:33:00 +1300 Subject: [Pygui] Getting idle events, or periodic time from the event loop In-Reply-To: References: Message-ID: <4D5DBE3C.3090306@canterbury.ac.nz> On 18/02/11 13:22, Casey Duncan wrote: > What I'd like are either idle events, an idle callback hook, or a way > to schedule some callable to be executed in the future (like pyglet's > clock). PyGUI has a Timer class that can be used to make things happen at regular intervals. That's a kludgy way of solving your problem, though. There really needs to be a way to add a file descriptor as an event source for the main event loop. I'll have to do some research to find out how to accomplish this on each platform. -- Greg From vernondcole at gmail.com Tue Feb 22 16:45:12 2011 From: vernondcole at gmail.com (Vernon Cole) Date: Tue, 22 Feb 2011 08:45:12 -0700 Subject: [Pygui] Greg: are you Okay after the earthquake? Message-ID: Greg: The news services say your earthquake was a bad one. I see the Canterbury University server is still up. Are you all right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Wed Feb 23 23:22:49 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Thu, 24 Feb 2011 11:22:49 +1300 Subject: [Pygui] Greg: are you Okay after the earthquake? References: Message-ID: From: pygui-bounces+greg.ewing=canterbury.ac.nz at python.org on behalf of Vernon Cole > Greg: > The news services say your earthquake was a bad one. I see the > Canterbury University server is still up. Are you all right? Yes, I'm fine, thank you. -- Greg 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 greg.ewing at canterbury.ac.nz Sat Feb 26 06:16:47 2011 From: greg.ewing at canterbury.ac.nz (Gregory Ewing) Date: Sat, 26 Feb 2011 18:16:47 +1300 Subject: [Pygui] Possible future direction for PyGUI on Win32 Message-ID: <4D688CBF.5030003@canterbury.ac.nz> Until recently I didn't think it was possible to use .NET libraries from CPython, but then I came across this: http://pythonnet.sourceforge.net/ Using this, it looks like it should be possible to create a PyGUI implementation based on Windows Forms. This has the potential to solve a number of headaches, as it appears to be a considerably more capable library than base win32. The downside is that 2k and XP users may need to install a .NET runtime. How would people feel about that? -- Greg 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 vernondcole at gmail.com Sat Feb 26 16:26:06 2011 From: vernondcole at gmail.com (Vernon Cole) Date: Sat, 26 Feb 2011 08:26:06 -0700 Subject: [Pygui] Possible future direction for PyGUI on Win32 In-Reply-To: <4D688CBF.5030003@canterbury.ac.nz> References: <4D688CBF.5030003@canterbury.ac.nz> Message-ID: Greg: almost all Windows machines already have a .NET runtime installed. I have not seen one in years that did not. I don't think there would be any problem with expecting it. One thing to check on would be startup speed. Pure CLI programs are notoriously slow to bring up the first screen. The other advantage to doing this is ease of porting the package to IronPython. This is not a small thing, since the MONO runtime also works on several portable devices (android and iphone) it would potentially bring PyGUI to portable platforms. I had never looked at pythonnet until your message, but I have to say it looks good. The installation is clunky, but that could be fixed by cloning the code, if worst came to worst. I expect it will get better with time. -- Vernon On Fri, Feb 25, 2011 at 10:16 PM, Gregory Ewing wrote: > Until recently I didn't think it was possible to use .NET > libraries from CPython, but then I came across this: > > http://pythonnet.sourceforge.net/ > > Using this, it looks like it should be possible to create > a PyGUI implementation based on Windows Forms. This has the > potential to solve a number of headaches, as it appears > to be a considerably more capable library than base win32. > > The downside is that 2k and XP users may need to install > a .NET runtime. How would people feel about that? > > -- > Greg > > 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. > _______________________________________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/mailman/listinfo/pygui > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Mon Feb 28 19:54:28 2011 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 28 Feb 2011 11:54:28 -0700 Subject: [Pygui] Possible future direction for PyGUI on Win32 In-Reply-To: References: <4D688CBF.5030003@canterbury.ac.nz> Message-ID: This thread got posted to both this list and pywin32. Most of the comments were made on the other list. So to summarize those comments for folks who do not follow pywin32... Both Tim Golden and Micheal Foord gave ringing endorsements of pythonnet. Given the expertise of these two (Micheal literally wrote the book on IronPython) that's a strong "yes". -- VC -------------- next part -------------- An HTML attachment was scrubbed... URL: