diff options
-rw-r--r-- | src/Toolbar.cc | 19 | ||||
-rw-r--r-- | src/Toolbar.hh | 4 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index e85f20d..9cf2752 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Toolbar.cc,v 1.12 2002/02/20 23:13:32 fluxgen Exp $ | 22 | // $Id: Toolbar.cc,v 1.13 2002/03/19 00:12:36 fluxgen Exp $ |
23 | 23 | ||
24 | // stupid macros needed to access some functions in version 2 of the GNU C | 24 | // stupid macros needed to access some functions in version 2 of the GNU C |
25 | // library | 25 | // library |
@@ -71,20 +71,20 @@ using namespace std; | |||
71 | Toolbar::Toolbar(BScreen *scrn): | 71 | Toolbar::Toolbar(BScreen *scrn): |
72 | screen(scrn), | 72 | screen(scrn), |
73 | image_ctrl(screen->getImageControl()), | 73 | image_ctrl(screen->getImageControl()), |
74 | clock_timer(this), // get the clock updating every minute | ||
74 | iconbar(0) | 75 | iconbar(0) |
75 | { | 76 | { |
76 | 77 | ||
77 | fluxbox = Fluxbox::instance(); | 78 | fluxbox = Fluxbox::instance(); |
78 | 79 | ||
79 | // get the clock updating every minute | 80 | |
80 | clock_timer = new BTimer(fluxbox, this); | ||
81 | timeval now; | 81 | timeval now; |
82 | gettimeofday(&now, 0); | 82 | gettimeofday(&now, 0); |
83 | clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); | 83 | clock_timer.setTimeout((60 - (now.tv_sec % 60)) * 1000); |
84 | clock_timer->start(); | 84 | clock_timer.start(); |
85 | 85 | ||
86 | hide_handler.toolbar = this; | 86 | hide_handler.toolbar = this; |
87 | hide_timer = new BTimer(fluxbox, &hide_handler); | 87 | hide_timer = new BTimer(&hide_handler); |
88 | hide_timer->setTimeout(fluxbox->getAutoRaiseDelay()); | 88 | hide_timer->setTimeout(fluxbox->getAutoRaiseDelay()); |
89 | hide_timer->fireOnce(True); | 89 | hide_timer->fireOnce(True); |
90 | 90 | ||
@@ -199,7 +199,6 @@ Toolbar::~Toolbar(void) { | |||
199 | XDestroyWindow(display, frame.window); | 199 | XDestroyWindow(display, frame.window); |
200 | 200 | ||
201 | delete hide_timer; | 201 | delete hide_timer; |
202 | delete clock_timer; | ||
203 | delete toolbarmenu; | 202 | delete toolbarmenu; |
204 | if (iconbar) | 203 | if (iconbar) |
205 | delete iconbar; | 204 | delete iconbar; |
@@ -1198,7 +1197,7 @@ void Toolbar::timeout(void) { | |||
1198 | 1197 | ||
1199 | timeval now; | 1198 | timeval now; |
1200 | gettimeofday(&now, 0); | 1199 | gettimeofday(&now, 0); |
1201 | clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); | 1200 | clock_timer.setTimeout((60 - (now.tv_sec % 60)) * 1000); |
1202 | } | 1201 | } |
1203 | 1202 | ||
1204 | 1203 | ||
diff --git a/src/Toolbar.hh b/src/Toolbar.hh index adbe7e3..d2d4016 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Toolbar.hh,v 1.7 2002/02/17 18:49:02 fluxgen Exp $ | 22 | // $Id: Toolbar.hh,v 1.8 2002/03/19 00:12:36 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef TOOLBAR_HH | 24 | #ifndef TOOLBAR_HH |
25 | #define TOOLBAR_HH | 25 | #define TOOLBAR_HH |
@@ -99,7 +99,7 @@ private: | |||
99 | Fluxbox *fluxbox; | 99 | Fluxbox *fluxbox; |
100 | BScreen *screen; | 100 | BScreen *screen; |
101 | BImageControl *image_ctrl; | 101 | BImageControl *image_ctrl; |
102 | BTimer *clock_timer, *hide_timer; | 102 | BTimer clock_timer, *hide_timer; |
103 | Toolbarmenu *toolbarmenu; | 103 | Toolbarmenu *toolbarmenu; |
104 | class IconBar *iconbar; | 104 | class IconBar *iconbar; |
105 | 105 | ||