# Macros for Gtk.jl MIA

**URL:** <https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824>\
**Category:** General Usage\
**Tags:** gtk\
**Created:** [January 18, 2022, 6:12pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824 "2022-01-18T18:12:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![das](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@das](https://discourse.julialang.org/u/das)\
**Post date:** [January 18, 2022, 6:12pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/1 "2022-01-18T18:12:02Z")

</div>

I can’t find the macros for Gtk. Does anyone know where they are, how to download, install and invoke them. Without them, few of the examples will work.

Many thanks.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [January 18, 2022, 6:22pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/2 "2022-01-18T18:22:09Z")

</div>

Could you provide a bit more detail about what isn’t working? Why are you looking for macros? Which examples aren’t working? The getting started section of the docs isn’t using any macros:

[https://juliagraphics.github.io/Gtk.jl/latest/manual/gettingStarted/](https://juliagraphics.github.io/Gtk.jl/latest/manual/gettingStarted/)

And just randomly checking some of the other sections I can’t see macros either.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 18, 2022, 7:30pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/3 "2022-01-18T19:30:06Z")

</div>

For instance, [this example in the Gtk docs](https://juliagraphics.github.io/Gtk.jl/latest/manual/canvas/#) uses macros, but it runs just fine.

---

<div class="post-metadata">

**Author:** ![das](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@das](https://discourse.julialang.org/u/das)\
**Post date:** [January 18, 2022, 8:36pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/4 "2022-01-18T20:36:25Z")

</div>

Thanks Rafael. Yes, I got that to run just fine, but this (from [Gtk on Julia - Libraries.io](https://libraries.io/julia/Gtk)):

using Gtk, Gtk.ShortNames, Graphics

win = @Window(“My window”)  
f = @Frame(“A frame”)  
push!(win, f)  
showall(win)

produces many errors:

julia\> using Gtk, Gtk.ShortNames, Graphics

julia\> win = @Window(“My window”)  
ERROR: LoadError: UndefVarError: @GtkWindow not defined  
in expression starting at :0

julia\> f = @Frame(“A frame”)  
ERROR: LoadError: UndefVarError: @GtkFrame not defined  
in expression starting at :0

julia\> push!(win, f)  
ERROR: UndefVarError: win not defined  
Stacktrace:  
[1] top-level scope at REPL[4]:1

julia\> showall(win)

* * *

Where are the macros? Is there a file? Any documentation?

Many thanks.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 18, 2022, 8:49pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/5 "2022-01-18T20:49:33Z")

</div>

I’m not sure how old the document you linked to is, there may have been changes since then.

In any case, the following works:

```julia
using Gtk.ShortNames, Graphics

win = Window("My window")
f = Frame("A frame")
push!(win, f)
showall(win)

```

---

<div class="post-metadata">

**Author:** ![das](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@das](https://discourse.julialang.org/u/das)\
**Post date:** [January 18, 2022, 8:58pm UTC](https://discourse.julialang.org/t/macros-for-gtk-jl-mia/74824/6 "2022-01-18T20:58:21Z")

</div>

Yes, that works. What I was looking at must be old. It uses @Window and @Frame and you use just Window and Frame.

Thanks again!
