# Function callback with GtkSwitch

**URL:** <https://discourse.julialang.org/t/function-callback-with-gtkswitch/41287>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 12, 2020, 5:29pm UTC](https://discourse.julialang.org/t/function-callback-with-gtkswitch/41287 "2020-06-12T17:29:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [June 12, 2020, 5:29pm UTC](https://discourse.julialang.org/t/function-callback-with-gtkswitch/41287/1 "2020-06-12T17:29:18Z")

</div>

Hi all-

I’m trying to create a function callback for GtkSwitch. What I current have does not work:

```julia
using Gtk
win = GtkWindow()
switch = Gtk.GtkSwitchLeaf()
f(x) = println("Swiched!")
signal_connect(f, switch, :activate)
push!(win, switch)
showall(win)

```

Does anyone know why it does not work?
