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

Menus, Actions #127

Open
buhtz opened this issue Apr 21, 2018 · 6 comments
Open

Menus, Actions #127

buhtz opened this issue Apr 21, 2018 · 6 comments

Comments

@buhtz
Copy link

buhtz commented Apr 21, 2018

It looks like that the currently suggested way to create MenuBars and ToolBars is deprecated?

python-gtk-3-tutorial.readthedocs.io/en/latest/menus.html

https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Action.html#Gtk.Action

How can a new user know how to solve this now? I can not find any example code using the new solution.

@TingPing
Copy link
Contributor

TingPing commented Apr 21, 2018

It links to the page for the replacements: https://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html

Gio.Action and Gio.Menu. Toolbars aren't deprecated and you can assign Gio.Action's to any button in them.

@buhtz
Copy link
Author

buhtz commented Apr 21, 2018

I don't see this link
https://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html
on that page
https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Action.html#Gtk.Action

Anyway. Menus and Toolbars are not explained. There is only a fancy example about application menus. I have never seen an "application menu" before - kind of exotic? Is this plattform independent?

Where can I find infos (syntax, definitions, ...) about the XML file?
I need some more usual stuff like a menubar and a toolbar. ;)

@TingPing
Copy link
Contributor

TingPing commented Apr 21, 2018

I have never seen an "application menu" before - kind of exotic? Is this plattform independent?

An application menu is just a menu associated with the application. How it appears depends upon your platform.

Where can I find infos (syntax, definitions, ...) about the XML file?

It is poorly documented but:

I need some more usual stuff like a menubar and a toolbar. ;)

I think there is a bit of confusion here. GtkMenuBar and GtkToolBar are not deprecated. GtkAction and GtkUIManager are. GMenu can make menu bars and GAction is just used everywhere.

@buhtz
Copy link
Author

buhtz commented Apr 22, 2018

Of course, there is a lot of confusion. ;)

You wrote yourself that the documentaion is "poor". It is. API Reference is not documentaiton in they way I mean it.

The point is that the concept behind UIManager/GtkBuilder, the XML-string/file and all the possible menus is kind of exotic. So you need to bring this to a new user. The tutorial doesn't - no matter the the UIManager used there is deprecated.

I can add this to my todo list but first I have to understand the concept behind all that myself. ;)

I think this StackOverflow-Question explain my confusion.

Please also see the question How to create PyGObject application with a menubar using Gtk.Builder?.

@osamuaoki
Copy link
Contributor

You can create this with Glade.

See method I mentioned:

In short, use CSD and create Primary menu with popover using Glade with some text editor hacks.

I may write up more on this topic.

Osamu

@osamuaoki
Copy link
Contributor

osamuaoki commented Jul 26, 2021

I finished writing up an example to make .

GTK GUI with PyGObject (9) This page provide HeaderBar with CSD. It uses Glade and describes details.

I have been learning to program with python/Gtk.Template/Glade combination.

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

3 participants