• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[pyobjc] Custom sheet and didEndSelector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pyobjc] Custom sheet and didEndSelector


  • Subject: [pyobjc] Custom sheet and didEndSelector
  • From: Domenico Testa <email@hidden>
  • Date: Tue, 27 Jan 2009 14:58:59 +0100

I want to show a custom sheet asking user for a choice depending on the
button clicked.
That's my code:

class SignOptionsController(NSWindowController):

    ....

    @IBAction
    def showModalSheet_(self, parentWindow):
        didEndSelector =
objc.selector(self.didEndSheet_retunCode_contextInfo_, signature='v@:@ii')
        if not self.sheet:
            NSBundle.loadNibNamed_owner_(u"SignOptionsWindow", self)


NSApp.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(self.sheet,
parentWindow, self, didEndSelector, 0)

    def didEndSheet_returnCode_contextInfo_(self, sheet, returnCode,
contextInfo):
        NSLog(u"Return code is %s" % (returnCode,))
        sheet.orderOut_(self)

    @IBAction
    def confirmSignOperation(self, sender):
        NSApp.endSheet_returnCode_(self.window(), NSOKButton)

    @IBAction
    def abortSignOperation(self, sender):
        NSApp.endSheet_returnCode_(self.window(), NSCancelButton)

When i click on dismiss button (bound to abortSignOperation action) or on OK
button (bound on confirmSignOperation action) i obtain a BAD ACCESS
EXCEPTION.

--
Domenico Testa
http://del.icio.us/domtes
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: IntefaceBuilder IPhone TableView Size Question
  • Next by Date: Re: IntefaceBuilder IPhone TableView Size Question
  • Previous by thread: Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
  • Next by thread: Re: [pyobjc] Custom sheet and didEndSelector
  • Index(es):
    • Date
    • Thread