pyobjc-dev Mailing List for PyObjC (Page 261)
Brought to you by:
ronaldoussoren
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(30) |
May
(18) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2002 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
(3) |
Jul
(13) |
Aug
|
Sep
(23) |
Oct
(180) |
Nov
(291) |
Dec
(95) |
2003 |
Jan
(338) |
Feb
(352) |
Mar
(97) |
Apr
(46) |
May
(226) |
Jun
(184) |
Jul
(145) |
Aug
(141) |
Sep
(69) |
Oct
(161) |
Nov
(96) |
Dec
(90) |
2004 |
Jan
(66) |
Feb
(87) |
Mar
(98) |
Apr
(132) |
May
(115) |
Jun
(68) |
Jul
(150) |
Aug
(92) |
Sep
(59) |
Oct
(52) |
Nov
(17) |
Dec
(75) |
2005 |
Jan
(84) |
Feb
(191) |
Mar
(133) |
Apr
(114) |
May
(158) |
Jun
(185) |
Jul
(62) |
Aug
(28) |
Sep
(36) |
Oct
(88) |
Nov
(65) |
Dec
(43) |
2006 |
Jan
(85) |
Feb
(62) |
Mar
(92) |
Apr
(75) |
May
(68) |
Jun
(101) |
Jul
(73) |
Aug
(37) |
Sep
(91) |
Oct
(65) |
Nov
(30) |
Dec
(39) |
2007 |
Jan
(24) |
Feb
(28) |
Mar
(10) |
Apr
(2) |
May
(18) |
Jun
(16) |
Jul
(21) |
Aug
(6) |
Sep
(30) |
Oct
(31) |
Nov
(153) |
Dec
(31) |
2008 |
Jan
(63) |
Feb
(70) |
Mar
(47) |
Apr
(24) |
May
(59) |
Jun
(22) |
Jul
(12) |
Aug
(7) |
Sep
(14) |
Oct
(26) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(10) |
Feb
(41) |
Mar
(70) |
Apr
(88) |
May
(49) |
Jun
(62) |
Jul
(34) |
Aug
(15) |
Sep
(55) |
Oct
(40) |
Nov
(67) |
Dec
(21) |
2010 |
Jan
(60) |
Feb
(17) |
Mar
(26) |
Apr
(26) |
May
(29) |
Jun
(4) |
Jul
(21) |
Aug
(21) |
Sep
(10) |
Oct
(12) |
Nov
(3) |
Dec
(19) |
2011 |
Jan
(3) |
Feb
(13) |
Mar
(8) |
Apr
(8) |
May
(17) |
Jun
(20) |
Jul
(21) |
Aug
(7) |
Sep
|
Oct
|
Nov
(9) |
Dec
(11) |
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(14) |
Jul
(5) |
Aug
(2) |
Sep
(15) |
Oct
(2) |
Nov
(23) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(12) |
Nov
(10) |
Dec
(3) |
2014 |
Jan
(7) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(2) |
Jun
(11) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(8) |
Nov
(1) |
Dec
(2) |
2015 |
Jan
(9) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(7) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2016 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(6) |
Aug
(8) |
Sep
(21) |
Oct
(17) |
Nov
|
Dec
(36) |
2017 |
Jan
(6) |
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(6) |
2018 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(14) |
May
(2) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(6) |
Oct
(16) |
Nov
(1) |
Dec
(6) |
2019 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(1) |
2021 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Etienne P. <ep...@ep...> - 2003-02-03 09:37:06
|
On Monday, Feb 3, 2003, at 02:47 Europe/Amsterdam, Michael Engelhart wrote: > I then went into Interface BUilder and added a sayGoodbyeAction: > action to the class and instantiated it and wired up the buttons, text > field and delegate. WHen I rebuild the application, the button I > added to the sample window doesn't work yet the button that comes with > the template does work. Well that's not true, sometimes my added > button/method combination works, sometimes it doesn't. I've triple > checked that everything is wired up correctly and it still doesn't > function. At one point I thought I had some bizarre spacing issue so > I copied the sayHelloAction method and pasted it and changed the > method body and method name and then it worked. then I tried adding > another method and everything stopped working. You mention that you added sayGoodbyeAction: to the class and instantiated it - but to which class did you add it? If you are just adding an extra button to the example, you shouldn't have to instantiate anything. You only need to add the new action to the MyAppDelegate, and then add the method to the Python code in MyAppDelegate.py. Are you trying to add a whole new custom class? If so, that has to go in a separate Python class. EP |
From: Bob I. <bo...@re...> - 2003-02-03 08:22:23
|
On Monday, Feb 3, 2003, at 03:08 America/New_York, Just van Rossum wrote: > Ronald Oussoren wrote: > >> No it wouldn't, if the import hook gives you no more than the >> currrent AddressBook module you don't have to compile anything. >> Adding constants and global functions would require a compiler, but >> luckily the scripts for extracting those are not really suitable for >> this use :-) > > Don't the installed frameworks on a dev-tools-less system also contain > the headers? If so, then the constants can be had from pure Python. If > we use ctypes, the global functions can be had, too... However, the installed frameworks _do not_ come with headers.. as evidenced by running those lsbom's though | cut -f 1 | grep "Frameworks/.*\.h\>" ctypes is very enticing. Making pyobjc (all of python really..) dependent on ctypes would surely make pyobjc a lot more powerful. -bob |
From: Just v. R. <ju...@le...> - 2003-02-03 08:08:51
|
Ronald Oussoren wrote: > Or we could translate NSNumbers to Python numbers when translating > from Objective-C values to Python values, but I don't think we should > do that. Why not? It would surely be the least surprising behavior? Just |
From: Just v. R. <ju...@le...> - 2003-02-03 08:08:15
|
Ronald Oussoren wrote: > No it wouldn't, if the import hook gives you no more than the > currrent AddressBook module you don't have to compile anything. > Adding constants and global functions would require a compiler, but > luckily the scripts for extracting those are not really suitable for > this use :-) Don't the installed frameworks on a dev-tools-less system also contain the headers? If so, then the constants can be had from pure Python. If we use ctypes, the global functions can be had, too... Just |
From: David E. <epp...@ic...> - 2003-02-03 07:59:16
|
On 2/3/03 8:13 AM +0100 Ronald Oussoren <ous...@ci...> wrote: > Not too hard. There are (at least) two possible solutions: > > - David could use objc.selector to specify a signature that is more to > its liking (e.g. one of the arguments is an int instead of an object). > I don't really like this, mostly because of the arcane interface of > selector() Rather than do that, I could (what I'm doing now) use int() to convert the type back to what I want. So this isn't an issue that's preventing me from getting anything done; it's more in the nature of a rough edge that it would be nice to smooth off before it confuses too many other people. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |
From: Ronald O. <ous...@ci...> - 2003-02-03 07:19:52
|
Argh, I think I'm going mad... Did anyone else try this? One other thing that may make a difference: I've build my python 2.3 (framework install) with 'OPT=-O3 -mcpu=604 -faltivec -prebind -g'. Ronald On Monday, Feb 3, 2003, at 00:09 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 17:14 US/Eastern, Just van Rossum wrote: >> I tried and ideed it works now. However, I must return None from >> applicationShouldOpenUntitledFile_ for it to work: 0, False and NO >> seem >> to be evaluated as YES. > > Odd. If I return 'None', the app crashes with: > > Traceback (most recent call last): > File > "/tmp/bbum-products/asdfasdfasdfadf.app/Contents/Resources/ > __main__.py", line 20, in ? > sys.exit(AppKit.NSApplicationMain(sys.argv)) > TypeError: applicationShouldOpenUntitledFile:: Cannot encode return > value: a string or an integer > > NO/0 cause it to bring up the stupid untitled window. > > b.bum > > |
From: Ronald O. <ous...@ci...> - 2003-02-03 07:17:14
|
On Monday, Feb 3, 2003, at 04:39 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 13:08 US/Eastern, Just van Rossum wrote: >> bb...@ma... wrote: >> >>> Ronald: should we go ahead and auto-generate the source to cover >>> all >>> of AB's compiled constants? This would require creating >>> yet-another-module. Maybe AddressBook should be moved out of PyObjC >>> and into its own project given that most apps will not use the AB >>> API? >> >> I've been wondering, if interfacing an arbitrary framework is mostly >> automated, we could make it more dynamic with an import hook: if >> "import >> SomeFramework" fails, a hook can be called to wrap it if it happens to >> be ean existing framework. That way we could delete AddressBook >> altogether ;-) > > That would require that the dev tools be installed on every machine > that can automatically bridge frameworks.... No it wouldn't, if the import hook gives you no more than the currrent AddressBook module you don't have to compile anything. Adding constants and global functions would require a compiler, but luckily the scripts for extracting those are not really suitable for this use :-) Ronald |
From: Ronald O. <ous...@ci...> - 2003-02-03 07:14:48
|
On Monday, Feb 3, 2003, at 04:35 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 21:08 US/Eastern, David Eppstein wrote: >> If they're not interchangeable, then maybe it's a bug that calling >> into and back from the undo manager is changing my ints into >> integers? The point is, I'm passing it arguments that should work, >> and it's giving me back ones that don't work. > > The underlying problem is that the bridge has no way of knowing the > signature of the method your are invoking upon > prepareWithInvocationTarget_() and, as such, assumes everything passed > into that method is an int. is and object [ed.] ;-) [explanation of how NSUndoManager works removed for brevity] > At least, I think it does. Thats right. > > Fixing it may be hard. Not too hard. There are (at least) two possible solutions: - David could use objc.selector to specify a signature that is more to its liking (e.g. one of the arguments is an int instead of an object). I don't really like this, mostly because of the arcane interface of selector() - We could treat NSNumber like a Python number when translating arguments to Objective-C values. Doing that would not be too hard. Or we could translate NSNumbers to Python numbers when translating from Objective-C values to Python values, but I don't think we should do that. Ronald |
From: Ronald O. <ous...@ci...> - 2003-02-03 07:06:12
|
On Monday, Feb 3, 2003, at 00:07 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 16:44 US/Eastern, Ronald Oussoren wrote: >> I've just checked in a patch that seems to fix this. From what I have >> seen it looks like Objective-C methods that say they return an char >> actually return an int, the method stub we insert in the Objective-C >> class did return char. Because of this, the return value seen by the >> caller of the method contains our return value as well as 3 bytes of >> garbage. If your lucky these bytes are all 0. Hmm, methods returning >> shorts probably have a simular problem. > > Use the source, Luke! > > Seriously -- the objc runtime source is available in Darwin. Thanks, I'll download it. > > Going from memory -- yes, anything 4 bytes or less is returned as a 4 > byte value and then downcast as necessary. > > Anything greater than 4 bytes is basically a struct return type and > the calling convention is slightly different. And floating point values are returned as if the function is returning a float/double. Ronald |
From: <bb...@ma...> - 2003-02-03 03:39:50
|
On Sunday, Feb 2, 2003, at 13:08 US/Eastern, Just van Rossum wrote: > bb...@ma... wrote: > >> Ronald: should we go ahead and auto-generate the source to cover all >> of AB's compiled constants? This would require creating >> yet-another-module. Maybe AddressBook should be moved out of PyObjC >> and into its own project given that most apps will not use the AB API? > > I've been wondering, if interfacing an arbitrary framework is mostly > automated, we could make it more dynamic with an import hook: if > "import > SomeFramework" fails, a hook can be called to wrap it if it happens to > be ean existing framework. That way we could delete AddressBook > altogether ;-) That would require that the dev tools be installed on every machine that can automatically bridge frameworks.... Have a look at DevSDK.pkg and DevTools.pkg -- anything in there cannot be used at runtime without introducing the requirement that the dev tools be installed on the target system. lsbom /Library/Receipts/DevSDK.pkg/Contents/Archive.bom lsbom /Library/Receipts/DevTools.pkg/Contents/Archive.bom b.bum |
From: <bb...@ma...> - 2003-02-03 03:35:30
|
On Sunday, Feb 2, 2003, at 21:08 US/Eastern, David Eppstein wrote: > If they're not interchangeable, then maybe it's a bug that calling > into and back from the undo manager is changing my ints into integers? > The point is, I'm passing it arguments that should work, and it's > giving me back ones that don't work. The underlying problem is that the bridge has no way of knowing the signature of the method your are invoking upon prepareWithInvocationTarget_() and, as such, assumes everything passed into that method is an int. -prepareWithInvocationTarget_() basically configures the undo manager to act as a proxy for the next method call-- pushing that call onto a stack for later undo purposes. That is... >>> y = NSUndoManager.alloc().init() >>> y <NSUndoManager: 0x64bea0> >>> y.prepareWithInvocationTarget_(NSMutableArray.array()) <NSUndoManager: 0x64bea0> .... or, when used in context ... >>> a = NSMutableArray.array() >>> uM = NSUndoManager.alloc().init() >>> a.addObject_("foo") >>> uM.prepareWithInvocationTarget_(a).removeObject_("foo") >>> a (foo) >>> uM.undo() >>> a () ... the undo manager effectively captures the invocation of removeObject_() and stores it away until the undo() is invoked. At that point, undo() pops the captured invocation off the undo stack and invokes it. As far as the bridge can tell, removeObject_() is being invoked on the undo manager itself! As such, when the bridge tries to query the undo manager for the signature of the method being invoked, nothing is returned and the bridge falls back to sending across straight object representations of the various parameters. This causes a straight integer parameter to be converted to an (id) on the way to being captured by the undo manager. At least, I think it does. Fixing it may be hard. b.bum |
From: David E. <epp...@ic...> - 2003-02-03 02:08:29
|
On 2/2/03 7:52 PM -0500 Bob Ippolito <bo...@re...> wrote: > On Sunday, Feb 2, 2003, at 19:46 America/New_York, David Eppstein wrote: > >> I just hit an error in my code; looks like the following scenario >> happened: >> 1. My code passed an integer value to >> undoManager.prepareWithInvocationTarget_ >> 2. I invoked an undo. >> 3. undoManager called my code with an NSCFInteger in place of the >> integer >> (so far, no problem...) >> 4. my code used that value as the column parameter of >> NSTableView.editColumn_row_withEvent_select_ >> 5. TypeError: expected an integer for argument 1: its typespec is 'i12' >> >> As usual, the workaround is to wrap the value in an int(), but >> shouldn't an objc integer be allowed to be used for this typespec? > > Well, from ObjC I would say no, if it expects an integer, it should get > an int. int and NSNumber aren't interchangable on the ObjC side of > things. If they're not interchangeable, then maybe it's a bug that calling into and back from the undo manager is changing my ints into integers? The point is, I'm passing it arguments that should work, and it's giving me back ones that don't work. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |
From: Michael E. <men...@ka...> - 2003-02-03 01:48:50
|
Hi - I'm testing out PyObjC and have some problems (or more likely misunderstandings) when trying to use IB to build a UI. I took the Cocoa-Python application template from CVS (did a pyobjc build from CVS as well). I change the MyAppDelegate file to add a method like this: def sayGoodbyeAction_(self, sender): print "goodbye" I then went into Interface BUilder and added a sayGoodbyeAction: action to the class and instantiated it and wired up the buttons, text field and delegate. WHen I rebuild the application, the button I added to the sample window doesn't work yet the button that comes with the template does work. Well that's not true, sometimes my added button/method combination works, sometimes it doesn't. I've triple checked that everything is wired up correctly and it still doesn't function. At one point I thought I had some bizarre spacing issue so I copied the sayHelloAction method and pasted it and changed the method body and method name and then it worked. then I tried adding another method and everything stopped working. Is there some bit of weirdness that I should be aware of when using IB with PyObjC? I have the October 2002 developer tools update and OS X 10.2.3. Thanks for any guidance Mike Engelhart |
From: Bob I. <bo...@re...> - 2003-02-03 00:52:54
|
On Sunday, Feb 2, 2003, at 19:46 America/New_York, David Eppstein wrote: > I just hit an error in my code; looks like the following scenario > happened: > 1. My code passed an integer value to > undoManager.prepareWithInvocationTarget_ > 2. I invoked an undo. > 3. undoManager called my code with an NSCFInteger in place of the > integer > (so far, no problem...) > 4. my code used that value as the column parameter of > NSTableView.editColumn_row_withEvent_select_ > 5. TypeError: expected an integer for argument 1: its typespec is 'i12' > > As usual, the workaround is to wrap the value in an int(), but > shouldn't an objc integer be allowed to be used for this typespec? Well, from ObjC I would say no, if it expects an integer, it should get an int. int and NSNumber aren't interchangable on the ObjC side of things. -bob |
From: David E. <epp...@ic...> - 2003-02-03 00:47:09
|
I just hit an error in my code; looks like the following scenario happened: 1. My code passed an integer value to undoManager.prepareWithInvocationTarget_ 2. I invoked an undo. 3. undoManager called my code with an NSCFInteger in place of the integer (so far, no problem...) 4. my code used that value as the column parameter of NSTableView.editColumn_row_withEvent_select_ 5. TypeError: expected an integer for argument 1: its typespec is 'i12' As usual, the workaround is to wrap the value in an int(), but shouldn't an objc integer be allowed to be used for this typespec? -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |
From: <bb...@ma...> - 2003-02-02 23:36:14
|
On Sunday, Feb 2, 2003, at 18:17 US/Eastern, Bob Ippolito wrote: > Are you sure you're running setup.py with the python binary from the > 2.3 cvs head you're targetting? I think you may be running python > from the path, which would definitely pick up the wrong scent. I just tried... sudo /Library/Frameworks/Python.framework/Versions/Current/bin/python setup.py install ... and the same warnings/errors appeared. b.bum |
From: Bob I. <bo...@re...> - 2003-02-02 23:17:00
|
On Sunday, Feb 2, 2003, at 18:05 America/New_York, bb...@ma... wrote: > When I build PyObjC against Python 2.3 with both source trees from > CVS, I'm seeing quite a number of the following errors/warnings: > > mismatch for module _Foundation: This Python has API version 1012, > module _Foundation has version 1011. > > This smells like I'm picking up the wrong headers, but I'm not sure. > > Are you sure you're running setup.py with the python binary from the 2.3 cvs head you're targetting? I think you may be running python from the path, which would definitely pick up the wrong scent. -bob |
From: Bill B. <bb...@co...> - 2003-02-02 23:12:52
|
On Sunday, Feb 2, 2003, at 15:26 US/Eastern, Tony Lownds wrote: > Speaking of app wrappers, below is a bin-python-main.m that will load > a framework build of python. It seems to load faster than using the > execve methods... That source is already in the CVS repository -- it is just in the Attic of, I believe, Web Services Tool. Not a very useful spot. There will be project builder templates created that use an embedded python interpreter. Unfortunately, Apple's Python cannot [currently] be embedded into an application because it does not ship with a dylib or library to link against. b.bum |
From: <bb...@ma...> - 2003-02-02 23:09:59
|
On Sunday, Feb 2, 2003, at 17:14 US/Eastern, Just van Rossum wrote: > I tried and ideed it works now. However, I must return None from > applicationShouldOpenUntitledFile_ for it to work: 0, False and NO seem > to be evaluated as YES. Odd. If I return 'None', the app crashes with: Traceback (most recent call last): File "/tmp/bbum-products/asdfasdfasdfadf.app/Contents/Resources/ __main__.py", line 20, in ? sys.exit(AppKit.NSApplicationMain(sys.argv)) TypeError: applicationShouldOpenUntitledFile:: Cannot encode return value: a string or an integer NO/0 cause it to bring up the stupid untitled window. b.bum |
From: <bb...@ma...> - 2003-02-02 23:07:43
|
On Sunday, Feb 2, 2003, at 16:44 US/Eastern, Ronald Oussoren wrote: > I've just checked in a patch that seems to fix this. From what I have > seen it looks like Objective-C methods that say they return an char > actually return an int, the method stub we insert in the Objective-C > class did return char. Because of this, the return value seen by the > caller of the method contains our return value as well as 3 bytes of > garbage. If your lucky these bytes are all 0. Hmm, methods returning > shorts probably have a simular problem. Use the source, Luke! Seriously -- the objc runtime source is available in Darwin. Going from memory -- yes, anything 4 bytes or less is returned as a 4 byte value and then downcast as necessary. Anything greater than 4 bytes is basically a struct return type and the calling convention is slightly different. b.bum |
From: <bb...@ma...> - 2003-02-02 23:05:47
|
When I build PyObjC against Python 2.3 with both source trees from CVS, I'm seeing quite a number of the following errors/warnings: /tmp/bbum-products/asdfasdfasdfadf.app/Contents/Resources/PyObjC/objc/ __init__.py:28: RuntimeWarning: Python C API version mismatch for module _objc: This Python has API version 1012, module _objc has version 1011. from _objc import * /tmp/bbum-products/asdfasdfasdfadf.app/Contents/Resources/PyObjC/objc/ __init__.py:88: RuntimeWarning: Python C API version mismatch for module _FoundationMapping: This Python has API version 1012, module _FoundationMapping has version 1011. import _FoundationMapping /tmp/bbum-products/asdfasdfasdfadf.app/Contents/Resources/PyObjC/ Foundation/__init__.py:3: RuntimeWarning: Python C API version mismatch for module _Foundation: This Python has API version 1012, module _Foundation has version 1011. This smells like I'm picking up the wrong headers, but I'm not sure. b.bum |
From: Just v. R. <ju...@le...> - 2003-02-02 22:14:51
|
Ronald Oussoren wrote: > I've just checked in a patch that seems to fix this. From what I have > seen it looks like Objective-C methods that say they return an char > actually return an int, the method stub we insert in the Objective-C > class did return char. Because of this, the return value seen by the > caller of the method contains our return value as well as 3 bytes of > garbage. If your lucky these bytes are all 0. Hmm, methods returning > shorts probably have a simular problem. I tried and ideed it works now. However, I must return None from applicationShouldOpenUntitledFile_ for it to work: 0, False and NO seem to be evaluated as YES. Just |
From: Ronald O. <ous...@ci...> - 2003-02-02 21:45:13
|
On Sunday, Feb 2, 2003, at 22:11 Europe/Amsterdam, Ronald Oussoren wrote: > > On Sunday, Feb 2, 2003, at 21:25 Europe/Amsterdam, I wrote: >>> Yes, latest from CVS. >> I was using a slightly later version than you. After updating to the >> latest version in CVS I also have the problem :-(. > > That should have been 'earlier', if I had used a later version fixing > it would have been some much easier :-) I seem like talking to myself ;-) I've just checked in a patch that seems to fix this. From what I have seen it looks like Objective-C methods that say they return an char actually return an int, the method stub we insert in the Objective-C class did return char. Because of this, the return value seen by the caller of the method contains our return value as well as 3 bytes of garbage. If your lucky these bytes are all 0. Hmm, methods returning shorts probably have a simular problem. As the CVS checkin message says: I am going to search for a document describing the exact calling convention for Objective-C methods. The current solution feels hackish. Ronald |
From: Ronald O. <ous...@ci...> - 2003-02-02 21:12:39
|
On Sunday, Feb 2, 2003, at 21:25 Europe/Amsterdam, I wrote: >> Yes, latest from CVS. > I was using a slightly later version than you. After updating to the > latest version in CVS I also have the problem :-(. That should have been 'earlier', if I had used a later version fixing it would have been some much easier :-) Ronald |
From: Ronald O. <ous...@ci...> - 2003-02-02 20:26:53
|
On Sunday, Feb 2, 2003, at 21:04 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, Feb 2, 2003, at 15:00 US/Eastern, Ronald Oussoren wrote: >> That's very weird. I was using Python 2.3, maybe that explains >> things. I'll rebuild the bridge for Python 2.2 and check if this >> helps. > > I tried with both! Same behavior. > >> You are using the fixes to libffi_support.m I checked in last week, >> aren't you? These include a fix for BOOL values (actually >> signed/unsigned characters). Hmm, but that's only relevant when >> calling into Objective-C, not for this problem. >> > Yes, latest from CVS. I was using a slightly later version than you. After updating to the latest version in CVS I also have the problem :-(. Ronald |