home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Languages / python / PyObjC-0.47-MIHS / pyobjc-0.47-src / Demo / ObjC / AlertPanel / AlertPanel.py < prev    next >
Encoding:
Python Source  |  1996-09-30  |  1.1 KB  |  43 lines

  1. #!/usr/local/bin/python
  2. #
  3. # Copyright (c) 1996 by Lele Gaifax.  All Rights Reserved
  4. #
  5. # This file is part of Nothing (yet).
  6. #
  7. # $RCSfile: AlertPanel.py,v $
  8. # $Revision: 1.1.1.1 $
  9. # $Date: 1996/09/30 06:06:48 $
  10. #
  11. # Created Wed Sep  4 15:36:04 1996.
  12. #
  13.  
  14. import ObjC
  15.  
  16. NXBundle = ObjC.lookup_class ('NXBundle')
  17.  
  18. def my_callback (status):
  19.     print "This is callback! Called with status %d" % status
  20. # end def
  21.  
  22. ap_bundle = NXBundle.alloc().initForDirectory__ ('AlertPanel.bundle')
  23. AlertPanel = ap_bundle.principalClass()
  24.  
  25. if AlertPanel:
  26.     simple = AlertPanel.alloc().initWithTitle__ ('Simple Panel')
  27.     simple.setAction__ (my_callback)
  28.     simple.run()
  29.  
  30.     do_u_c_me = AlertPanel.alloc()
  31.     do_u_c_me.initWithTitle__message__defaultButton__altButton__otherButton__ ('Alert Panel Test',
  32.                                            'Do you see me?',
  33.                                            'Yes, very well',
  34.                                            "No, but I'm pressing the mouse button everywhere",
  35.                                            "Why do you wanna know?")
  36.     do_u_c_me.run()
  37.     print do_u_c_me.buttonTitle()
  38. else:
  39.     print "Did you compiled the bundle first?"
  40. # end if
  41.  
  42.  
  43.