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

Adw.AboutWindow codeblock explaination #22

Open
MadameMalady opened this issue Jul 25, 2023 · 6 comments
Open

Adw.AboutWindow codeblock explaination #22

MadameMalady opened this issue Jul 25, 2023 · 6 comments

Comments

@MadameMalady
Copy link

in the 'Better About Window' tab, you showcase some code for an adwaita AboutWindow, but (unless I missed it, and I checked code examples) I can't find a complete usage example of that, and the documentation isn't too much help since it's all for C....

Would you be willing to show an Adw.AboutWindow example that shows where the:     
dialog = Adw.AboutWindow(transient_for=app.get_active_window())
and following line(s) are defined?

I was able to make an about window with the section for Gtk.AboutDialouge, but I don't understand the small 'dialog' snippets for the Adw.AboutWindow

@Taiko2k
Copy link
Owner

Taiko2k commented Jul 25, 2023

Just run that code when you want to show the about window, plus add the line dialog.set_visible(True). (Ive updated to code snippet in the tutorial with this)

@MadameMalady
Copy link
Author

Okay, maybe I'm being thick, but this is what I did (see attached) : and it didn't work, also getting errors abt an unprintable character x.x

I'm still learning python and app development, sorry if this is obvious
I want Show_About to pull up the libadwaita about window

Screenshot from 2023-07-25 11-47-57
Screenshot from 2023-07-25 11-48-48

@Taiko2k
Copy link
Owner

Taiko2k commented Jul 25, 2023

Oh right, so the 2nd adw code block is supposed to replace the first. That might not have been clear. So remove everything that starts with self.about.

Btw one being assigned to self.about and the other dialog, the difference doesn't really matter since that object isn't going to be used again, I just should have been more consistent.

As for that invalid character, not sure why that's there, it seems to be a special kind of space, so maybe delete and retype the spaces in lines where you get that error.

@MadameMalady
Copy link
Author

I removed everything that started with self.about, and re-did those spaces manually, I now get a different issue abt mismatched indentation:

Screenshot from 2023-07-26 14-32-59
Screenshot from 2023-07-26 14-33-30

@Taiko2k
Copy link
Owner

Taiko2k commented Jul 27, 2023

It seems like something has gone weird with a copy and paste you did. I'd suggest erasing that whole code block and writing it out manually. You can omit the informational dialog.set_* lines for the purposes of testing.

@MadameMalady
Copy link
Author

I re-wrote the lines

    dialog = Adw.AboutWindow(transient_for=app.get_active_window())
    dialog.set_visable(True)

into the definition for Show_About, and I now get:

AttributeError: 'gi.repository.Adw' object has no attribute 'AboutWindow'

Is it possible that some syntax was updated?
I think I'll stick with the gdk about window for now, the adwaita one is pretty but I'm struggling a lot to get it working, thanks for trying to help, and for writing these tutorials at all, there's not a lot of resources for ppl trying to learn to make gnome apps yet.

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