[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-dev: questions about lesstif menus



Hello,

My guess is DJ is the only one who really has the answer but that the answer may be useful to others at some point.

I'm trying to get user configurable menus working correctly in the GTK HID. I got a pretty good ways towards that goal by copying the add_resource_to_menu() code from src/hid/lesstif/menu.c and adapting it for GTK. But I'm now at a point where I'd like to understand some bits of it more.

In add_resource_to_menu() near the beginning, line 1224 is:

  for (i = 0; i < node->c; i++)
    switch (resource_type (node->v[i]))
      {
      case 101:		/* named subnode */

do I understand correctly that this would be something like

MainMenu =
{
  SomethingElse =
     {
       {value1a value1b}
       {value2}
     }
}

Where the SomethingElse is what is a named subnode? I didn't see any of that in pcb-menu.res since the only named subnodes I saw were "top level" ones like MainMenu.

What are these named subnodes for and are they actually used?

Around line #1290, is

{
  Resource *radio = resource_subres (node->v[i].subres, "radio");
  char *checked = resource_value (node->v[i].subres, "checked");
  char *label = resource_value (node->v[i].subres, "sensitive");

  if (radio)


I see where "sensitive" is used and also "checked". I wasn't able to see that "radio" had been used in pcb-menu.res. Isn't this covered by "checked". Do I understand correctly that check buttons have been coerced to behave like radiobuttons by just keeping track of the conditions in "checked"? Do you think it is important to try and support "radio" in the gtk menus?




Around line 1352, I don't quite understand what note_widget_flag does.
Also, I didn't see active= used in pcb-menu.res, what is that supposed to do in this part of menu.c?


Is line 1394 reached?

What do you thing about using "tt=" for tooltips? I'm not sure if we actually use any tooltips right now, but it is pretty clear where you'd stick this value if you found it in a menu resource file.

What I have working right now (usermenu branch) is the "normal" menus. The ones with "checked=" don't work and sensitive= is ignored as well as m= and a=. But that actually leaves a bunch of menuitems working. So, I've got a good ways to go, but there is some progress.


-Dan


_______________________________________________ geda-dev mailing list geda-dev@xxxxxxxxxxxxxx http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev