Re: [Pythonmac-SIG] simple pyobjc question

2005-11-15 Thread Ronald Oussoren

On 15-nov-2005, at 19:06, Tom Elliott wrote:

> I have 2 classes, one which responds to user input, calculates stuff
> and displays the result in a series of NSTextFields, and a second
> class that is a subclass of NSView called MyView, which can display
> the same type of information graphically.
>
> What I'd like is for the first class to be able to use MyView to
> display its results, but I don't know how to get them to talk to each
> other.  If I had an instance of MyView I could pass in data and call
> setNeedsDisplay(True) via a button in the interface.  How should I do
> this?

One way to do this is giving the first class a number of outlets that  
can
be connected to NSTextFields or MyViews. If you then implement  
'setFloatValue_'
in MyView you can connect your outlets to MyView to show the results.

BTW. This is a very basic Cocoa question. May I suggest looking for a  
Cocoa
tutorial?

Ronald

>
> Tom Elliott
> ___
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Paul Berkowitz
On 11/15/05 4:16 PM, "David Reed" <[EMAIL PROTECTED]> wrote:

>> [1] Aaron Hillegass, Cocoa Programming for OS X, ISBN: 0321213149
>> [2] Garfinkel and Mahoney, Building Cocoa Applications: A Step by
>> Step Guide, ISBN: 0596002351
>> [3] Scott Anguish, et al., Cocoa Programming, ISBN: 0672322307
>> [4] http://homepage.mac.com/aglee/downloads/appkido.html
> 
> 
> Thanks to everyone who replied. The [4] program looks excellent for a
> reference. I still need a book to help me "learn the Cocoa way" as
> Dethe puts it. I'll probably take a look at the above mentioned books
> and buy at least one of them. The Mac XCode 2 book I have also
> appears that it will be useful for learning to use XCode but not for
> really understanding Cocoa (as I would expect based on the title).

The Hillegass book is the best book on any programming language I have read.
Get it (2nd edition).

-- 
Paul Berkowitz


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] ANN: ActivePython 2.4.2 is now available

2005-11-15 Thread TrentM
I'm happy to announce that ActivePython 2.4.2 is now available for free
download from:
http://www.ActiveState.com/Products/ActivePython/

This release updates ActivePython to version 2.4.2, that was finalized a
few weeks ago. My apologies for the tardiness. If you'll believe it, I've
been busy implementing *Ruby* AutoComplete in Komodo.

One thing you may not have noticed is that ActivePython has added
support for a number of platforms in the past months. Installers are
available for the following operating systems and architectures:

- Windows/x86
- Mac OS X/powerpc (new)
- Linux/x86
- Solaris/SPARC
- Solaris/x86 (new)
- AIX/powerpc (new)
- HP-UX/PA-RISC (new)

We would welcome any and all feedback to:
[EMAIL PROTECTED]

Please file bugs against ActivePython at:
http://bugs.ActiveState.com/ActivePython


What is ActivePython?
-

ActivePython is ActiveState's quality-assured binary distribution of
Python. Builds for AIX, HP-UX, Linux, Mac OS X, Solaris, and Windows 
are made freely available.

ActivePython includes the Python core and core extensions (zlib 1.2.3,
bzip2 1.0.2, bsddb 4.2.52, Tk 8.4.9, and Tix 8.1.4) and is fully
compatible with other Python distributions of the same version.

ActivePython also includes a wealth of Python documentation, including:
- the core Python docs;
- Andrew Kuchling's "What's New in Python" series;
- the Non-Programmer's Tutorial for Python;
- Mark Pilgrim's excellent "Dive into Python"; and
- a snapshot of the Python FAQs, HOWTOs, and PEPs.

An online version of the docs can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/welcome.html

Extra Bits
--

ActivePython releases also include the following packages:

- Windows "debug" package: Debug-built binaries for ActivePython
  users building debug versions of their binary Python extensions.
- ActivePython24.chm: An MS compiled help collection of the full
  ActivePython documentation set. Linux users of applications such as
  xCHM might find this useful. This package is installed by default on
  Windows.

These packages are available from:
ftp://ftp.activestate.com/ActivePython/etc/


Thanks, and enjoy!

Trent, Python Tech Lead

--
Trent Mick
[EMAIL PROTECTED]

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread David Reed


On Nov 15, 2005, at 4:50 PM, Dethe Elza wrote:


Hi David,

While no one book covers all of Cocoa, going through a book can  
help give you a "feel" for how Cocoa programs come together.  I've  
often caught myself making things *way* more difficult than they  
need to be before I discovered the Coccoa Way To Do It.  I'm still  
learning the Cocoa Way, but it is worth the effort.


I've found that both the Hillegass[1] and Garfinkel[2] books were  
worth reading, as have quite different approaches and cover  
different parts of Cocoa to some degree.  I've heard good things  
about the Anguish[3] book, and while I haven't read it, I have read  
his earlier book and have high expectations of this one.


Finally, keeping something like AppKiDo[4] around can help you  
navigate the Apple documentation more readily.


I hope that helps.

--Dethe

[1] Aaron Hillegass, Cocoa Programming for OS X, ISBN: 0321213149
[2] Garfinkel and Mahoney, Building Cocoa Applications: A Step by  
Step Guide, ISBN: 0596002351

[3] Scott Anguish, et al., Cocoa Programming, ISBN: 0672322307
[4] http://homepage.mac.com/aglee/downloads/appkido.html



