bugGNUstep - Bugs: bug #24093, windowWillResize:toSize:...


bug #24093: windowWillResize:toSize: apparently not called

Submitted by:  Maurizio Tomasi <zio_tom78>
Submitted on:  Mon 18 Aug 2008 05:13:37 AM UTC  
Category:  Backend Severity:  3 - Normal
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 19 Aug 2008 07:44:45 AM UTC, comment #1: 

Yes, this is a problem in the GNUstep code. In gui the only place where we call windowWillResize: is in the setFrame:display: method, which is the one place where we should not call it.
The underlying problem is that I currently don't see a way to get X events of the resize before the resize has finished. Any idea welcome!

Fred Kiefer <FredKiefer>
Project Member
Mon 18 Aug 2008 05:13:37 AM UTC, original submission:  

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.

Maurizio Tomasi <zio_tom78>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #16308:  WindowWillResizeTest.tar.gz added by zio_tom78 (5KiB - application/x-gzip - Sources of a test application showing the problem)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by zio_tom78 (Submitted the item)
  • -email is unavailable- added by zio_tom78 (Bug about windowWillResize:toSize:)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-18 zio_tom78 Attached File- => Added WindowWillResizeTest.tar.gz, #16308
        Carbon-Copy- => Added zio_tom78@hotmail.com

    Back to the top

    Powered by Savane 3.7