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 
MurgaLua full release
Author Message
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #1
RE: MurgaLua full release

Juergen Wrote:
Yes it is ;-)
I overlooked that. Although there is a small misunderstanding.
menu:find_item(first_item) and menu:menu(0) is exactly the same, but for the latter you don't have to know what the first item is. If you check if there are 0 arguments supplied to the menu() function and then execute the same code that menu(0) does, it would be nearer to the fltk documentation.


Yes ... And ... No ...

The FLTK version would return a pointer that you could increment to get the next item. I cannot sensibly reproduce that in Lua, so I rather just have a slightly different method.

Juergen Wrote:
If you could care to tell me, how to access the methods of the menu (redraw it for example) from within the callback. I don't see a way to do that. I can always access the item methods with self:mvalue():item_method() but I can't see a way to access the menu methods without using a special callback for every item or doing nasty tricks.


Right now ... You cannot ... In normal use the only instance I can see you wanting a reference to the menu would be if you want to change it from a menu item ... If so, there are several ways for you to hold a reference to the menu (I'll knock up and example).

I do not like the way FLTK handles it, as menu items are second class citizens (being low level structs). In murgaLua it's different, although I'll address your usage pattern and find a way to get it to make sense.

Juergen Wrote:
Is there an example somewhere that doesn't throw an error message or a segmentation fault?


The previous menu example worked, although you (rightly) complained about it :-)

I'll code some more, although what I'd REALLY like to see are examples that DO cause error messages or segfaults, as that way I can either address the bug or explain what's wrong with the example.

Cheers
John de Murga

This post was last modified: 02-12-2008 09:48 AM by JohnMurga.

02-12-2008 09:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
MurgaLua full release - JohnMurga - 01-29-2008, 12:32 AM
RE: MurgaLua full release - Juergen - 01-29-2008, 01:53 AM
RE: MurgaLua full release - iGame3D - 01-29-2008, 03:31 AM
RE: MurgaLua full release - JohnMurga - 01-29-2008, 08:47 AM
RE: MurgaLua full release - JohnMurga - 02-11-2008, 10:02 AM
RE: MurgaLua full release - JohnMurga - 02-12-2008, 09:54 AM
RE: MurgaLua full release - Juergen - 02-11-2008, 10:41 AM
RE: MurgaLua full release - JohnMurga - 02-11-2008, 11:09 AM
RE: MurgaLua full release - Juergen - 02-11-2008, 11:30 AM
RE: MurgaLua full release - JohnMurga - 02-12-2008 09:47 AM
RE: MurgaLua full release - JohnMurga - 02-13-2008, 10:16 AM
RE: MurgaLua full release - Juergen - 02-13-2008, 12:29 PM
RE: MurgaLua full release - JohnMurga - 02-14-2008, 11:46 PM
RE: MurgaLua full release - Juergen - 02-18-2008, 08:55 AM

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

Forum Jump: