pyobjc-dev Mailing List for PyObjC (Page 180)
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: Jonathan W. <jw...@ma...> - 2004-07-20 03:43:24
|
On Jul 19, 2004, at 20:38, Bob Ippolito wrote: > I think this will work: > > NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: > @"Hello World", @"myLocal", NULL]; > PyObject *thePyLocals = PyObjC_IdToPython(theLocals); > PyRun_String("print myLocal", 0, NULL, thePyLocals); > Py_DECREF(thePyLocals); That looks great. But PyObjC_IdToPython() is (inline) defined in objc_support.h which isn't part of the (installer based) PyObjC installation. So I've copied that header into my application directly from PyObjc's svn repository. To actually get PyObjC_IdToPython() into my address space I'm calling PyRun_SimpleString("import pyobjc"). Unfortunately that fails (understandibly) with "Fatal Python error: PyThreadState_Get: no current thread". Now I know I probably have to jump through a lot of initialisation code to get python set up the way it should be for "import objc" to work. But it seems like that's a whole lot of work for something which could be as simple as a "#import <PyObjC/PyObjC.h>" command in my objc code... Has there been any thought to removing this code (and family) and putting it into a separate framework/library? Cheers. Jon. |
From: Ryan W. <rya...@ma...> - 2004-07-20 03:33:11
|
On 7/19/04, at 11:45 AM, Ronald Oussoren said: >I'm also thinking about including libffi in the SVN repository, that=20 >takes away the need to have a seperate download for libffi and makes=20 >sure that everyone uses the right version of libffi. If you could do this sooner rather than later, that would be great. I'm giv= ing a talk on PyobjC at MacHack/ADHOC, and would like to have an one slide explan= ation of how to install Pyobjc. #1: Grab the latest pyobjc via WebDAV #2: sudo python setup.py install #3: Install XCode templates =20 This, of course, would be so much easier if libffi was included in the repository :) Oh! And, hey, guys, I'm giving a talk about PyobjC at ADHOC/MacHack!!! ;-) = I'll see what I can do about contributing the slides and maybe some sample code = back to the project. Or, if ya use Pyobjc and are going to MacHack, stop by and = say Hi. Thanks for all the hard work!, _Ryan Wilcox =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Wilcox Development Solutions: http://www.wilcoxd.com Toolsmiths for the Internet Age PGP: 0x2F4E9C31 |
From: Bob I. <bo...@re...> - 2004-07-20 00:39:06
|
On Jul 19, 2004, at 8:23 PM, Jonathan Wight wrote: > I need to embed Python(.framework) inside a Cocoa application I'm > working on. > > Now I'd like to something like this: > > NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: > @"Hello World", @"myLocal", > NULL]; > > PyRun_String("print myLocal', 0, NULL, (PyObject *)theLocals); > > Now obviously I realise that casting an Objective-C type to a PyObject > aint going to be work but is there someway of getting Objective-C > objects into Python from Objective-C? I think this will work: NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: @"Hello World", @"myLocal", NULL]; PyObject *thePyLocals = PyObjC_IdToPython(theLocals); PyRun_String("print myLocal", 0, NULL, thePyLocals); Py_DECREF(thePyLocals); -bob |
From: b.bum <bb...@ma...> - 2004-07-20 00:34:55
|
On Jul 19, 2004, at 5:23 PM, Jonathan Wight wrote: > I need to embed Python(.framework) inside a Cocoa application I'm > working on. What is the target OS? If it is 10.3, then you can simply link against /System/Library/Frameworks/Python.framework. Unless you need a custom version. If you need a custom version of Python, then you'll have to embed the framework. Note that you should not need a custom version to simply build a module. The module can be embedded in your app without requiring a custom build of Python. See Bob's main.m for an example of how to initialize python within a .app. It is included in all of our Xcode project templates. > Now I'd like to something like this: > > NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: > @"Hello World", @"myLocal", > NULL]; > > PyRun_String("print myLocal', 0, NULL, (PyObject *)theLocals); > > Now obviously I realise that casting an Objective-C type to a PyObject > aint going to be work but is there someway of getting Objective-C > objects into Python from Objective-C? The PyObjC bridge provides a transparent bridge between Objective-C and Python, including totally transparent sharing of dictionaries, lists, and [mostly] strings. Hence, if you can get an NSDictionary into Python, it shows up as a python dictionary. See the list archives. I wrote up a post a couple of months ago that described how to use PyObjC in the context of providing the bridge between ObjC and Python for the purposes of embedding Python into an app. It proves to be an incredibly powerful and easy to use means of doing so, much more so than using Python's C embedding API directly. Very high level summary: You simply need to trigger a bit of Python during app launch that can instantiate some random object and pass it into ObjC. From there, you can simply message that object in ObjC (just like any other ObjC object) to pass control to Python. b.bum |
From: Jonathan W. <jw...@ma...> - 2004-07-20 00:24:02
|
I need to embed Python(.framework) inside a Cocoa application I'm working on. Now I'd like to something like this: NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: @"Hello World", @"myLocal", NULL]; PyRun_String("print myLocal', 0, NULL, (PyObject *)theLocals); Now obviously I realise that casting an Objective-C type to a PyObject aint going to be work but is there someway of getting Objective-C objects into Python from Objective-C? Jon. (Sorry if this turns out being a double-post) |
From: Jonathan W. <jw...@ma...> - 2004-07-19 22:11:43
|
I need to embed Python(.framework) inside a Cocoa application I'm working on. Now I'd like to something like this: NSDictionary *theLocals = [NSDictionary dictionaryWithObjectsAndKeys: @"Hello World", @"myLocal", NULL]; PyRun_String("print myLocal', 0, NULL, (PyObject *)theLocals); Now obviously I realise that casting an Objective-C type to a PyObject aint going to be work but is there someway of getting Objective-C objects into Python from Objective-C? Jon. |
From: Tim J. <tm...@ja...> - 2004-07-19 17:30:06
|
On 19 Jul 2004, at 16:36, b.bum wrote: > On Jul 19, 2004, at 7:40 AM, Ronald Oussoren wrote: >> Does anyone have a link to a general Cocoa page that explains how >> nib-files work? Tim is not the first person on this list with this >> question and I want to add some text about this to the documentation >> with a link to more extensive information. > > http://developer.apple.com/tools/interfacebuilder/ > > There really isn't much to it. Most of the confusion comes from > assuming magic. > > (1) A NIB file is just a freeze dried, pickled, archived, object graph > of the UI elements as edited in IB. > > (2) Any interface you can create in IB can be created programatically > via public API. > > (3) The "File's Owner" is your "gateway" into the NIB file when > loading nib file's manually. All connections to/from File's Owner > will be resolved against the owner: parameter that you pass to this > method: > > + (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner; > > That is about it (off the top of my head). The rest of the features > found within IB are really just UI around API found in Cocoa. Thanks b.bum (and everyone else that replied). I suspect I'm not the only person coming to this from a background of wx/Tk/GTK and wondering WTF is going on! Apple's docs seem pretty comprehensive but they assume that you already know what you're looking for. Now I have somewhere to start... It would be nice if this were a FAQ and/or included in the PyObjC docs somewhere - this is such a different paradigm from other GUI toolkits out there that it merits a brief intro. Aternatively, anyone up for creating a demo along the lines of the wx one? Many people like to learn by example. I'd do it myself if I had a clue what I was doing :) Thanks once again all, Tim J |
From: b.bum <bb...@ma...> - 2004-07-19 15:37:04
|
On Jul 19, 2004, at 7:40 AM, Ronald Oussoren wrote: > Does anyone have a link to a general Cocoa page that explains how > nib-files work? Tim is not the first person on this list with this > question and I want to add some text about this to the documentation > with a link to more extensive information. http://developer.apple.com/tools/interfacebuilder/ There really isn't much to it. Most of the confusion comes from assuming magic. (1) A NIB file is just a freeze dried, pickled, archived, object graph of the UI elements as edited in IB. (2) Any interface you can create in IB can be created programatically via public API. (3) The "File's Owner" is your "gateway" into the NIB file when loading nib file's manually. All connections to/from File's Owner will be resolved against the owner: parameter that you pass to this method: + (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner; That is about it (off the top of my head). The rest of the features found within IB are really just UI around API found in Cocoa. |
From: Ronald O. <ron...@ma...> - 2004-07-19 14:41:28
|
On Jul 19, 2004, at 4:05 PM, Zachery Bir wrote: > On Jul 19, 2004, at 3:09 AM, Bob Ippolito wrote: > >> Anyway, to answer your question, that information isn't going to do >> much for you since nib files deal primarily in serialized instances. >> I don't remember exactly what you need to do off the top of my head, >> but I do know that there are several PyObjC examples that use >> multiple nibs, so they probably have multiple windows. I think you >> should take a look at PackageManager or maybe Todo. > > ZopeEditManager uses multiple windows and even some sheets. Source > available: > > > <http://zope.org/Members/urbanape/ZopeEditManager/ > ZopeEditManager%200.9.4/ZopeEditManager-0.9.4-src.tar.gz> > > Unless you mean multiple windows as in a document-based application, > in which case ZEM probably won't help. Does anyone have a link to a general Cocoa page that explains how nib-files work? Tim is not the first person on this list with this question and I want to add some text about this to the documentation with a link to more extensive information. Ronald > > Zac > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Zachery B. <zb...@ur...> - 2004-07-19 14:05:27
|
On Jul 19, 2004, at 3:09 AM, Bob Ippolito wrote: > Anyway, to answer your question, that information isn't going to do > much for you since nib files deal primarily in serialized instances. > I don't remember exactly what you need to do off the top of my head, > but I do know that there are several PyObjC examples that use multiple > nibs, so they probably have multiple windows. I think you should take > a look at PackageManager or maybe Todo. ZopeEditManager uses multiple windows and even some sheets. Source available: <http://zope.org/Members/urbanape/ZopeEditManager/ ZopeEditManager%200.9.4/ZopeEditManager-0.9.4-src.tar.gz> Unless you mean multiple windows as in a document-based application, in which case ZEM probably won't help. Zac |
From: Ronald O. <ron...@ma...> - 2004-07-19 10:14:44
|
On Jul 19, 2004, at 11:54 AM, Jack Jansen wrote: > > On 19-jul-04, at 11:45, Ronald Oussoren wrote: > >>> - The phrasing on WebKit in Install.html seems to indicate that >>> support for WebKit is optional. However, when you try "setup.py >>> build" without doing anything about webkit things don't compile: >>> setup.py still tries to build webkit, but fails. >> >> What OS version are you using? I guess 10.2.X with Safari >= 1.0. > > No, 10.3.4 with Safari 1.3 Developer Beta (v146). > > Does the fact that I'm running Safari 1.3beta have something to do > with it, maybe? Could be. You're running pre-release software after all ;-) > >>> - Worse: if you then go to the developer connection website you >>> can't find webkit. At least: I searched far and wide but couldn't >>> find it... Where is it? >> >> It used to be on connect.apple.com, but it seems to have disappeared. > > So, if I understand correctly, you shouldn't have to download WebKit > SDK if you're on 10.3, and my problems are due to having installed a > beta Safari? WebKit is only needed when you run on OSX 10.2.X with Safari 1.X. Your problems seem to be caused by running Safari 1.3, although that doesn't mean Safari is at fault. > >>> - Now, I've installed everything. I happen to know there's an >>> extensive test suite for PyObjC, but: >>> - Where is it? >>> - How do I run it? >> >> Scripts/runPyObjCTests will run it. The tests are in 'test' >> subpackages of the various packages. > > Didn't work. It always complains with a very strange message: > ValueError: dylib /Users/jack/src/pyobjc/Versions/Current/ScreenSaver > could not be found > The full traceback is attached.<@runlog> > > I did find Scripts/runalltests too, and that does a lot more. However, > after having done about 30 tests it hangs, in > Lib/Foundation/test/test_osxcasts.py. You have found some bugs in the interaction between Python 2.4a1 and PyObjC :-(. I'll have a look later this week. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Jack J. <Jac...@cw...> - 2004-07-19 09:53:25
|
On 19-jul-04, at 11:45, Ronald Oussoren wrote: >> - The phrasing on WebKit in Install.html seems to indicate that >> support for WebKit is optional. However, when you try "setup.py >> build" without doing anything about webkit things don't compile: >> setup.py still tries to build webkit, but fails. > > What OS version are you using? I guess 10.2.X with Safari >= 1.0. No, 10.3.4 with Safari 1.3 Developer Beta (v146). Does the fact that I'm running Safari 1.3beta have something to do with it, maybe? >> - Worse: if you then go to the developer connection website you can't >> find webkit. At least: I searched far and wide but couldn't find >> it... Where is it? > > It used to be on connect.apple.com, but it seems to have disappeared. So, if I understand correctly, you shouldn't have to download WebKit SDK if you're on 10.3, and my problems are due to having installed a beta Safari? >> - Now, I've installed everything. I happen to know there's an >> extensive test suite for PyObjC, but: >> - Where is it? >> - How do I run it? > > Scripts/runPyObjCTests will run it. The tests are in 'test' > subpackages of the various packages. Didn't work. It always complains with a very strange message: ValueError: dylib /Users/jack/src/pyobjc/Versions/Current/ScreenSaver could not be found The full traceback is attached. |
From: Ronald O. <ron...@ma...> - 2004-07-19 09:45:50
|
On Jul 19, 2004, at 11:22 AM, Jack Jansen wrote: > After a hiatus of a couple of months I decided to start building > pyobjc from scratch again. Here's a list of surprises I came across: > > - http://pyobjc.sourceforge.net tells people to use svn, but it would > be nice if it contained a pointer to the easily installed svn from > <http://www.codingmonkeys.de/mbo/>. That a good idea. > - The homepage doesn't tell me what I need to do to get commit > privileges. Ask here? The procedure is the same as it ever was: ask it on the list. > - "Can I get commit privileges, please? Do I need to checkout in a > special way to use these?" That's fine with me, but Bill B. does the actual SVN magic. You'll have to wait until he wakes up :-) > - The NEWS.html document has release 1.0rc2 as the latest entry! Whoops. > - Install.html tells you to download libffi from the SF download > pages, but if you go there you find two copies of libffi, and it's > unclear which one to use (one is more recent, but the other one > specifically says its been patched for use with pyobjc). I'm going to hide the older one. I'm also thinking about including libffi in the SVN repository, that takes away the need to have a seperate download for libffi and makes sure that everyone uses the right version of libffi. > - The phrasing on WebKit in Install.html seems to indicate that > support for WebKit is optional. However, when you try "setup.py > build" without doing anything about webkit things don't compile: > setup.py still tries to build webkit, but fails. What OS version are you using? I guess 10.2.X with Safari >= 1.0. To be honest, I haven't build on 10.2 for a while and I can't even boot into 10.2 at the moment. > - Worse: if you then go to the developer connection website you can't > find webkit. At least: I searched far and wide but couldn't find it... > Where is it? It used to be on connect.apple.com, but it seems to have disappeared. > - Manually commenting out WebKit fixed that. That shouldn't be necessary. I'll look into this once I have restored my 10.2 system. > - Now, I've installed everything. I happen to know there's an > extensive test suite for PyObjC, but: > - Where is it? > - How do I run it? Scripts/runPyObjCTests will run it. The tests are in 'test' subpackages of the various packages. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Jack J. <Jac...@cw...> - 2004-07-19 09:21:08
|
After a hiatus of a couple of months I decided to start building pyobjc from scratch again. Here's a list of surprises I came across: - http://pyobjc.sourceforge.net tells people to use svn, but it would be nice if it contained a pointer to the easily installed svn from <http://www.codingmonkeys.de/mbo/>. - The homepage doesn't tell me what I need to do to get commit privileges. Ask here? - "Can I get commit privileges, please? Do I need to checkout in a special way to use these?" - The NEWS.html document has release 1.0rc2 as the latest entry! - Install.html tells you to download libffi from the SF download pages, but if you go there you find two copies of libffi, and it's unclear which one to use (one is more recent, but the other one specifically says its been patched for use with pyobjc). - The phrasing on WebKit in Install.html seems to indicate that support for WebKit is optional. However, when you try "setup.py build" without doing anything about webkit things don't compile: setup.py still tries to build webkit, but fails. - Worse: if you then go to the developer connection website you can't find webkit. At least: I searched far and wide but couldn't find it... Where is it? - Manually commenting out WebKit fixed that. - Now, I've installed everything. I happen to know there's an extensive test suite for PyObjC, but: - Where is it? - How do I run it? -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |
From: Ronald O. <ron...@ma...> - 2004-07-19 07:28:55
|
On Jul 16, 2004, at 12:15 PM, Tim Jarman wrote: > (Apologies if this post appears twice.) > > This must be a FAQ but I'm blessed if I can find the answer anywhere. > > I'm new to Cocoa and Objective-C but not to Python or GUI programming > in general. I've worked through the currency convertor tutorial and > searched the Apple developer documentation as well as Googling > extensively but no joy. There is almost certainly a simple answer to > this and I'm sure I'll be kicking myself once it's been pointed out to > me... > > The app I am writing will have several windows in it. It needs to > start off by presenting a modal dialog the user (in order to log on to > a server). I've created a nib file and that all works fine but I > can't figure out how to create and show the dialog. Trying to > instantiate the class generated by NibClassBuilder gives me an error > message telling me to use a class method... but not which one. I don't > have much of a clue where this generated class fits into the Cocoa > class hierarchy - a comment says it's a subclass of NSObject but so > are quite a lot of things. Is it (equivalent to) an NSWindow? An > NSView? I suppose you defined a controller class in the NIB? If you create an instance of that class in Interface Builder it will be recreated when you load the NIB (which is done automaticly for the main NIB-file). Create an outlet in the controller that is connected to the login window, and tell that window to show itself in awakeFromNib (or check the box that says the window should be shown when loaded). Ronald BTW. Your message was in the non-subscribers queue. -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Ronald O. <ron...@ma...> - 2004-07-19 07:11:18
|
On Jul 18, 2004, at 3:43 AM, Francesco Pierfederici wrote: > > Hi, > > You are right. Both version exhibit the same behaviour. Sorry about > the false alarm. There must be something in NSOpenGLView that I don't > fully understand... It might also be a bug in NSOpenGLView. You might ask around on one of the Cocoa lists. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Bob I. <bo...@re...> - 2004-07-19 07:09:19
|
On Jul 16, 2004, at 6:15 AM, Tim Jarman wrote: > This must be a FAQ but I'm blessed if I can find the answer anywhere. > > I'm new to Cocoa and Objective-C but not to Python or GUI programming =20= > in general. I've worked through the currency convertor tutorial and =20= > searched the Apple developer documentation as well as Googling =20 > extensively but no joy. There is almost certainly a simple answer to =20= > this and I'm sure I'll be kicking myself once it's been pointed out to = =20 > me... > > The app I am writing will have several windows in it. It needs to =20 > start off by presenting a modal dialog the user (in order to log on to = =20 > a server). I've created a nib file and that all works fine but I =20 > can't figure out how to create and show the dialog. Trying to =20 > instantiate the class generated by NibClassBuilder gives me an error =20= > message telling me to use a class method... but not which one. I don't = =20 > have much of a clue where this generated class fits into the Cocoa =20 > class hierarchy - a comment says it's a subclass of NSObject but so =20= > are quite a lot of things. Is it (equivalent to) an NSWindow? An =20 > NSView? > > As you can tell I'm a bit confused here! Can anyone point me in the =20= > right general direction? ObjC classes are *never* instantiated in the typical Python style of =20 ClassName(....), because that's just not how ObjC works. ObjC uses =20 explicit selectors for creating instances (usually +new in ObjC, sort =20= of similar to __new__ in Python) and initializing them (usually is or =20= starts with -init, roughly equivalent to __init__ in Python). To instantiate an ObjC class you need to figure out what the designated =20= initializer for the class is. The initialization pattern for NSObject =20= is NSObject.alloc().init() (or NSObject.new(), they're equivalent). =20 Apple's documentation should always point out what the designated =20 initializer for a particular class is, in the case of NSWindow it is: =96 initWithContentRect:styleMask:backing:defer: =46rom PyObjC you would do something along the lines of: myWindowInstance =3D =20 MyWindowSubclass.alloc().initWithContentRect_styleMask_backing_defer_=20 (...) Note that there very well could be more convenient methods for =20 initializing a NSWindow instance, but they are all "guaranteed" to end =20= up doing this at some point because this is the designated initializer. =20= It's typical for initialization methods to start with "init", but =20 that's not enforced by anything. Anyway, to answer your question, that information isn't going to do =20 much for you since nib files deal primarily in serialized instances. I =20= don't remember exactly what you need to do off the top of my head, but =20= I do know that there are several PyObjC examples that use multiple =20 nibs, so they probably have multiple windows. I think you should take =20= a look at PackageManager or maybe Todo. -bob |
From: Francesco P. <fpi...@no...> - 2004-07-18 01:43:40
|
Hi, You are right. Both version exhibit the same behaviour. Sorry about the false alarm. There must be something in NSOpenGLView that I don't fully understand... Anyway, I manage to work around the problem by making use of my NSOpenGLView superview bounds rect. That seems to be working fine. Oh well. Cheers Francesco >> Hi everybody! >> >> I have some python code (using PyObjC 1.1 and PyOpenGL) that, among >> other things uses the visibleRect() method of a NSOpenGLView (which >> is inside a NSScrollView). >> >> Things work fine most of the time. The problem arises when >> >> 1. The size of the NSOpenGLView is bigger than its visible rect AND >> 2. The NSOpenGLView is resized via self.setFrameSize_() AND >> 3. The vertical scrollbar of the SNScrollView is at the top. >> >> What happens in that case is that reshape() gets called. In reshape() >> I call self.visibleRect() which returns a rectangle with zero-length >> width and height. > > I can reproduce that with *both* versions. If added a print/NSLog > statement to the start of the reshape method to see every call to > reshape and the two versions behave simularly. > > BTW. Thanks for providing a python and an ObjC version, that makes > testing a lot easier. > > Ronald > -- > X|support bv http://www.xsupport.nl/ > T: +31 610271479 F: +31 204416173 |
From: Ronald O. <ron...@ma...> - 2004-07-17 19:08:12
|
On Jul 16, 2004, at 11:37 PM, Francesco Pierfederici wrote: > > Hi everybody! > > I have some python code (using PyObjC 1.1 and PyOpenGL) that, among > other things uses the visibleRect() method of a NSOpenGLView (which is > inside a NSScrollView). > > Things work fine most of the time. The problem arises when > > 1. The size of the NSOpenGLView is bigger than its visible rect AND > 2. The NSOpenGLView is resized via self.setFrameSize_() AND > 3. The vertical scrollbar of the SNScrollView is at the top. > > What happens in that case is that reshape() gets called. In reshape() > I call self.visibleRect() which returns a rectangle with zero-length > width and height. I can reproduce that with *both* versions. If added a print/NSLog statement to the start of the reshape method to see every call to reshape and the two versions behave simularly. BTW. Thanks for providing a python and an ObjC version, that makes testing a lot easier. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 |
From: Francesco P. <fpi...@no...> - 2004-07-16 21:37:21
|
Hi everybody! I have some python code (using PyObjC 1.1 and PyOpenGL) that, among other things uses the visibleRect() method of a NSOpenGLView (which is inside a NSScrollView). Things work fine most of the time. The problem arises when 1. The size of the NSOpenGLView is bigger than its visible rect AND 2. The NSOpenGLView is resized via self.setFrameSize_() AND 3. The vertical scrollbar of the SNScrollView is at the top. What happens in that case is that reshape() gets called. In reshape() I call self.visibleRect() which returns a rectangle with zero-length width and height. I have sample code to illustrate the problem, both in ObjC and python. The ObjC code works as expected, the python one does not (one is just the translation of the other). Just compile, run, scroll all the way to the top and click the mouse inside the window. Python: http://www.noao.edu/staff/fpierfed/test/openglviewtest.zip ObjC: http://www.noao.edu/staff/fpierfed/test/openglviewtestObjC.zip Any help would be greatly appreciated! Cheers Francesco |
From: Tim J. <tm...@ja...> - 2004-07-16 10:14:16
|
(Apologies if this post appears twice.) This must be a FAQ but I'm blessed if I can find the answer anywhere. I'm new to Cocoa and Objective-C but not to Python or GUI programming in general. I've worked through the currency convertor tutorial and searched the Apple developer documentation as well as Googling extensively but no joy. There is almost certainly a simple answer to this and I'm sure I'll be kicking myself once it's been pointed out to me... The app I am writing will have several windows in it. It needs to start off by presenting a modal dialog the user (in order to log on to a server). I've created a nib file and that all works fine but I can't figure out how to create and show the dialog. Trying to instantiate the class generated by NibClassBuilder gives me an error message telling me to use a class method... but not which one. I don't have much of a clue where this generated class fits into the Cocoa class hierarchy - a comment says it's a subclass of NSObject but so are quite a lot of things. Is it (equivalent to) an NSWindow? An NSView? As you can tell I'm a bit confused here! Can anyone point me in the right general direction? Many thanks, Tim J (This is using Panther, Apple's supplied Python 2.3 and PyObjC 1.1 BTW) |
From: Tim J. <tm...@ja...> - 2004-07-15 14:28:08
|
This must be a FAQ but I'm blessed if I can find the answer anywhere. I'm new to Cocoa and Objective-C but not to Python or GUI programming in general. I've worked through the currency convertor tutorial and searched the Apple developer documentation as well as Googling extensively but no joy. There is almost certainly a simple answer to this and I'm sure I'll be kicking myself once it's been pointed out to me... The app I am writing will have several windows in it. It needs to start off by presenting a modal dialog the user (in order to log on to a server). I've created a nib file and that all works fine but I can't figure out how to create and show the dialog. Trying to instantiate the class generated by NibClassBuilder gives me an error message telling me to use a class method... but not which one. I don't have much of a clue where this generated class fits into the Cocoa class hierarchy - a comment says it's a subclass of NSObject but so are quite a lot of things. Is it (equivalent to) an NSWindow? An NSView? As you can tell I'm a bit confused here! Can anyone point me in the right general direction? Many thanks, Tim J (This is using Panther, Apple's supplied Python 2.3 and PyObjC 1.1 BTW) |
From: Jack J. <Jac...@cw...> - 2004-07-13 22:06:11
|
Changing the subject, and addding pyobjc-dev to the distribution here: On 13 Jul 2004, at 23:07, David Eppstein wrote: > Another reason for wishing for PIL support in PyObjC, or at least some > means of interoperating between the two: if your program is written in > good MVC style (which the previous version of the one I was working on > very much was not) then, even if the view part is platform-specific > PyObjC Cocoa for that yummy native look'n'feel, it would still be good > to have a more portable model. So, if the model involves image > processing, portability for Python means doing it in PIL rather than > Cocoa. Ah, yes! One of the things that I would like to have in the PyObjC distribution (but haven't had the time to write:-) is an example using Model-View-Controller, and showing how you would write a cross-platform app that used PyObjC/Interface Builder on the Mac and something else on other platforms. Anyone willing to pick this one up? -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |
From: Bob I. <bo...@re...> - 2004-07-09 23:58:04
|
On Jul 9, 2004, at 7:49 PM, Jordan Krushen wrote: > On 9-Jul-04, at 4:28 PM, Bob Ippolito wrote: > >> Ok, I've confirmed that it does indeed crash here. Unfortunately I >> can't fix it until next week at the earliest. > > That's cool. I'm gone for a week anyway :) I'll test things when I > get back. This is a PyObjC bug, or a Twisted one? Either, both? I really don't have time to look into it. -bob |
From: Jordan K. <jo...@kr...> - 2004-07-09 23:49:32
|
On 9-Jul-04, at 4:28 PM, Bob Ippolito wrote: > Ok, I've confirmed that it does indeed crash here. Unfortunately I > can't fix it until next week at the earliest. That's cool. I'm gone for a week anyway :) I'll test things when I get back. This is a PyObjC bug, or a Twisted one? J. |