# (Gtk) Interface designed with GLADE, the registered function for button click event is not being called

**URL:** <https://discourse.julialang.org/t/gtk-interface-designed-with-glade-the-registered-function-for-button-click-event-is-not-being-called/26958>\
**Category:** Visualization\
**Created:** [July 29, 2019, 9:37pm UTC](https://discourse.julialang.org/t/gtk-interface-designed-with-glade-the-registered-function-for-button-click-event-is-not-being-called/26958 "2019-07-29T21:37:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mantzaris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mantzaris/32/3852_2.png) [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Post date:** [July 29, 2019, 9:37pm UTC](https://discourse.julialang.org/t/gtk-interface-designed-with-glade-the-registered-function-for-button-click-event-is-not-being-called/26958/1 "2019-07-29T21:37:22Z")

</div>

I am using GLADE to develop an interface that gets built afterwards by `Gtk.jl`, and the interface layout appears with all of the labels and buttons after it is built in my Julia code. Within GLADE, for the the ‘button’ object the ‘signals’ table for the button has a ‘handler’ set for the ‘clicked’ event to be the name of a function I have written. This function handler is written in the same file which launches the window built from GtkBuilder with the appropriate name, and this function handler has a println statement to check if it is being pressed, **but no event or function call appears to be happening although the button focus appears to be producing an event signal**. The code for the MWE;

```julia
using Gtk
b = GtkBuilder(filename="try1.glade")
win=b["welcomeWindow"]
function simple(Widget)
    println("welcomeButton_clicked")
end      
showall(win)

```

the XML file of the GLADE output that I am building from does contain the function name _simple_ I provided

```julia
<property name="name">welcomeButton</property>
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <signal name="clicked" handler="simple" swapped="no"/>
          </object>

```

The key from what I understand is the `signal name="clicked" handler="simple" swapped="no"/>` and that should be picked up from `function simple(Widget)` unless I am mistaken in something.

---

<div class="post-metadata">

**Author:** ![mantzaris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mantzaris/32/3852_2.png) [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Post date:** [July 31, 2019, 8:51pm UTC](https://discourse.julialang.org/t/gtk-interface-designed-with-glade-the-registered-function-for-button-click-event-is-not-being-called/26958/2 "2019-07-31T20:51:57Z")

</div>

```julia
using Gtk

function main()
    b = GtkBuilder(filename="try1.glade")
    win=b["mainWindow"]
    
    button=b["mainWindowButton"]
    signal_connect(simple,button,"clicked")
    
   showall(win)
end

function simple(Widget)
    println("clicked")
end

main()

```
