# GtkReactive widgets that elicit a self push!

**URL:** <https://discourse.julialang.org/t/gtkreactive-widgets-that-elicit-a-self-push/5316>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 10, 2017, 8:32am UTC](https://discourse.julialang.org/t/gtkreactive-widgets-that-elicit-a-self-push/5316 "2017-08-10T08:32:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [August 10, 2017, 8:32am UTC](https://discourse.julialang.org/t/gtkreactive-widgets-that-elicit-a-self-push/5316/1 "2017-08-10T08:32:36Z")

</div>

Hi all,  
I need some help figuring this out. The goal is to have a cool time-widget for the `GtkReactive.jl` package:

1. with say 3 fields: hours, minutes, and seconds
2. always shows a valid time (e.g. no 63 seconds)
3. allows for scrolling, say, the seconds beyond 59 so that the seconds nullify and the minutes widget will go up one unit

Here’s what I have so far:

```nohighlight
h = spinbutton(0:23, orientation = "v")
m = spinbutton(0:60, orientation = "v")
s = spinbutton(0:60, orientation = "v")

```

These get processed into `Time`:

```nohighlight
t = map(h, m, s) do hh, mm, ss
    Dates.Time(0,0,0) + Dates.Hour(hh) + Dates.Minute(mm) + Dates.Second(ss)
end

```

Good. Now no matter what the user puts into those widgets I’ll end up with a valid time, and therefore valid values for the individual widgets (satisfying feature #3 in the list above):

```nohighlight
h2 = map(x -> Dates.value(Dates.Hour(x)), t)
m2 = map(x -> Dates.value(Dates.Minute(x)), t)
s2 = map(x -> Dates.value(Dates.Second(x)), t)

```

But here’s the _problem_, **how do I update the original widgets without eliciting a never-ending loop?**

For a bit more information see [feature request #18](https://github.com/JuliaGizmos/GtkReactive.jl/issues/18#issuecomment-320907007) in `GtkReactive.jl`.

Appreciate any help!
