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: Arthur Miller
Subject: Re: Would there be a drawback of using the same graphical toolkit on every platform?
Date: Mon, 21 Feb 2022 17:50:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Po Lu <luangruo@yahoo.com> writes:

> 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.

I understand; but they have probably changed API because of some reason that
suits their goals. Every project prioritize their own goals, that is how life
is. They certainly didn't do it to piss off Emacs devs.

>>> 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.

It looks to me more like an invite to contribute an API, so there is your chance
to get it the way you like. 



reply via email to

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