Crear sheet

2 views
Skip to first unread message

Jair Gaxiola

unread,
Sep 20, 2011, 2:46:30 PM9/20/11
to cocoah...@googlegroups.com
Hola,

Quiero crear un sheet he intentando con algunas lineas de codigo, pero
no me coloca la ventana modal como deberia. Desde IB tengo el MainMenu
para la ventana principal y un panel para el modal. ¿Alguien ha hecho
algo, que me faltara por poner?

from Foundation import *
from AppKit import *
import objc
class WindowController (NSWindowController):
sheet = objc.IBOutlet()
window = objc.IBOutlet()

@objc.IBAction
def doneSheet_(self, sender):
self.sheet.orderOut_(None)
NSApp.endSheet_(self.sheet)

@objc.IBAction
def showSheet_(self, sender):
NSApp.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(self.sheet,
self.window, self, None, None)


--
SIN ETIQUETAS.[ PUNTO ]
http://flavors.me/jyr
http://pythoncocoa.com
http://opentumblr.com

Jair Gaxiola

unread,
Sep 20, 2011, 11:37:43 PM9/20/11
to cocoah...@googlegroups.com
2011/9/20 Jair Gaxiola <jyr.g...@gmail.com>:

> Hola,
>
> Quiero crear un sheet he intentando con algunas lineas de codigo, pero
> no me coloca la ventana modal como deberia. Desde IB tengo el MainMenu
> para la ventana principal y un panel para el modal. ¿Alguien ha hecho
> algo, que me faltara por poner?
>
> from Foundation import *
> from AppKit import *
> import objc
> class WindowController (NSWindowController):
>    sheet = objc.IBOutlet()
>    window = objc.IBOutlet()
>
>    @objc.IBAction
>    def doneSheet_(self, sender):
>                self.sheet.orderOut_(None)
>                NSApp.endSheet_(self.sheet)
>
>    @objc.IBAction
>    def showSheet_(self, sender):
>                NSApp.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_(self.sheet,
> self.window, self, None, None)

Lo hice con https://gist.github.com/1229977

Reply all
Reply to author
Forward
0 new messages