help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Would there be a drawback of using the same graphical toolkit on eve


From: Po Lu
Subject: Re: Would there be a drawback of using the same graphical toolkit on every platform?
Date: Mon, 21 Feb 2022 09:10:29 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Arthur Miller <arthur.miller@live.com> writes:

>> You can of course build dynamic menus out of the GMenu and
>> GMenuModel API. The things become slightly more complex if you have
>> extension points, like plugins, that add and remove menus and menu
>> items depending on whether they have been enabled or disabled at run
>> time. We lack a decent API for that.

That isn't an option.  You cannot attach arbitrary data to such menus,
only a GVariant that can be serialized to disk (or stored in HTML).

The programmatic GMenu and GMenuModel API also leaves much else to be
desired.  It is slow, involves recreating the menu bar widget every time
something changes, and makes it impossible to create menu elements such
as checkboxes which are possible in the XML-based API.

`hidden-when' isn't an option, since there is no way to record all the
information required for Emacs's very deeply nested menus.

After struggling with both interfaces in my GTK 4 port, I decided to
create two separate widgets, LwPopupMenu and LwMenuBar, which build
their menu contents dynamically based on the contents of a
`widget_value'.  It cannot look and behave exactly like the native GTK 4
menus, is a lot of code to maintain (and it was already broken once by
the changes to layout processing in GTK 4.4), but it's the best that can
be done in GTK 4.

Meanwhile, the GtkMenu interface that we have used all the way back to
GTK+ 2.x works fine, but was deleted by the GTK developers for GTK 4.

>> AFAIR, @hergertme had some wrapper API for GNOME Builder; I think we
>> could expand the API in GIO to have a better story for extensible
>> menus.

I won't be convinced until I see such an expansion.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]