Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContextMenu behind Button using GridLayout #6

Open
Chadial opened this issue Feb 11, 2020 · 3 comments
Open

ContextMenu behind Button using GridLayout #6

Chadial opened this issue Feb 11, 2020 · 3 comments

Comments

@Chadial
Copy link

Chadial commented Feb 11, 2020

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.

@lightningorb
Copy link

Same issue

@lightningorb
Copy link

Here's a fix, on the parent widget call:

self.children = self.children[::-1]

@avyrodov
Copy link

avyrodov commented Apr 1, 2023

Here's a fix, on the parent widget call:

self.children = self.children[::-1]

Hi, I ran into a problem, but I don't understand where to add this line, no matter where I add it to the parent, the drop-down menu is still hiding behind other widgets on the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants