Code Monkey home page Code Monkey logo

Comments (5)

timholy avatar timholy commented on June 2, 2024

Clicking on the button does trigger an update in the signal underlying a, it's just that the value is always nothing. For example:

julia> using GtkReactive, Gtk.ShortNames

julia> (a = button("a")) |> Window |> showall
Gtk.GtkWindowLeaf(name="", parent, width-request=-1, height-request=-1, visible=TRUE, sensitive=TRUE, app-paintable=FALSE, can-focus=FALSE, has-focus=FALSE, is-focus=FALSE, can-default=FALSE, has-default=FALSE, receives-default=FALSE, composite-child=FALSE, style, events=0, no-show-all=FALSE, has-tooltip=FALSE, tooltip-markup=NULL, tooltip-text=NULL, window, opacity=1.000000, double-buffered, halign=GTK_ALIGN_FILL, valign=GTK_ALIGN_FILL, margin-left, margin-right, margin-start=0, margin-end=0, margin-top=0, margin-bottom=0, margin=0, hexpand=FALSE, vexpand=FALSE, hexpand-set=FALSE, vexpand-set=FALSE, expand=FALSE, scale-factor=1, border-width=0, resize-mode, child, type=GTK_WINDOW_TOPLEVEL, title=NULL, role=NULL, resizable=TRUE, modal=FALSE, window-position=GTK_WIN_POS_NONE, default-width=-1, default-height=-1, destroy-with-parent=FALSE, hide-titlebar-when-maximized=FALSE, icon, icon-name=NULL, screen, type-hint=GDK_WINDOW_TYPE_HINT_NORMAL, skip-taskbar-hint=FALSE, skip-pager-hint=FALSE, urgency-hint=FALSE, accept-focus=TRUE, focus-on-map=TRUE, decorated=TRUE, deletable=TRUE, gravity=GDK_GRAVITY_NORTH_WEST, transient-for, attached-to, has-resize-grip, resize-grip-visible, application, is-active=TRUE, has-toplevel-focus=TRUE, startup-id, mnemonics-visible=FALSE, focus-visible=FALSE, is-maximized=FALSE)

julia> x = Signal(1)
Signal{Int64}(1, nactions=0)

julia> y_temp = map(sin, x)
Signal{Float64}(0.8414709848078965, nactions=0)

julia> y = map(_ -> value(y_temp), a)
Signal{Float64}(0.8414709848078965, nactions=0)

julia> push!(x, 7)

julia> y_temp
Signal{Float64}(0.6569865987187891, nactions=0)

julia> y
Signal{Float64}(0.8414709848078965, nactions=0)

# Now go click on that button
julia> y
Signal{Float64}(0.6569865987187891, nactions=0)

from gtkreactive.jl.

yakir12 avatar yakir12 commented on June 2, 2024

Ha, I didn't realize that... Terrific!

from gtkreactive.jl.

timholy avatar timholy commented on June 2, 2024

If you think it would be helpful to add info to the docs, go for it.

from gtkreactive.jl.

yakir12 avatar yakir12 commented on June 2, 2024

done.

from gtkreactive.jl.

timholy avatar timholy commented on June 2, 2024

yakir12@ca1f911 looks good, if you hit that "Pull request" button I'll merge it.

from gtkreactive.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.