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
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #1
Development resumes

Hi,

As some of you know I've been away for a quite a while ...

Either way I am back now and I am going to resume development of murgaLua version 0.6.9.

The focus is really to document things and tidy up things to the point that a general public release is possible ... Please report any issues that should be fixed for the next release.

Cheers
JohnM

06-12-2008 08:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
znarf
Junior Member
**


Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #2
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.

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

Regards,
Gerald

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
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #3
RE: Development resumes

znarf Wrote:
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.

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


Hi,

I'll look into this for 0.6.9, could you post some code to illustrate the issues ? It'll make it that much easier for me to resolve them.

Cheers
JohnM

06-17-2008 12:27 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #4
RE: Development resumes

I spent much too long on this yesterday, thinking it was a simple solution, but eventually realized it doesn't behave as documented, "You can set it as an integer, or set it with a pointer to a menu item."

Here's what I was playing with:

Code:
my_menu=fltk:Fl_Choice(10,10,120,30)
for _,i in pairs({"one","two","three","four"}) do my_menu:add(i) end
my_item=my_menu:find_item("three")
my_menu:value(my_item)

06-18-2008 12:14 AM
Find all posts by this user Quote this message in a reply
znarf
Junior Member
**


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

Hello Mikshaw,
thank you a lot for your efforts to interpret my original posting lacking an explicit example, yes your code snippet captures the essence of the reported first issue.
An analogous example for the second issue would be

Code:
menuBar=fltk:Fl_Menu_Bar(0,0,100,20)
menuBar:add("File/Load settings...")
menuBar:add("File/Save settings...")
menuBar:add("Help/About...")
for i=0,menuBar:size()-1 do
    menuBar:menu(i):labelsize(12)
end

When I tried it today while writing this example, it worked flawlessly! So please apologize and ignore the erroneously reported second issue.

Regards,
Gerald

This post was last modified: 06-20-2008 05:02 AM by znarf.

06-20-2008 05:02 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

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

Forum Jump: