Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Add slider (GtkScale) example #638

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Add slider (GtkScale) example #638

merged 1 commit into from
Apr 12, 2022

Conversation

JeffFessler
Copy link
Contributor

This example is in response to students asking "how to" questions about sliders.
Hopefully it will help other beginners too.

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #638 (f9ecf8f) into master (6be97fe) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #638   +/-   ##
=======================================
  Coverage   65.58%   65.58%           
=======================================
  Files          32       32           
  Lines        2720     2720           
=======================================
  Hits         1784     1784           
  Misses        936      936           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6be97fe...f9ecf8f. Read the comment docs.

@timholy
Copy link
Member

timholy commented Mar 30, 2022

Beginners should perhaps consider GtkObservables since you don't really need to know much about Gtk internals. A simplified version of your example is

using GtkObservables
slider1 = slider(0:10)
slider2 = slider(0:30; value = slider1[])
on(slider1) do val
    slider2[] = val
end

(obviously these have to be placed in a window, but that's identical to your code).

@tknopp
Copy link
Collaborator

tknopp commented Mar 30, 2022

Beginners should perhaps consider GtkObservables since you don't really need to know much about Gtk internals.

Probably. But let's please not mix Gtk.jl and GtkObservable.jl documentation. My vision would be to keep Gtk.jl low-level and close to the C-lib and have high-level code in an additional package such as GtkObservables.

@timholy
Copy link
Member

timholy commented Mar 30, 2022

Agreed 100%. Just pointing it out here.

@JeffFessler
Copy link
Contributor Author

JeffFessler commented Mar 31, 2022

Ok, to avoid mixing documentation yet still nudge beginners (like me!) to the easier way, I made a separate PR #639 to add a link to it in the documentation. (Hopefully a single link is not too much mixing!)
I made it a separate PR because they are independent and maybe you will accept one but not the other.
Anything else I need to do on this one?

@JeffFessler
Copy link
Contributor Author

bump :)

@tknopp tknopp merged commit 18607f7 into JuliaGraphics:master Apr 12, 2022
@JeffFessler JeffFessler deleted the jf-slider branch April 13, 2022 20:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants