# How to best import a menu from a glade file and then connect signals to them?

**URL:** <https://forum.ada-lang.io/t/how-to-best-import-a-menu-from-a-glade-file-and-then-connect-signals-to-them/361>\
**Category:** General\
**Created:** [April 12, 2023, 3:42am UTC](https://forum.ada-lang.io/t/how-to-best-import-a-menu-from-a-glade-file-and-then-connect-signals-to-them/361 "2023-04-12T03:42:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ats](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@ats](https://forum.ada-lang.io/u/ats)\
**Post date:** [April 12, 2023, 3:42am UTC](https://forum.ada-lang.io/t/how-to-best-import-a-menu-from-a-glade-file-and-then-connect-signals-to-them/361/1 "2023-04-12T03:42:15Z")

</div>

I have two files. The Glade file describes a very simple GUI. The \*.adb file imports this and then attaches signal procedures to them. The problem is that when I try to run the binary, the menu items are gray and disabled. Why?

Glade file:

> <https://gist.github.com/andrew-shvets/dad2c9ab93930e5c75e5f5b8f1d2f9b1>

glade\_example.adb:

> <https://gist.github.com/andrew-shvets/ed7112944c8a3cb2478f63730d57d4b7>

[EDIT]

I’ve managed to get it to do what I want. What I’ve done differently was add this line of code after each “Show” procedure call for an ImageMenuItem:

Gtk.Image\_Menu\_Item.Set\_Sensitive(…);

Basically, I forced for that menu item to become sensitive. What I don’t understand is, this value should have been set in the Glade file to True, so the menu item should have been sensitive from the very beginning…

---

<div class="post-metadata">

**Author:** ![tiberius](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/t/6a8cbe/32.png) [@tiberius](https://forum.ada-lang.io/u/tiberius)\
**Post date:** [April 22, 2023, 8:20pm UTC](https://forum.ada-lang.io/t/how-to-best-import-a-menu-from-a-glade-file-and-then-connect-signals-to-them/361/2 "2023-04-22T20:20:07Z")

</div>

The glade XML doesn’t contain anything related to the menu items being sensitive. Maybe it wasn’t applied fully or didn’t save your settings?
