Movies and Menus
Subject:   some isolations
Date:   2002-02-01 11:16:34
From:   psheldon
Response to: Thanks, some observations

I used the original nib file before I started messing with autoresizing.
I was able to comment out your file types and get some action.
Now, I've lost autoresizing code, for, when I try to use it, the movie window dissappears.
The best I can show you is the code with the resizing stuff commented out so the window doesn't dissappear. I don't know how to make a cleaner isolation or leaner question presentation than showing this.

- (IBAction)openMovie:(id)sender
NSArray *fileTypes = [NSArray arrayWithObjects:@"mov", @"mpg",
@"jpg", nil];
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
int result = [oPanel runModalForDirectory:NSHomeDirectory() file:nil types:fileTypes];
if (result == NSOKButton)

//the following were added
NSWindow *window = [NSApp mainWindow];
NSRect frameView = [movieView frame];
NSSize viewSize;

NSArray *movieToOpen = [oPanel URLs];
NSURL *movieURL = [movieToOpen objectAtIndex:0];
NSMovie *movie = [[NSMovie alloc] initWithURL:movieURL byReference:NO];

[movieView showController:YES adjustingSize:YES];//michele

//the following were added (dimamarkman "FileTypes and Resizing" unless otherwise commented)
[window setTitle:[[[oPanel filenames] objectAtIndex:0] lastPathComponent]];

[movieView setMovie:movie];

//the following were added (dimamarkman "FileTypes and Resizing" unless otherwise commented)
//[movieView showController:YES adjustingSize:YES];//michele
//viewSize = [movieView sizeForMagnification:1.0];
//[movieView resizeWithMagnification:1.0];
[window makeKeyAndOrderFront: self];//michele

//viewSize.width = 2*frameView.origin.x + viewSize.width;
//viewSize.height = 2*frameView.origin.y + viewSize.height;
//[window setContentSize:viewSize];

[window display];//michele


1 to 1 of 1
  1. some isolations
    2002-02-01 13:11:27  michele [View]

    • tried your ordering and no springs
      2002-02-02 10:27:24  psheldon [View]

      • forgot to tell fact
        2002-02-02 10:32:53  psheldon [View]

        • thanks michele
          2002-02-03 21:56:46  psheldon [View]

        • added if before size adjustment to avoid mp3's
          2002-02-02 18:50:56  psheldon [View]

1 to 1 of 1