• 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
Modal Windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal Windows


  • Subject: Modal Windows
  • From: Joaquín Sánchez <email@hidden>
  • Date: Wed, 23 Dec 2009 00:21:03 +0100

Hello, I'm new here.

I have a problem.

I have two window, main window, and another window call NSWindow *cargaCaracteristicasHormigon;
 when I would like to see them, press a bottom there, and it's no problem:

-(IBAction)showCaracteristicasHormigonSheet:(id)sender{
	if (piezaSeleccionada>-1) {
		float f;
		int i=0;
		for(Hormigon *h in armadoPrincipal.geometriaPrincipal.claseDeHormigon)
		{
			if (i==piezaSeleccionada) {
				f=h.fck;
			}
			i++;

		}
		[fckString setFloatValue:f];
		[NSApp beginSheet:cargaCaracteristicasHormigon
		   modalForWindow:[inPinta window]
			modalDelegate:nil
		   didEndSelector:NULL
			  contextInfo:NULL];

	}

}

this is ok.

but when I would like  to get this window make a click in a view I have the follow error:

2009-12-23 00:08:10.482 Secciones[1682:a0f] *** Assertion failure in -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:], /SourceCache/AppKit/AppKit-1038.25/AppKit.subproj/NSApplication.m:3100
2009-12-23 00:08:10.483 Secciones[1682:a0f] Modal session requires modal window

the code that I try is this:


-(void)mouseDown:(NSEvent *)theEvent{
	if (pintarRectangulo) {

		if (inicio) {
			path=[[NSBezierPath alloc] init];
			puntoInicial=[theEvent locationInWindow];
			[path moveToPoint:[theEvent locationInWindow]];
			inicio=!inicio;
		}else {
			puntoFinal=[theEvent locationInWindow];
			[path lineToPoint:NSMakePoint(puntoFinal.x, puntoInicial.y)];
			[path lineToPoint:puntoFinal];
			[path lineToPoint:NSMakePoint(puntoInicial.x, puntoFinal.y)];
			[path lineToPoint:puntoInicial];
			inicio=true;
			Hormigon *h=[[Hormigon alloc] initWithFck:30.0];
			NSString *s=[[NSString alloc] init];
			s=@"pieza";

			[NSApp beginSheet:cargaCaracteristicasHormigon
			   modalForWindow:[inPinta window]
				modalDelegate:nil
			   didEndSelector:NULL
				  contextInfo:NULL];

			[armadoPrincipal.geometriaPrincipal addGeometria:path tipoDeGeometria:s claseDeHormigon:h];

			pintarRectangulo=!pintarRectangulo;

		}
	}else {
		piezaSeleccionada=rectanguloSeleccionado;
	}

	[self setNeedsDisplay:YES];


}



Could help me anybody?, Please._______________________________________________

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

  • Follow-Ups:
    • Re: Modal Windows
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: Are views active or inactive?
  • Next by Date: NSViewAnimationFadeInEffect broken in Snow Leopard?
  • Previous by thread: Re: storing ivars in core data docs
  • Next by thread: Re: Modal Windows
  • Index(es):
    • Date
    • Thread