0

I'm doing a quick drawing app as my first kivy project, and what I'm trying to currently do is to have i so I can display and select the directory the user selects using FileChooser. However, I've hit a wall where when you go through the user directory, it duplicates the files and moves on. Below is a before and after of what I mean. Notice the directories of the previous shifting to the next after I selected my Windows directory,

Before Directory

After Directory

I'm wondering if anyone would have an idea why this is happening. Anything helps, I've just been very stuck. Below is my code for the saving portion of my personal project,

class BottomCanvasLayout(Widget):

    def exitPopUp(self):
        self._popup.dismiss()

    def showSave(self):
        content = SaveDialog(save=self.save_press, cancel=self.exitPopUp)
        self._popup = Popup(title="Save file", content=content, size_hint=(0.9, 0.9))
        self._popup.open()

class SaveDialog(FloatLayout):
    save = ObjectProperty(None)
    filename = ObjectProperty(None)
    cancel = ObjectProperty(None)



kv = Builder.load_file("mydrawing.kv")

class MyDrawingApp(App):
    def build(self):
        return kv


if __name__ == "__main__":
    MyDrawingApp().run()

#mydrawing.kv
<SaveDialog>:
    id: save_dialog
    filename: filename

    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"

        #FileChooserListView:
        FileChooserIconView:
            id: filechooser

        TextInput:
            id: filename
            size_hint_y: None
            height: 30
            multiline: False

       BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: "Cancel"
                on_release: root.cancel()

            Button:
                text: "Save"
  • There may be an issue with double loading the `mydrawing.kv` file. Since it is named correctly, it will get loaded automatically, and you are also loading it explicitly. To see if this is the problem, just change the name of your `kv` file. – John Anderson Jun 03 '21 at 12:48
  • @JohnAnderson Sir, you are a life saver, I truly appreciate this. It works now, thank you – Anthony Massaad Jun 03 '21 at 13:52

0 Answers0