summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-12 23:18:48 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-12 23:18:48 +0000
commit23f90b2301660eba8cadf4185dd6f473585d2de0 (patch)
tree87467bd760d484b3eab730ab66ef1352bcf04c27
parentfb820bcf23f73c595b71259076b5b1d293fffa2b (diff)
STR 748: Fl_Clock_Output::value(ulong) does not change value_
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4109 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES11
-rw-r--r--src/Fl_Clock.cxx11
2 files changed, 9 insertions, 13 deletions
diff --git a/CHANGES b/CHANGES
index 26057a76f..37584b027 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,14 @@
CHANGES IN FLTK 1.1.7
- - Added Comment Type to Fluid. This is useful to generate
- Copyright notices in the source and header files.
- - Fl_Valuator would not format text output with decimal
- point when the step value was fractional, but above 1
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
+ - Fl_Clock_Output::value() did not return the previously
+ set value (STR #748)
+ - Added comment type to FLUID. This is useful for
+ generating copyright notices in the source and header
+ files.
+ - Fl_Valuator would not format text output with decimal
+ point when the step value was fractional, but above 1.
- fl_filename_relative() didn't compare drive letters in
a case-insensitive way (STR #741)
- Fixed menu item width calculations with symbols (STR
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx
index 702b6ea88..0404da6c7 100644
--- a/src/Fl_Clock.cxx
+++ b/src/Fl_Clock.cxx
@@ -107,11 +107,13 @@ void Fl_Clock_Output::draw() {
void Fl_Clock_Output::value(int H, int m, int s) {
if (H!=hour_ || m!=minute_ || s!=second_) {
hour_ = H; minute_ = m; second_ = s;
+ value_ = (H * 60 + m) * 60 + s;
damage(FL_DAMAGE_CHILD);
}
}
void Fl_Clock_Output::value(ulong v) {
+ value_ = v;
struct tm *timeofday;
timeofday = localtime((const time_t *)&v);
value(timeofday->tm_hour, timeofday->tm_min, timeofday->tm_sec);
@@ -140,17 +142,8 @@ Fl_Clock::Fl_Clock(uchar t, int X, int Y, int W, int H, const char *l)
}
static void tick(void *v) {
-#ifdef WIN32
((Fl_Clock*)v)->value(time(0));
Fl::add_timeout(1.0, tick, v);
-#else
- struct timeval t;
- gettimeofday(&t, 0);
- ((Fl_Clock*)v)->value(t.tv_sec);
- double delay = 1.0-t.tv_usec*.000001;
- if (delay < .1 || delay > .9) delay = 1.0;
- Fl::add_timeout(delay, tick, v);
-#endif
}
int Fl_Clock::handle(int event) {