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

'gi.repository.Gtk' object has no attribute 'FileDialog' error #26

Open
kirby-kirby opened this issue Dec 15, 2023 · 2 comments
Open

'gi.repository.Gtk' object has no attribute 'FileDialog' error #26

kirby-kirby opened this issue Dec 15, 2023 · 2 comments

Comments

@kirby-kirby
Copy link

Things are going along hunky-dory in this rather nice tutorial until I hit the 'Adding a file chooser' section. I then see the error mentioned in the title. Below is the snippet with the pre and post couple of lines. What am I missing other than the "FileDialog attribiute"? Thanks.

        self.open_button.connect('clicked', self.hello)
        self.open_button.set_icon_name("document-open-symbolic")

        self.open_dialog = Gtk.FileDialog.new()
        self.open_dialog.set_title("Select a File")

    def show_open_dialog(self, button):
        self.open_dialog(self, None, self.open_dialog_open_callback)
@Taiko2k
Copy link
Owner

Taiko2k commented Dec 15, 2023

FileDialog is actually new and was introduced in the recent GTK 4.10. Your distro is likely still using an older version of GTK. You can instead use the older FileChooserDialog. An older version of my tutorial used this. Maybe I was too hasty to remove it. You can refer to the removed section of my tutorial here.

@kirby-kirby
Copy link
Author

kirby-kirby commented Dec 15, 2023 via email

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

2 participants