1

In my Python application I have some GtkMenuItems (associated with the main GtkMenuBar), and some GtkMenuToolButtons inside my GtkToolbar.

- gtkMenuBar1
   - gtkMenuItem1
      - gtkMenuItem2
      - gtkMenuItem3
- gtkToolbar1
   - gtkMenuToolButton1

By default, gtkMenuToolButton1 is obviously empty. I want to do something like

self.ui.gtkMenuToolButton1.set_menu(self.ui.gtkMenuItem1)

But if I do that (inside finish_initializing() of my window), nothing changes. I'm new to Python and Gtk3. What am I doing wrong?

2 Answers 2

1

Check the examples in Python Gtk3 Tutorial

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That's a useful website
0

You have to add a Gtk.Menu object to the menu tool button, not a Gtk.MenuItem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.