discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GUI incompatibility


From: Fred Kiefer
Subject: Re: GUI incompatibility
Date: Wed, 13 May 2020 21:15:02 +0200

The relevant section in the sendEvent: method of NSWindow looks like this:


              if (wasKey == YES || [v acceptsFirstMouse: theEvent] == YES)
                {
                  if ([NSHelpManager isContextHelpModeActive])
                    {
                      [v helpRequested: theEvent];
                    }
                  else
                    {
                      ASSIGN(_lastLeftMouseDownView, v);
                      if (toolTipVisible != nil)
                        {
                          /* Inform the tooltips system that we have had
                           * a mouse down so it should stop displaying.
                           */
                          [toolTipVisible mouseDown: theEvent];
                        }
                      [v mouseDown: theEvent];
                    }
                }

Looks like we only call acceptsFirstMouse when the window was not already key. 
If this isn’t what Cocoa does, you need to explain the expected behaviour.
This code looks like it is there on purpose but Apple may have changed their 
implementation or documentation in the meantime.

Cheers,
Fred


> Am 13.05.2020 um 17:37 schrieb Andreas Höschler via Discussion list for the 
> GNUstep programming environment <discuss-gnustep@gnu.org>:
> 
> Hi Fred,
> 
> I am still trying to get my apps to work under GNUstep. I have already worked 
> around a couple of incompatibilities between Cocoa and GNUstep that caused 
> trouble. 
> 
> I now ended up at the following problem:
> 
> I have some NSView subclass on a window
> 
>       ValueElementCarrier : ElementCarrier : ComponentCarrier : 
> ControlCarrier : NSView
> 
> ValueElementCarrier has a subview
> 
>     FormTextField : NSTextField
> 
> over its complete rect. 
> 
> @implementation FormTextField
> 
> - (void)mouseDown:(NSEvent *)theEvent
> {
>    NSLog(@"%@ mouseDown ..", self);
>     ...
>     [super mouseDown:theEvent];
> }
> 
> - (BOOL)becomeFirstResponder
> {
>    BOOL result = ([(FBFormWindow *)[self window] designMode] ? NO : [super 
> becomeFirstResponder]);
>    NSLog(@"%@ becomeFirstResponder %d", self, result);
>    return result;
> }
> 
> - (BOOL)acceptsFirstMouse: (NSEvent*)theEvent
> {
>    BOOL result = [super acceptsFirstMouse:theEvent];
>    NSLog(@"%@ acceptsFirstMouse %d", self, result);
>    return result;
> }
> 
> @end
> 
> 
> When I click on this FormTextField on MacOSX I get
> 
> 13/05/20 17:23:40,783 InterfaceBuilder[93679]: <FormTextField: 0x102cd30> 
> acceptsFirstMouse 1
> 13/05/20 17:23:40,783 InterfaceBuilder[93679]: <FormTextField: 0x102cd30> 
> becomeFirstResponder 0
> 13/05/20 17:23:40,784 InterfaceBuilder[93679]: <FormTextField: 0x102cd30> 
> mouseDown ..
> 
> When I do the same on GNUstep I get
> 
> 13/05/20 17:23:40,783 InterfaceBuilder[93679]: <FormTextField: 0x102cd30> 
> becomeFirstResponder 0
> 
> but no call of acceptsFirstMouse and no call of mouseDown!?  This renders my 
> up inoperable! :-(
> 
> Any idea? Should this behaviour be fixed in GNUstep (handled equally)? 
> 
> Thanks,
> 
>  Andreas
> 
> 
> 
>  
> 
> 
> 




reply via email to

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