# Change Gtk.jl button icon

**URL:** <https://discourse.julialang.org/t/change-gtk-jl-button-icon/45195>\
**Category:** General Usage\
**Tags:** guis\
**Created:** [August 19, 2020, 6:37am UTC](https://discourse.julialang.org/t/change-gtk-jl-button-icon/45195 "2020-08-19T06:37:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kobied](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kobied/32/16432_2.png) [@kobied](https://discourse.julialang.org/u/kobied)\
**Post date:** [August 19, 2020, 6:37am UTC](https://discourse.julialang.org/t/change-gtk-jl-button-icon/45195/1 "2020-08-19T06:37:38Z")

</div>

hello,  
i’m building a GUI using Gtk.jl and i need to change a button icon once pressed.  
To create the button with an icon i use:

```julia
rec_icon = load(img_path)
rec_btn = Button(Image(Pixbuf(data=rec_icon, has_alpha=false)))

```

at this point if i push the button to a windows it works fine. next i want to change the icon of the button, to do so i call:

```julia
rec_icon = load(new_img_path)
set_gtk_property!(rec_btn, :image, Pixbuf(data=rec_icon, has_alpha=false))

```

but the icon in the GUI window does not change…

this is the full test code:

```julia
rec_icon = load(img_path)
rec_btn = Button(Image(Pixbuf(data=rec_icon, has_alpha=false)))

win = GtkWindow("Composed Widget",800,600)
push!(win, rec_btn)
showall(win)

rec_icon = load(new_img_path)
set_gtk_property!(rec_btn, :image, Pixbuf(data=rec_icon, has_alpha=false))

```

thank
