]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/choice.mm
making sure the repositioning within the contentview only happens if the parent reall...
[wxWidgets.git] / src / osx / cocoa / choice.mm
index 5ebf6a244537ed94f484afa0b27a78158cb54ec2..197e4d758f7d7fdefb8429ddbd679e8d9b6467d8 100644 (file)
 
 @interface wxNSPopUpButton : NSPopUpButton
 {
-    WXCOCOAIMPL_COMMON_MEMBERS
 }
 
-WXCOCOAIMPL_COMMON_INTERFACE
-
-- (void) clickedAction: (id) sender;
-
 @end
 
 @implementation wxNSPopUpButton
 
-- (id)initWithFrame:(NSRect)frame pullsDown:(BOOL) pd
-{
-    [super initWithFrame:frame pullsDown:pd];
-    impl = NULL;
-    [self setTarget: self];
-    [self setAction: @selector(clickedAction:)];
-    return self;
-}
-
-- (void) clickedAction: (id) sender
++ (void)initialize
 {
-    if ( impl )
+    static BOOL initialized = NO;
+    if (!initialized) 
     {
-        wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
-        if ( wxpeer )
-            wxpeer->OSXHandleClicked(0);
+        initialized = YES;
+        wxOSXCocoaClassAddWXMethods( self );
     }
 }
 
-WXCOCOAIMPL_COMMON_IMPLEMENTATION
-
 - (int) intValue
 {
    return [self indexOfSelectedItem];
@@ -81,7 +65,6 @@ wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
     wxNSPopUpButton* v = [[wxNSPopUpButton alloc] initWithFrame:r pullsDown:NO];
     [v setMenu: menu->GetHMenu()];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }