xforms-development
[Top][All Lists]
Advanced

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

[XForms] menu item return value


From: esserlo
Subject: [XForms] menu item return value
Date: Wed, 12 Mar 2014 10:35:24 -0400
User-agent: SquirrelMail/1.4.19

Hi,

  it's been a while since I worked with xforms intensively. However I still
use a program that uses Xforms 0.86 (or so from memory). Since there were a
few minor issues, I decided to compile the latest xforms-1.2.3 and it worked
like a charm and linked right away to my program.

However, xforms 1.2.3 has a problem. Menu entries are supposed to return their
position from 1 - to N with N being the last number (fl_get_menu(ob)). But the
programmer has the option to return a different value in my case the quit
button returns 99. (This is done with Quit%x99). It now returns -1. After some
experimenting I found out that Quit may return any value as long as it is less
than or equal the number of entries so the recognition of %x is not broken.

In the end what appears to be broken is the function val_to_index in menu.c.
Or maybe it is a bit upstream... what needs to be returned is the value stored
for the ith menu entry ... instead of return i it should at some point return
(sp->mval[val]) ... something like an index (menu item position)-to-numerical
value stored for it.

If this description is unclear, I could come up with a demo. I used boxtype.c
in demos to try this out (somewhat easier than my bulky program). Just add a
%x99 to item5 and printout the value ... you will always get -1.

Cheers,

  Lothar






reply via email to

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