'Removing Kivy Settings Close Button

Im trying to completely remove the Close Button that is naturally attached to the Kivy Settings object. Fear not, I have a navigation so the user wont be stuck or anything.

I have looked through the Kivy documentation to find a way to just call the remove_widget() function on the MenuSideBar close_button object, which looked something like this:

class DevicePicker(Screen):
    def __init__(self, **kwargs):
     super(DevicePicker, self).__init__(**kwargs)
     self.ids.s.interface_cls.remove_widget(self.ids.s.MenuSidebar.close_button)
<DevicePicker>:
    BoxLayout:
        orientation: 'vertical'

        Settings:
            id: s
            size: root.height*.8, root.width

however that was unsuccessful.

It seems to me there may be someway to just create my own interface without the close_button and attach it to a Settings object, but I dont have any clue how to go about that.

I am using the basic Kivy Settings (class kivy.uix.settings.Settings).



Solution 1:[1]

For a class Settings: I made this :

self.screen.s = self.screen.ids['settings']
for child in self.screen.s.interface.menu.children:
    if type(child) == Button:
        self.screen.s.interface.menu.remove_widget(child)

My kv file

Settings:
    size_hint_y: 0.9
    id: settings

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1