discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSPopUpButton


From: Pascal Bourguignon
Subject: Re: NSPopUpButton
Date: Sun, 7 Oct 2001 23:54:11 +0200 (CEST)

> Date: Sun, 7 Oct 2001 12:03:51 +0200
> From: "Philippe C.D. Robert" <phr@3dkit.org>
> 
> On Sun, 07 Oct 2001 00:17:55 +0200
> Fred Kiefer <FredKiefer@gmx.de> wrote:
> 
> > Georg Fleischmann wrote:
> > > 
> > > Enrico Sersale wrote:
> > > > Actually, is the NSPopUpButton code to be considered stable?
> > > 
> > > With the cvs version from Oct  4th pop up menus still seem quite
> > > unreliable to me.  Additionally pop  up menu items loaded from a
> > > gmodel file appear disabled.
> > 
> > I would not consider NSPopUpButton that stable myself. As the
> > specification is not telling which object should be sending the action
> > method of a menu entry, this code might be wrong. Someone should do some
> > testing on different platforms to determine the expected behaviour.
> 
> I am not sure  if we talk about the same issue  here, but I was told
> that there are some problems in that respect. 

Effectively, on  GNUstep (latest CVS), setEnable:YES does  not work on
the  menu items  (at least  of  the pop  up buttons).  The items  stay
disabled, and no action message is sent to the target.


> In ProjectCenter I use
> NSPopUpButtons' action  method to invoke sth  like popupChanged:. In
> that method  I use a switch  statement to identify the  index of the
> sender's selected item:
> 
> switch([sender indexOfSelectedItem]) { ... }
> 
> I now was told that the sender seems to be of class NSMenuItem???!!!
> This  should not be  the case  unlike the  specs have  changed since
> OPENSTEP - any ideas?

No. At least on OPENSTEP 4.2, the sender is the NSPopUpButton itself.





On OPENSTEP 4.2:

While building the pop up button:
Oct 07 23:01:14 Test[808] scalePopUpButton: <NSPopUpButton: 0x2eee9c>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ef984>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2efc80>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2efbe8>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2efa9c>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x21ab44>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed578>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed6c4>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed70c>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed65c>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed754>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2ed800>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2effcc>
Oct 07 23:01:16 Test[808] curItem desc: <NSMenuItem: 0x2f004c>

In the action method:
Oct 07 23:01:24 Test[808] sender desc: <NSPopUpButton: 0x2eee9c>
Oct 07 23:01:24 Test[808] selectedCell desc: <NSMenuItem: 0x2ed578>



On GNUstep (cvs update Sunday  about 21:00 GMT):

curItem=[_scalePopUpButton itemAtIndex:cnt];
[curItem setEnabled:YES];
NSLog(@"curItem desc: %@ isEnabled=%s\n",[curItem desc],[curItem 
isEnabled]?"YES":"NO");

Oct 07 23:43:22 Test[22124] scalePopUpButton=: <NSPopUpButton: 84307b8>
Oct 07 23:43:22 Test[22124] Failed to locate strings file Localizable
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8438f68> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8437428> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8437ee8> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8440728> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8441cb8> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8440e70> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8442cd8> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8444be8> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8445b28> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8446a68> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 84479e0> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8448920> isEnabled=NO
Oct 07 23:43:22 Test[22124] curItem desc: <NSMenuItem: 8449860> isEnabled=NO


On MacOSX:

I don't know yet, but  since the source of the ScalingScrollView class
has not  changed between OPENSTEP 4.2  and MacOSX, I  guess that'll be
the same results than on OPENSTEP.



-- 
__Pascal_Bourguignon__              (o_ Software patents are endangering
()  ASCII ribbon against html email //\ the computer industry all around
/\  and Microsoft attachments.      V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100  2001:my($f)=`fortune`;  http://petition.eurolinux.org/

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++  UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------



reply via email to

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