Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request #18

Closed
yakir12 opened this issue Apr 7, 2017 · 5 comments
Closed

Feature request #18

yakir12 opened this issue Apr 7, 2017 · 5 comments

Comments

@yakir12
Copy link
Contributor

yakir12 commented Apr 7, 2017

Hi Tim!
How could I help you add a SpinButton widget for representing hours:minutes:seconds (as in e.g. 01:06:22 for one hour, six minutes, and 22 seconds)?
It should respond to scrolling, be limited by 0-59 for the seconds and minutes, and play nicely with either Dates.Second or Julia v0.6's Time type.
I think many (read me) are currently using one spinbutton per time unit: silly.

@timholy
Copy link
Member

timholy commented Apr 7, 2017

Your "silly" approach may not be so silly: http://stackoverflow.com/questions/41598292/gtk-time-picker-widget

@yakir12
Copy link
Contributor Author

yakir12 commented Apr 8, 2017

Alas, now I really wish I could get that orientation glitch to work for the spinbutton I "made"... The vertical orientation really makes sense in this context.

@yakir12 yakir12 closed this as completed Apr 8, 2017
@yakir12 yakir12 reopened this Aug 7, 2017
@yakir12
Copy link
Contributor Author

yakir12 commented Aug 7, 2017

So while life does go on, one feature the above solution lacks is a single Instant behind the three widgets (in the specific case of hours:minutes:seconds, but everything here can be extended to any combination and number of temporal units). What I mean is that the 3 widgets should affect a single Instant, that then should parse into the 3 temporal units, and finally update the displays on the 3 widgets.
This structure would result in nifty behaviors such as:

  1. Scrolling up (in the, say, vertical orientation) in the seconds widget, all the way up to "60", and then it will magically nullify and the minutes widget will go up one unit (potentially affecting the hours widget). And vice versa (scrolling down).
  2. In addition, this structure prohibits any impossible temporal combinations (e.g. -33:68:172) in a simpler way than limiting the scroll to 0--59. This is especially cool if the user wants to include dates (think about the 31 of February).
  3. Not to get ahead of myself, but this could (easily?) be extended to other units, such as tons:kg:grams.

@timholy
Copy link
Member

timholy commented Aug 8, 2017

Sounds cool. If you have some code that gets started and submit it as a PR, I'd be happy to advise on how to finish it off.

@yakir12
Copy link
Contributor Author

yakir12 commented Aug 8, 2017

Sheesh, I tried to just use existing spinbutton widgets, but I'm running into (obvious) chicken-and-the-egg problems: updating one of the three widgets (hh:mm:ss) updates the main time, which update all three widgets sequentially, which then goes into an infinite loop...
I guess I should attempt to write a whole new type (like Player) and use all the basic Gtk functions...

yakir12 added a commit to yakir12/GtkReactive.jl that referenced this issue Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants