bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #24093] windowWillResize:toSize: apparently not called


From: Maurizio Tomasi
Subject: [bug #24093] windowWillResize:toSize: apparently not called
Date: Mon, 18 Aug 2008 05:13:39 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1

URL:
  <http://savannah.gnu.org/bugs/?24093>

                 Summary: windowWillResize:toSize: apparently not called
                 Project: GNUstep
            Submitted by: zio_tom78
            Submitted on: Mon 18 Aug 2008 05:13:37 AM GMT
                Category: Backend
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I am using GNUstep on an Ubuntu 8.04 system, installed using the GNUstep
Startup package version 0.20.0. I am trying to complete the first exercise
proposed by A. Hillegass in chapter 6 of his book "Cocoa programming for Mac
OS X" (third edition). The exercise asks to write a delegate for a window that
answers the "windowWillResize:toSize:" message. 

It seems that GNUstep never calls this method. Here is the interesting part
of the AppDelegate class I implemented (mainWindow is a pointer to the
NSWindow I am resizing, its delegate has been set using Gorm):

- (NSSize) windowWillResize: (NSWindow *) window
                     toSize: (NSSize) proposedFrameSize
{
    NSLog (@"windowWillResize:toSize: called");
    return proposedFrameSize;
}

- (void) windowDidResize: (NSNotification *) aNotification
{
    NSLog (@"windowDidResize: called");
}

- (void)applicationWillTerminate:(NSNotification *)aNotif
{
    NSLog (@"Is the window's delegate correct? %d", 
           [mainWindow delegate] == self);

    SEL selector = @selector (windowWillResize:toSize:);
    NSLog (@"Does it respond to windowWillResize:toSize? %d",
       [[mainWindow delegate] respondsToSelector: selector]);
}

This is the log I get when I try to resize "mainWindow" and then close the
application:

2008-08-18 07:11:48.975 WindowWillResizeTest[14827] Ignore bottom offset
change from 32 to 9
2008-08-18 07:11:48.976 WindowWillResizeTest[14827] Reparent was with offset
0 23
2008-08-18 07:11:48.976 WindowWillResizeTest[14827] Parent
border,width,height 1,313,320
2008-08-18 07:11:52.579 WindowWillResizeTest[14827] windowDidResize: called
2008-08-18 07:11:53.513 WindowWillResizeTest[14827] Is the window's delegate
correct? 1
2008-08-18 07:11:53.513 WindowWillResizeTest[14827] Does it respond to
windowWillResize:toSize? 1

As you can see, there is a log message printed by windowDidResize but nothing
from windowWillResize, despite the selector being correct. 

I am using the default backend installed by GNUstep Startup:

$ defaults read NSGlobalDomain GSBackend
NSGlobalDomain GSBackend libgnustep-back

The full application source is attached.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 18 Aug 2008 05:13:37 AM GMT  Name: WindowWillResizeTest.tar.gz 
Size: 5kB   By: zio_tom78
Sources of a test application showing the problem
<http://savannah.gnu.org/bugs/download.php?file_id=16308>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24093>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]