← Back to team overview

geda-developers team mailing list archive

Re: Configurable menus in gschem

 

On Wed, 4 Sep 2013 21:30:19 -0400, Nathan Stewart
<therealnathanstewart@xxxxxxxxx> wrote:
> Meant to send this to you instead of "bug"
> 
> What's involved in populating the popup menu from scheme? This is
actually
> where I'm trying to arrive eventually.
> 

Hi Nathan,

Thank you for getting in touch and for your bug report.

At the moment, there isn't any infrastructure for modifying any of the
menus at run-time; they are fixed at program start-up.

The main menubar is controlled by list-based structures defined in the
system-gschemrc file, and is generated by get_main_menu() defined in
x_menus.c.  The popup menu is controlled by a static structure defined at
the top of x_menus.c, and is generated by get_main_popup().

In the short term, the easiest way to obtain popup menus that can at least
be defined in Scheme, even if not modified at run-time, would be to make
them be generated in the same way that the menu bar's menus are.

In the longer term, I would like the menus to be modifiable at run-time,
possibly using a similar approach to Emacs menus (essentially, in Emacs
menus are defined by (ab)using a keymap), and I have been working in that
direction with my recent patches (e.g. the new keymap system, and the work
on dispatching both key- and menu-triggered actions via Scheme).  However,
there remains the problem of how and when the menus are triggered to be
updated, and how best to implement things like setting sensitivity on
particular menu items in a flexible and intuitive way (i.e. not the mess in
i_basic.c).

Thanks,

Peter


-- 
Dr Peter Brett
http://peter-b.co.uk/