Thanks to everyone who replied. The [4] program looks excellent for a  
reference. I still need a book to help me "learn the Cocoa way" as  
Dethe puts it. I'll probably take a look at the above mentioned books  
and buy at least one of them. The Mac XCode 2 book I have also  
appears that it will be useful for learning to use XCode but not for  
really understanding Cocoa (as I would expect based on the title).


Dave




smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Dethe Elza
Hi David,

While no one book covers all of Cocoa, going through a book can help  
give you a "feel" for how Cocoa programs come together.  I've often  
caught myself making things *way* more difficult than they need to be  
before I discovered the Coccoa Way To Do It.  I'm still learning the  
Cocoa Way, but it is worth the effort.

I've found that both the Hillegass[1] and Garfinkel[2] books were  
worth reading, as have quite different approaches and cover different  
parts of Cocoa to some degree.  I've heard good things about the  
Anguish[3] book, and while I haven't read it, I have read his earlier  
book and have high expectations of this one.

Finally, keeping something like AppKiDo[4] around can help you  
navigate the Apple documentation more readily.

I hope that helps.

--Dethe

[1] Aaron Hillegass, Cocoa Programming for OS X, ISBN: 0321213149
[2] Garfinkel and Mahoney, Building Cocoa Applications: A Step by  
Step Guide, ISBN: 0596002351
[3] Scott Anguish, et al., Cocoa Programming, ISBN: 0672322307
[4] http://homepage.mac.com/aglee/downloads/appkido.html
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] simple pyobjc question

2005-11-15 Thread Tom Elliott
I have 2 classes, one which responds to user input, calculates stuff  
and displays the result in a series of NSTextFields, and a second  
class that is a subclass of NSView called MyView, which can display  
the same type of information graphically.

What I'd like is for the first class to be able to use MyView to  
display its results, but I don't know how to get them to talk to each  
other.  If I had an instance of MyView I could pass in data and call  
setNeedsDisplay(True) via a button in the interface.  How should I do  
this?

Tom Elliott
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Jack Nutting
On 11/15/05, Paul Davis <[EMAIL PROTECTED]> wrote:
Not that my opinion has much weight on this matter, but I also recentlystarted playing with PyObjC and Cocoa.  I really noticed that the APIdocumentation that apple provides is extremely hard to navigate.  Mybuddy told me that there are programs to read the documentation.  Of all
the programing languages and all the API's I have learned, this is thefirst time I've heard of such a thing.  I'm not sure what exactly thissays about the API, but I'm thinking its not good.  I don't really have
a point to make here.  And with that...I think it's a very good point.  It would be really nice if Apple had all the documentation in the header files, so that documentation in different formats (like Apple's current docs, or like Java html docs, or whatever) could be autogenerated, in particular so that people could generate whatever kind of docs they wanted.  If that were the case, it should even be easy to even generate PyObjC-syntax docs for the frameworks.  What the heck, I'll post it as a bug on 
http://bugreport.apple.com just for fun.-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] book recommendation

2005-11-15 Thread Jack Nutting
On 11/15/05, Dave Reed <[EMAIL PROTECTED]> wrote:
I've an experienced Python programmer on Linux - I've mainly used gtkand glade for interfaces and now I'm slowly trying to get startedwith Cocoa apps on X-Code.I've got the CurrencyConverter example working in Python and I did
the HelloWorld example in "The Mac XCode 2 Book" by Cohen and Cohenin Objective C. I got the Python version working  by guessing that Ineeded to use:self.helloSayer.setStringValue_("Hello world")
based on the CurrencyConverter example that did: setFloatValue_That was pretty obvious, but I think I need a Cocoa book that allowsme to see what all the methods are for a given object. I've juststarted the above mentioned XCode 2 book, but it doesn't appear to
have the details of all the Cocoa objects.Does anyone have a recommendation for another book I should get - Iassume I want a Cocoa book of some sort.I don't know if any of the available Cocoa books really cover the entire Foundation and AppKit APIs, but I kind of doubt it since the class libraries are so huge.
However, the API documentation is all installed along with XCode, ready for there to use.  You can browse the docs within XCode, but instead I'd recommend AppKiDo:
http://homepage.mac.com/aglee/downloads/appkido.htmlIt looks through the installed API documentation, and provides a slick, quick interface to search browse the class libraries, more quickly and effectively than a print book could ever provide (IMHO).
-- // jack// http://www.nuthole.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Calling python application from AppScript

2005-11-15 Thread has
David Person wrote:

>When I use this applescript, it works:
>
>   tell application a
>   set r to processEvent("system", "start")
>   end tell
>
>...but when I try from another python application I get an error:
>
>from appscript import *
>ap=app('pc-av')
>ap.processEvent('system','start')

Two things: 1. appscript only works for applications that have an aete/sdef 
terminology resource, and 2. it doesn't support the special 'ascrbsbr' event, 
which is not something used outside of AppleScript applets. You'd need to use 
aem instead:

from aem import *
Application(a).event('ascrpsbr', {'snam':'processevent', '':['system', 
'start']}).send()


Anyway, the usual approach would be to define a standard AE handler, e.g. 
'PCAVProE', with named parameters, '' (direct) and 'Par2'. That allows you 
to write:

Application(a).event('PCAVProE', {'':'system', 'Par2':'start'}).send()

or:

tell application a
set r to «event PCAVProE» "system" given «class Par2»:"start"
end tell

You can then add an aete/sdef resource to provide terminology for that command 
if you want.

HTH

has
-- 
http://freespace.virgin.net/hamish.sanderson/
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig