Skip to content

ContextMenu behind Button using GridLayout #6

@Chadial

Description

@Chadial

Describe the bug
If the ContextMenu ist used with an GridLayout (maybe also BoxLayout) and a following Button,
the ContextMenu "Popup" is behind the Button.

Code

import kivy
from kivy.app import App
from kivy.lang import Builder
import kivy.garden.contextmenu

kv = """
GridLayout:
    id: layout
    cols: 1
    AppMenu:
        id: app_menu
        top: root.height
        cancel_handler_widget: layout

        AppMenuTextItem:
            text: "Menu #1"
            ContextMenu:
                ContextMenuTextItem:
                    text: "Item #11"

    Button:
        text:   "hello"
"""

class MyApp(App):
    def build(self):
        self.title = 'Simple app menu example'
        return Builder.load_string(kv)

    def say_hello(self, text):
        print(text)
        self.root.ids['app_menu'].close_all()

if __name__ == '__main__':
    MyApp().run()

Expected behavior
I expected the menu appearing in front of all widgets.

Platform (please complete the following information):

  • OS: Windows 7
  • Python 3.6.
  • kivy-garden /contextmenu 0.1.0.dev1

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions