From alex.holland at gmail.com Mon Nov 1 22:17:22 2010 From: alex.holland at gmail.com (Alex Holland) Date: Tue, 2 Nov 2010 10:17:22 +1300 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion Message-ID: Let's try that again without the HTML which Sparrow evidently attaches to every mail. Also added full Python windows versioning details. Hi, Just kicking the tyres of PyGUI with a view for using it for rapid GUI development/testing work. Greg, love the work you've done so far - a real breeze to learn, and well documented to boot. I noticed the system font on Windows XP looked too small, so had a poke around in the sources. I see it's theoretically 8pt Tahoma, but comparing it to renderings in WordPad, it seems to be 7pt. Editing GUI\Win32\StdFonts.py to change the input to _win_pts_to_pixels 10, rather than 8, seems to produce correct 8pt Tahoma. I've not experimented in depth, but this +2 point fudge-factor seemed correct for 10pt and 12pt text too. The DPI maths in there look correct, so I'm not sure what's causing this. I'm running PyGUI 2.3, Python 2.6.6 and pywin32-213 on Windows XP in VMWare Fusion. Display properties shows 96 DPI. Could I also suggest adding Windows XP's not-quite-grey to the standard colour library? I make the RGB values (0.93, 0.91, 0.85) - this matches the background that appears around RadioButtons on Win32. Cheers, Alex From alex.holland at gmail.com Mon Nov 1 22:28:53 2010 From: alex.holland at gmail.com (Alex Holland) Date: Tue, 2 Nov 2010 10:28:53 +1300 Subject: [Pygui] TextField - "just" property giving attribute errors on Win32 Message-ID: Hi, The "just" property for TextFields on Win32 doesn't seem to work, giving attribute errors. This occurs both when passing a justification value with the constructor, and when using the set_just method. Both work fine on OS X. Alignment for Labels seems to work without problems. Windows setup is: WinXP on VMWare Fusion, PyGUI 2.3, Python 2.6.6, pywin32-213 for Python 2.6. Examples below. Using set_just: >>> from GUI import TextField >>> f = TextField(text = "Foo") GControl._calc_height: 1 lines of Font('Tahoma',16,[]) ...line height = 16 ...vertical padding = 5 GComponent.invalidate: >>> f.set_just('right') Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\site-packages\GUI\Win32\TextFields.py", line 63, in set_just self._win.ModifyFlags(win_just_mask, flags) AttributeError: 'PyCEdit' object has no attribute 'ModifyFlags' Passing a justificaiton value in with the constructor: >>> g = TextField(text = "Bar", just = "right") GControl._calc_height: 1 lines of Font('Tahoma',16,[]) ...line height = 16 ...vertical padding = 5 Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\site-packages\GUI\Win32\TextFields.py", line 49, in __init__ GTextField.__init__(self, _win = win, **kwds) File "C:\Python26\lib\site-packages\GUI\Generic\GTextFields.py", line 35, in __init__ Control.__init__(self, **kwds) File "C:\Python26\lib\site-packages\GUI\Generic\GControls.py", line 28, in __init__ Component.__init__(self, **kwds) File "C:\Python26\lib\site-packages\GUI\Win32\Components.py", line 78, in __init__ GComponent.__init__(self, **kwds) File "C:\Python26\lib\site-packages\GUI\Generic\GComponents.py", line 79, in __init__ Properties.__init__(self, **kwds) File "C:\Python26\lib\site-packages\GUI\Generic\Properties.py", line 15, in __init__ self.set(**kw) File "C:\Python26\lib\site-packages\GUI\Generic\Properties.py", line 27, in set s(self, value) File "C:\Python26\lib\site-packages\GUI\Generic\Properties.py", line 40, in lambda self, value: getattr(self, setter_name)(value), File "C:\Python26\lib\site-packages\GUI\Win32\TextFields.py", line 63, in set_just self._win.ModifyFlags(win_just_mask, flags) AttributeError: 'PyCEdit' object has no attribute 'ModifyFlags' Cheers, Alex From greg.ewing at canterbury.ac.nz Tue Nov 2 05:41:23 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 02 Nov 2010 17:41:23 +1300 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion In-Reply-To: References: Message-ID: <4CCF9673.9010702@canterbury.ac.nz> Alex Holland wrote: > I noticed the system font on Windows XP looked too small, so had a > poke around in the sources. I see it's theoretically 8pt Tahoma, but > comparing it to renderings in WordPad, it seems to be 7pt. Fonts on Windows seem to be an endless source of mystery and confusion. My development system for Win PyGUI is currently 2000; maybe XP uses a different default font size. As you can see, I made several attempts at finding out the default font family and size, none of which seemed to work properly, and I ended up hard coding something that seemed to give the right results on my system. If anyone can tell me what the *right* way is to get the default font on Windows, I'd be glad to know! > Could I also suggest adding Windows XP's not-quite-grey to the > standard colour library? I make the RGB values (0.93, 0.91, 0.85) - > this matches the background that appears around RadioButtons on Win32. Maybe, but it's going to be different on other versions of Windows, and probably varies with the selected theme as well. Again, it would be better to ask the system, if there's a way to do that. -- Greg From rsyring at inteli-com.com Tue Nov 2 06:00:41 2010 From: rsyring at inteli-com.com (Randy Syring) Date: Tue, 02 Nov 2010 01:00:41 -0400 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion In-Reply-To: <4CCF9673.9010702@canterbury.ac.nz> References: <4CCF9673.9010702@canterbury.ac.nz> Message-ID: <4CCF9AF9.3070802@inteli-com.com> Greg, FWIW, sounds like questions python-win32 list might be able to help you with. -------------------------------------- Randy Syring Intelicom Direct: 502-276-0459 Office: 502-212-9913 For the wages of sin is death, but the free gift of God is eternal life in Christ Jesus our Lord (Rom 6:23) Greg Ewing wrote: > Alex Holland wrote: > >> I noticed the system font on Windows XP looked too small, so had a >> poke around in the sources. I see it's theoretically 8pt Tahoma, but >> comparing it to renderings in WordPad, it seems to be 7pt. > > Fonts on Windows seem to be an endless source of mystery and > confusion. My development system for Win PyGUI is currently > 2000; maybe XP uses a different default font size. > > As you can see, I made several attempts at finding out the > default font family and size, none of which seemed to work > properly, and I ended up hard coding something that seemed > to give the right results on my system. > > If anyone can tell me what the *right* way is to get the > default font on Windows, I'd be glad to know! > >> Could I also suggest adding Windows XP's not-quite-grey to the >> standard colour library? I make the RGB values (0.93, 0.91, 0.85) - >> this matches the background that appears around RadioButtons on Win32. > > Maybe, but it's going to be different on other versions of > Windows, and probably varies with the selected theme as > well. Again, it would be better to ask the system, if there's > a way to do that. > From alex.holland at gmail.com Tue Nov 2 09:59:53 2010 From: alex.holland at gmail.com (Alex Holland) Date: Tue, 2 Nov 2010 21:59:53 +1300 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion In-Reply-To: <4CCF9AF9.3070802@inteli-com.com> References: <4CCF9673.9010702@canterbury.ac.nz> <4CCF9AF9.3070802@inteli-com.com> Message-ID: Greg, On colours, I might have turned up what you need with a bit of Googling and experimentation. The relevant API hook is: win32api.GetSysColor(element_ref) element_ref is an integer which refers to a particular UI element - there's a list of elements and their values here: http://msdn.microsoft.com/en-us/library/ms724371(VS.85).aspx This returns a windows RGB value as an int, but it's really a 32-bit binary value. First 8 bits (Most Significant) are system reserved and set to 0*, next 8 are Blue, next 8 are Green and final 8 bits (Least Significant) are Red. So kind of BGR rather than RGB! As it returns as an int, some kind of binary padding may be needed if the values for A, G or B are zero. * these may be used for Alpha in newer, fancier (post XP) versions of Windows - not sure, MSDN is ambiguous. MSDN docs are a bit useless on this, as they want you to use built-in macros which aren't exposed to Python to get individual values, but this site has the skinny from the binary perspective: http://www.functionx.com/win32/Lesson12.htm Just gave this a test, pulling desktop colours - seems to work a charm, once you get past the weird encoding, and pulls colours direct from the system-wide settings in Display Properties. This means it should correctly grab custom colour-schemes, which is an accessibility win. Messy example - default Windows XP desktop background, best described as blueish: >>> import win32api as w >>> foo = w.GetSysColor(1) # 1 for Desktop >>> foo 9981440 >>> foo = bin(foo) >>> foo '0b100110000100111000000000' >>> rgbtuple = (int(foo[-8:],2), int(foo[-16:-8],2), int(foo[2:-16],2)) # (red, green, blue) >>> rgbtuple (0, 78, 152) So, Red = 0, Green = 78, Blue = 152. Plugging these values into mspaint gives a perfect match for the desktop. I'll do some more poking around tomorrow around fonts, but based on my brief research tonight, I'm not hopeful - might just need to detect Windows version with platform.win32_ver() and apply the appropriate defaults. Cheers, Alex On 2 November 2010 18:00, Randy Syring wrote: > Greg, > > FWIW, sounds like questions python-win32 list might be able to help you > with. > > -------------------------------------- > Randy Syring > Intelicom > Direct: 502-276-0459 > Office: 502-212-9913 > > For the wages of sin is death, but the > free gift of God is eternal life in Christ Jesus our Lord (Rom 6:23) > > > > Greg Ewing wrote: >> >> Alex Holland wrote: >> >>> I noticed the system font on Windows XP looked too small, so had a >>> poke around in the sources. I see it's theoretically 8pt Tahoma, but >>> comparing it to renderings in WordPad, it seems to be 7pt. >> >> Fonts on Windows seem to be an endless source of mystery and >> confusion. My development system for Win PyGUI is currently >> 2000; maybe XP uses a different default font size. >> >> As you can see, I made several attempts at finding out the >> default font family and size, none of which seemed to work >> properly, and I ended up hard coding something that seemed >> to give the right results on my system. >> >> If anyone can tell me what the *right* way is to get the >> default font on Windows, I'd be glad to know! >> >>> Could I also suggest adding Windows XP's not-quite-grey to the >>> standard colour library? I make the RGB values (0.93, 0.91, 0.85) - >>> this matches the background that appears around RadioButtons on Win32. >> >> Maybe, but it's going to be different on other versions of >> Windows, and probably varies with the selected theme as >> well. Again, it would be better to ask the system, if there's >> a way to do that. >> > _______________________________________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/mailman/listinfo/pygui > From alex.holland at gmail.com Tue Nov 2 10:02:48 2010 From: alex.holland at gmail.com (Alex Holland) Date: Tue, 2 Nov 2010 22:02:48 +1300 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion In-Reply-To: References: <4CCF9673.9010702@canterbury.ac.nz> <4CCF9AF9.3070802@inteli-com.com> Message-ID: Apologies if I'm teaching you to suck eggs here - got so excited with my discoveries/testing that I failed to realise you're almost certainly already handling the vagaries of Win32 Color types! Hope the rest is useful. Cheers, Alex On 2 November 2010 21:59, Alex Holland wrote: > Greg, > > On colours, I might have turned up what you need with a bit of > Googling and experimentation. > > The relevant API hook is: win32api.GetSysColor(element_ref) > > element_ref is an integer which refers to a particular UI element - > there's a list of elements and their values here: > http://msdn.microsoft.com/en-us/library/ms724371(VS.85).aspx > > This returns a windows RGB value as an int, but it's really a 32-bit > binary value. First 8 bits (Most Significant) are system reserved and > set to 0*, next 8 are Blue, next 8 are Green and final 8 bits (Least > Significant) are Red. So kind of BGR rather than RGB! As it returns as > an int, some kind of binary padding may be needed if the values for A, > G or B are zero. > > * these may be used for Alpha in newer, fancier (post XP) versions of > Windows - not sure, MSDN is ambiguous. > > MSDN docs are a bit useless on this, as they want you to use built-in > macros which aren't exposed to Python to get individual values, but > this site has the skinny from the binary perspective: > http://www.functionx.com/win32/Lesson12.htm > > Just gave this a test, pulling desktop colours - seems to work a > charm, once you get past the weird encoding, and pulls colours direct > from the system-wide settings in Display Properties. This means it > should correctly grab custom colour-schemes, which is an accessibility > win. > > Messy example - default Windows XP desktop background, best described > as blueish: > >>>> import win32api as w >>>> foo = w.GetSysColor(1) ? # 1 for Desktop >>>> foo > 9981440 >>>> foo = bin(foo) >>>> foo > '0b100110000100111000000000' >>>> rgbtuple = (int(foo[-8:],2), int(foo[-16:-8],2), int(foo[2:-16],2)) ? # (red, green, blue) >>>> rgbtuple > (0, 78, 152) > > So, Red = 0, Green = 78, Blue = 152. Plugging these values into > mspaint gives a perfect match for the desktop. > > I'll do some more poking around tomorrow around fonts, but based on my > brief research tonight, I'm not hopeful - might just need to detect > Windows version with platform.win32_ver() and apply the appropriate > defaults. > > Cheers, > > Alex > > > On 2 November 2010 18:00, Randy Syring wrote: >> Greg, >> >> FWIW, sounds like questions python-win32 list might be able to help you >> with. >> >> -------------------------------------- >> Randy Syring >> Intelicom >> Direct: 502-276-0459 >> Office: 502-212-9913 >> >> For the wages of sin is death, but the >> free gift of God is eternal life in Christ Jesus our Lord (Rom 6:23) >> >> >> >> Greg Ewing wrote: >>> >>> Alex Holland wrote: >>> >>>> I noticed the system font on Windows XP looked too small, so had a >>>> poke around in the sources. I see it's theoretically 8pt Tahoma, but >>>> comparing it to renderings in WordPad, it seems to be 7pt. >>> >>> Fonts on Windows seem to be an endless source of mystery and >>> confusion. My development system for Win PyGUI is currently >>> 2000; maybe XP uses a different default font size. >>> >>> As you can see, I made several attempts at finding out the >>> default font family and size, none of which seemed to work >>> properly, and I ended up hard coding something that seemed >>> to give the right results on my system. >>> >>> If anyone can tell me what the *right* way is to get the >>> default font on Windows, I'd be glad to know! >>> >>>> Could I also suggest adding Windows XP's not-quite-grey to the >>>> standard colour library? I make the RGB values (0.93, 0.91, 0.85) - >>>> this matches the background that appears around RadioButtons on Win32. >>> >>> Maybe, but it's going to be different on other versions of >>> Windows, and probably varies with the selected theme as >>> well. Again, it would be better to ask the system, if there's >>> a way to do that. >>> >> _______________________________________________ >> Pygui mailing list >> Pygui at python.org >> http://mail.python.org/mailman/listinfo/pygui >> > From alex.holland at gmail.com Tue Nov 2 22:24:58 2010 From: alex.holland at gmail.com (Alex Holland) Date: Wed, 3 Nov 2010 10:24:58 +1300 Subject: [Pygui] Font Sizes on Windows XP + Standard Colour Suggestion In-Reply-To: <4CCF9673.9010702@canterbury.ac.nz> References: <4CCF9673.9010702@canterbury.ac.nz> Message-ID: Right, done some more poking this morning, and I believe I may have cracked the system font issue. It's a bit of a mess, though. The approved method of getting the system fonts seems to be to use SystemParametersInfo to fetch SPI_GETNONCLIENTMETRICS, which returns a struct full of various display details as defined by the user in Display Properties - so again, this should take anyone's personal settings/accessibility needs into account. As such, it's preferred over GetStockObject, which only seems to get bog-standard defaults for backwards compatibility. http://msdn.microsoft.com/en-us/library/ff729175(v=VS.85).aspx <--- Non-Client Metrics Note that there's not one system font in there per-se, but separate entries for Menu Font, Caption Font, MessageBox Font, etc. This is exposed to Python by pywin32 through the following function: win32gui.SystemParametersInfo(int Action, obj Param,int WinIni) We can safely ignore Param and WinIni, as they're irrelevant for this lookup - we just need the int that relates to SPI_NONCLIENTMETRICS. A quick grep shows it's 41, but you can just import win32con and use the constant name. For SPI metric, it returns a Dict with keys the same as the struct on the MSDN site. >>> import win32gui >>> from win32con import * >>> dict = win32gui.SystemParametersInfo(SPI_GETNONCLIENTMETRICS) >>> dict {'lfSmCaptionFont': , 'iScrollWidth': 17, 'lfStatusFont': , 'lfCaptionFont': , 'iMenuHeight': 19, 'iCaptionHeight': 25, 'iSmCaptionHeight': 17, 'iBorderWidth': 1, 'iCaptionWidth': 25, 'lfMessageFont': , 'iSmCaptionWidth': 17, 'iScrollHeight': 17, 'iMenuWidth': 18, 'lfMenuFont': } >>> system_font = dict['lfMenuFont'] # Default menu font is definitely 8pt Tahoma on Win XP >>> system_font I haven't the faintest how to plumb this back into PyGUI, though! I can see the commented out remains of a Font-from-win-logfont function in there, so I'm guessing you should be able to use the objects this returns? Hope this helps, Alex On 2 November 2010 17:41, Greg Ewing wrote: > Alex Holland wrote: > >> I noticed the system font on Windows XP looked too small, so had a >> poke around in the sources. I see it's theoretically 8pt Tahoma, but >> comparing it to renderings in WordPad, it seems to be 7pt. > > Fonts on Windows seem to be an endless source of mystery and > confusion. My development system for Win PyGUI is currently > 2000; maybe XP uses a different default font size. > > As you can see, I made several attempts at finding out the > default font family and size, none of which seemed to work > properly, and I ended up hard coding something that seemed > to give the right results on my system. > > If anyone can tell me what the *right* way is to get the > default font on Windows, I'd be glad to know! > >> Could I also suggest adding Windows XP's not-quite-grey to the >> standard colour library? I make the RGB values (0.93, 0.91, 0.85) - >> this matches the background that appears around RadioButtons on Win32. > > Maybe, but it's going to be different on other versions of > Windows, and probably varies with the selected theme as > well. Again, it would be better to ask the system, if there's > a way to do that. > > -- > Greg > From alex.holland at gmail.com Fri Nov 5 03:04:40 2010 From: alex.holland at gmail.com (Alex Holland) Date: Fri, 5 Nov 2010 15:04:40 +1300 Subject: [Pygui] Win32 TextFields - when is self.text changed? Message-ID: In my current project, I need UI elements to enable/disable in response to whether there is text entered in various TextFields. As I couldn't see any built-in way for PyGUI to trigger an action based on a change in TextField content, unless the user hits enter or escape. One option would be to have a big "update" button for the user to click, but this isn't very practical - people expect programs to be more dynamic these days. To get around this, I've subclassed TextField to essentially trigger the enter action after any keystroke that changes the value of its text. Simplified code is below: class MyTextField(TextField): def key_down(self, event): oldtext = self.get_text() TextField.key_down(self, event) if oldtext != self.get_text(): self.do_enter_action() This works fine on Mac OS X, but not on Windows, where the value returned by self.get_text() doesn't seem to change following the call to the SuperClass. This invariably means that oldtext == self.get_text() in the above code. However, if I then hit another key, or click another UI element, I can see (via debug printing) that get_text *has* changed, at some point between the previous key_down finishing and the action being sent. If I remove the if test and just directly call do_enter_action, the action that is triggered (which in turn calls the textfield's get_text() function) again returns the pre-keypress value. As this action is used to update the model, it means the model data is always one keypress behind the UI! I'm guessing from this behaviour that the value of the text itself is only updated when the widget redraws? Anyway, two questions: 1) Is there an easier way of doing this? (responding to textfield input without waiting for an enter key) 2) If not, any guesses on how to fix the above? Cheers, Alex From amorris at mistermorris.com Fri Nov 5 18:06:03 2010 From: amorris at mistermorris.com (Adam Morris) Date: Sat, 6 Nov 2010 00:06:03 +0700 Subject: [Pygui] Pop-up menus? Message-ID: I am looking through the source code and see that the doc strings indicate menus can also be pop-up menus, but I can't fathom how to initialize them or make them behave differently from pull-down menus. Any clues? -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Sat Nov 6 12:11:04 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sun, 07 Nov 2010 00:11:04 +1300 Subject: [Pygui] Win32 TextFields - when is self.text changed? In-Reply-To: References: Message-ID: <4CD537C8.1050300@canterbury.ac.nz> Alex Holland wrote: > class MyTextField(TextField): > def key_down(self, event): > oldtext = self.get_text() > TextField.key_down(self, event) > if oldtext != self.get_text(): > self.do_enter_action() > > This works fine on Mac OS X, but not on Windows, where the value > returned by self.get_text() doesn't seem to change following the call > to the SuperClass. Unfortunately, PyGUI's style of event handling clashes with the way Windows works, and I had to do some convoluted things in the background. One result is that calling TextField.key_down() doesn't actually pass the event to the text field there and then. Instead it sets a flag that results in the event being passed on to the standard Windows event handling machinery after your event handler returns. I'm not sure if there's much that can be done about this, given the limitations of what pywin32 exposes. I'll look into it and see if there's some way that I can provide a text-changed hook. -- Greg From greg.ewing at canterbury.ac.nz Sat Nov 6 12:36:11 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sun, 07 Nov 2010 00:36:11 +1300 Subject: [Pygui] Pop-up menus? In-Reply-To: References: Message-ID: <4CD53DAB.7070706@canterbury.ac.nz> Adam Morris wrote: > I am looking through the source code and see that the doc strings > indicate menus can also be pop-up menus, but I can't fathom how to > initialize them or make them behave differently from pull-down menus. You can't at the moment. I must have been planning for a future that hasn't arrived yet when I wrote that doc string. -- Greg From amorris at mistermorris.com Sat Nov 6 18:08:51 2010 From: amorris at mistermorris.com (Adam Morris) Date: Sun, 7 Nov 2010 00:08:51 +0700 Subject: [Pygui] Pop-up menus? In-Reply-To: <4CD53DAB.7070706@canterbury.ac.nz> References: <4CD53DAB.7070706@canterbury.ac.nz> Message-ID: > > You can't at the moment. I must have been planning for a future that hasn't arrived yet when I wrote that doc string. Thanks Greg. I'm trying to work out how to write my own by subclassing your existing classes (on Mac, I don't have a Windows machine). Can you think of any obvious pitfalls to watch out for before I get too knee-deep? -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From olof.bjarnason at gmail.com Mon Nov 8 11:14:21 2010 From: olof.bjarnason at gmail.com (Olof Bjarnason) Date: Mon, 8 Nov 2010 11:14:21 +0100 Subject: [Pygui] Legacy dll dependency? Message-ID: Hi PyGUI community! Does PyGUI rely on any GUI framework (Gtk, wxWidgets etc.) or use only native DLLs of the operating system? If it only relies on operating system libraries (via ctypes?), it will be *very* easy to distribute PyGUI-based Python applications ;) /Olof -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Nov 9 01:47:00 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 09 Nov 2010 13:47:00 +1300 Subject: [Pygui] Legacy dll dependency? In-Reply-To: References: Message-ID: <4CD89A04.5000400@canterbury.ac.nz> Olof Bjarnason wrote: > Does PyGUI rely on any GUI framework (Gtk, wxWidgets etc.) or use only > native DLLs of the operating system? Dependencies are currently as follows: MacOSX: pyobjc Linux: gtk Windows: pywin32 -- Greg From olof.bjarnason at gmail.com Tue Nov 9 08:31:16 2010 From: olof.bjarnason at gmail.com (Olof Bjarnason) Date: Tue, 9 Nov 2010 08:31:16 +0100 Subject: [Pygui] Legacy dll dependency? In-Reply-To: <4CD89A04.5000400@canterbury.ac.nz> References: <4CD89A04.5000400@canterbury.ac.nz> Message-ID: 2010/11/9 Greg Ewing > Olof Bjarnason wrote: > > Does PyGUI rely on any GUI framework (Gtk, wxWidgets etc.) or use only >> native DLLs of the operating system? >> > > Dependencies are currently as follows: > > MacOSX: pyobjc > Linux: gtk > Windows: pywin32 > OK I see. Are there any plans to "subset" pywin32 to use only exactly what pygui needs? It would be consistent with pyguis policy of being as lightweight as possible. Dito for other platforms (how widespread is gtk/gtk+? pyobjc?) Is pygui sizer-based or fixed-coordinate based? > -- > Greg > _______________________________________________ > Pygui mailing list > Pygui at python.org > http://mail.python.org/mailman/listinfo/pygui > -- http://olofb.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Nov 9 11:47:21 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Tue, 09 Nov 2010 23:47:21 +1300 Subject: [Pygui] Legacy dll dependency? In-Reply-To: References: <4CD89A04.5000400@canterbury.ac.nz> Message-ID: <4CD926B9.4090609@canterbury.ac.nz> Olof Bjarnason wrote: > Are there any plans to "subset" pywin32 to use only exactly > what pygui needs? It would be consistent with pyguis policy of being as > lightweight as possible. I'd like to get rid of pywin32 altogether and do it all with ctypes eventually. A halfway step might be to move away from the MFC layer of pywin32 and just use the raw win api layer. > Dito for other platforms (how widespread is gtk/gtk+? pyobjc?) Gtk seems to be pretty standard on Linux these days, although the pygtk wrapper might need to be installed. There seems to be a version of pyobjc installed with the system python on MacOSX, although I haven't tested pygui with it yet. > Is pygui sizer-based or fixed-coordinate based? Neither. It has its own ways of doing layout, which are different and somewhat simpler than the schemes used by gtk and wx. To get the flavour of it, check out the 'anchor' property and the Row, Column and Grid components. -- Greg From olof.bjarnason at gmail.com Tue Nov 9 12:44:32 2010 From: olof.bjarnason at gmail.com (Olof Bjarnason) Date: Tue, 9 Nov 2010 12:44:32 +0100 Subject: [Pygui] Legacy dll dependency? In-Reply-To: <4CD926B9.4090609@canterbury.ac.nz> References: <4CD89A04.5000400@canterbury.ac.nz> <4CD926B9.4090609@canterbury.ac.nz> Message-ID: 2010/11/9 Greg Ewing > Olof Bjarnason wrote: > > Are there any plans to "subset" pywin32 to use only exactly what pygui >> needs? It would be consistent with pyguis policy of being as lightweight as >> possible. >> > > I'd like to get rid of pywin32 altogether and do it all with > ctypes eventually. A halfway step might be to move away from > the MFC layer of pywin32 and just use the raw win api layer. OK. > > > Dito for other platforms (how widespread is gtk/gtk+? pyobjc?) >> > > Gtk seems to be pretty standard on Linux these days, although > the pygtk wrapper might need to be installed. > Yeah, it's standard for Gnome desktops, but I don't know about KDE (haven't used KDE for several years). > There seems to be a version of pyobjc installed with the system > python on MacOSX, although I haven't tested pygui with it yet. OK, I know so little of MacOSX - I didn't even know there was a default (system) installation of Python in it ;) > > Is pygui sizer-based or fixed-coordinate based? >> > > Neither. It has its own ways of doing layout, which are > different and somewhat simpler than the schemes used by > gtk and wx. To get the flavour of it, check out the > 'anchor' property and the Row, Column and Grid components. > Will do.. > > -- > Greg > > > -- http://olofb.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From olof.bjarnason at gmail.com Tue Nov 9 12:48:23 2010 From: olof.bjarnason at gmail.com (Olof Bjarnason) Date: Tue, 9 Nov 2010 12:48:23 +0100 Subject: [Pygui] Legacy dll dependency? In-Reply-To: References: <4CD89A04.5000400@canterbury.ac.nz> <4CD926B9.4090609@canterbury.ac.nz> Message-ID: 2010/11/9 Olof Bjarnason > > > 2010/11/9 Greg Ewing > >> Olof Bjarnason wrote: >> >> >> Are there any plans to "subset" pywin32 to use only exactly what pygui >>> needs? It would be consistent with pyguis policy of being as lightweight as >>> possible. >>> >> >> I'd like to get rid of pywin32 altogether and do it all with >> ctypes eventually. A halfway step might be to move away from >> the MFC layer of pywin32 and just use the raw win api layer. >> > > OK. > > >> >> >> Dito for other platforms (how widespread is gtk/gtk+? pyobjc?) >>> >> >> Gtk seems to be pretty standard on Linux these days, although >> the pygtk wrapper might need to be installed. >> > > Yeah, it's standard for Gnome desktops, but I don't know about KDE (haven't > used KDE for several years). > > >> There seems to be a version of pyobjc installed with the system >> python on MacOSX, although I haven't tested pygui with it yet. > > > OK, I know so little of MacOSX - I didn't even know there was a default > (system) installation of Python in it ;) > > >> >> Is pygui sizer-based or fixed-coordinate based? >>> >> >> Neither. It has its own ways of doing layout, which are >> different and somewhat simpler than the schemes used by >> gtk and wx. To get the flavour of it, check out the >> 'anchor' property and the Row, Column and Grid components. >> > > Will do.. > I cannot find any "anchor" in the official documentation for Row: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/version/Doc/Row.html > >> >> -- >> Greg >> >> >> > > > -- > http://olofb.wordpress.com > > -- http://olofb.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From greg.ewing at canterbury.ac.nz Tue Nov 9 20:47:20 2010 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 10 Nov 2010 08:47:20 +1300 Subject: [Pygui] Legacy dll dependency? In-Reply-To: References: <4CD89A04.5000400@canterbury.ac.nz> <4CD926B9.4090609@canterbury.ac.nz> Message-ID: <4CD9A548.3010808@canterbury.ac.nz> Olof Bjarnason wrote: > > Yeah, it's standard for Gnome desktops, but I don't know about KDE > (haven't used KDE for several years). I don't know much about KDE either, but it appears to be based on Qt. In that case it really ought to be considered a distinct platform and have its own PyGUI implementation. I don't expect to be doing that myself in the near future, though. -- Greg From amorris at mistermorris.com Fri Nov 12 15:45:57 2010 From: amorris at mistermorris.com (Adam Morris) Date: Fri, 12 Nov 2010 21:45:57 +0700 Subject: [Pygui] ValueError: NSInvalidArgumentException - -[OC_PythonNumber length]: unrecognized selector sent to instance 0x6d4690 Message-ID: Programming on my Mac I've got a window where clicking the OK button needs to update a text field with a calculation that takes a long time. Suspecting a blocking or thread issue, I updated my code using the threaded module with a worker function that just printed out a long for loop. Yet even after that attempt I still get the same error (and the worker loop keeps on going). What's the work-around, or does PyGUI not support extended tasks? -Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.holland at gmail.com Thu Nov 18 02:52:43 2010 From: alex.holland at gmail.com (Alex Holland) Date: Thu, 18 Nov 2010 14:52:43 +1300 Subject: [Pygui] Win32 File Dialogues - unexpected behaviour if Enter Key used Message-ID: Just spotted a wee implementation quirk on Win32, when working with request_new_file. The dialogue works as expected if you click the Save button with the mouse, but if you hit enter instead, then the first window dismisses, the background operation completes (my file is saved), but fresh dialogue window of the same type instantly pops up. A bit of testing shows that the same thing happens with request_old_file, but you're less likely to be typing the filename in that situation. No issue on OS X. PyGUI 2.3, Python 2.6.6, PyWin32-213, Windows XP SP3 Cheers, Alex