News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
Development resumes
Author Message
Junior Member

Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #1
RE: Development resumes

JohnMurga Wrote:
... Please report any issues that should be fixed for the next release.

The usage of Fl_Menu_Item user_data is not clear to me and might either need some documentation or an extension of the Fl_Menu_:value(...) method:

In my case I store the text corresponding to an Fl_Choice menu item in a settings file. When I reload a previously saved settings file later on and try to set the Fl_Choice widget according to the text, there is the inherited method Fl_Menu_:find_item(text) method which allows me to retrieve the corresponding menu_item user_data. However, unlike in C++ fltk, a call to Fl_Menu_:value(user_data) does not work, apparently only the Fl_Menu_:value(index) version has been translated to lua. Therefore, as a work-around, I currently have to determine the index by looping over the user_data returned by Fl_Menu_:menu(i) and compare the texts manually. This is pretty cumbersome. Also, unlike one would expect in Lua, one has to loop like in C++ from 0 to Fl_Menu_:size()-1.

My suggestion to improve this would be an extension of the Fl_Menu_:value() method to allow also menu item user_data as input.

Additionally, calls to Fl_Menu_Item:labelsize() seem currently useless. They always return 0 irrespectively to any value passed before.


This post was last modified: 06-16-2008 10:25 PM by znarf.

06-16-2008 09:35 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Development resumes - JohnMurga - 06-12-2008, 08:13 PM
RE: Development resumes - znarf - 06-16-2008 09:35 PM
RE: Development resumes - JohnMurga - 06-17-2008, 12:27 AM
RE: Development resumes - mikshaw - 06-18-2008, 12:14 AM
RE: Development resumes - znarf - 06-20-2008, 05:02 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: