diff --git a/src/avtk/avtk_dial.h b/src/avtk/avtk_dial.h index 05ff86a..f18fc88 100644 --- a/src/avtk/avtk_dial.h +++ b/src/avtk/avtk_dial.h @@ -20,6 +20,7 @@ #ifndef AVTK_DIAL_H #define AVTK_DIAL_H +#include #include #include #include @@ -31,8 +32,7 @@ class Dial : public Fl_Slider { public: Dial(int _x, int _y, int _w, int _h, const char* _lab=0): - Fl_Slider(_x, _y, _w, _h, _lab), - _label ( 0 ) + Fl_Slider(_x, _y, _w, _h, _lab) { x = _x; y = _y; @@ -45,19 +45,17 @@ class Dial : public Fl_Slider mouseClicked = false; highlight = false; - if ( _lab != 0 ) - _label = strdup( _lab ); + _label = _lab; } ~Dial() { - if( _label ) - free( _label ); } bool highlight; int x, y, w, h; - char* _label; + //char* _label; + std::string _label; float radius; float lineWidth; @@ -69,12 +67,8 @@ class Dial : public Fl_Slider void setLabel( const char* newLabel ) { - //if( _label ) - // free( _label ); - - //_label = strdup( newLabel ); - - //label( _label ); + _label = newLabel; + label( _label.c_str() ); redraw(); }