In the object destructor, leave m_cocoaNSView intact for base class destructors
[wxWidgets.git] / src / cocoa / slider.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cocoa/slider.mm
3 // Purpose:     wxSlider
4 // Author:      David Elliott
5 // Modified by:
6 // Created:     2003/06/19
7 // RCS-ID:      $Id$
8 // Copyright:   (c) 2003 David Elliott
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/setup.h"
13 #if wxUSE_SLIDER
14
15 #include "wx/app.h"
16 #include "wx/slider.h"
17
18 #import <AppKit/NSView.h>
19
20 IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
21 BEGIN_EVENT_TABLE(wxSlider, wxSliderBase)
22 END_EVENT_TABLE()
23 // WX_IMPLEMENT_COCOA_OWNER(wxSlider,NSSlider,NSControl,NSView)
24
25 bool wxSlider::Create(wxWindow *parent, wxWindowID winid,
26             int value, int minValue, int maxValue,
27             const wxPoint& pos, const wxSize& size, long style,
28             const wxValidator& validator, const wxString& name)
29 {
30     if(!CreateControl(parent,winid,pos,size,style,validator,name))
31         return false;
32     SetNSView([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
33     [m_cocoaNSView release];
34     if(m_parent)
35         m_parent->CocoaAddChild(this);
36     return true;
37 }
38
39 wxSlider::~wxSlider()
40 {
41 }
42
43 #endif // wxUSE_SLIDER