Delete button, when user press this button

8 views
Skip to first unread message

Иван Каратаев

unread,
Jun 10, 2019, 3:09:27 PM6/10/19
to Kivy users support
Sorry for my English :D
Peace of code
        def del_winget(self):
                self.remove_widget(self)
        # Задание способа записи задания в файл с списком
        for f, d in sorted(dic_tasks.items(), key=lambda x: x[1]):
            fd = f.decode('u8') + '\n' + (datetime.fromtimestamp(d).strftime('%Y-%m-%d'))
            self.btn = Button(text=fd, size_hint_y=None, height=dp(40), on_press = del_winget)
            #self.layout.remove_widget(btn)
            self.layout.add_widget(self.btn)

It's my tryi to create button with tasks and i need that when user press on created button it's delete
Can somebody help me with this problem?
Reply all
Reply to author
Forward
0 new messages