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 
[WIP] MurgaLua Reference Tool
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: [WIP] MurgaLua Reference Tool - a little help?

I do believe I've finally stumbled upon the cause of the trouble, although I don't have a solution.

The problem was not caused by a change to the main script, as I had originally thought, but by a widget I'd added. It just so happens that this particular widget was disabled in the most recent test release (the "broken" release), so you might never see it.
It is related to a multiple-menu problem i was having (and gave up on) not long ago, but I never saw the connection because I was using two different types of menus this time.

So....the trouble comes from, as far as I can tell, one of three possible sources:
1) A bug in FLTK
2) A bug in MurgaLua
3) Poorly-made menus (my fault)

The symtom occurs when you create two menus (of any type, apparently) and then use my_second_menu:add("something") to add a menu item to the second menu. This apparently breaks the first menu, preventing you from controlling its contents. It sounds like a bug to me, considering you can use the same logic to add to other widgets (a browser for example), but maybe i'm doing something wrong.

Now that I know where the problem lies I don't have to bother shooting into the dark, so maybe I can figure out the solution....maybe it just needs fltk:Fl_End() or something simple like that.
I might just have to study the "proper" way of creating menu items (Fl_Menu_Item), although it seems like an unnecessarily complicated process.

There is another smaller issue I've bumped into, though, that coincidentally is also causing the notes item to not display when it should. If one of the widget filenames contains a hyphen, the string.find(textfile) test fails to work for that file. This wasn't a problem earlier because I was using io.open(textfile) to test if the notes file existed, and the hyphen worked then. I switched to building a string containing all *.lua.txt filenames because I thought it would save having to try opening two files every time a widget is loaded. I'm sure it will be a simple fix, but I just thought it was odd.

EDIT: the smaller issue was fixed by using a "plain" (no expressions) string.find:
string.find(string,pattern,1,1)
the second "1" (or anything true) enables a plain find, and the first "1" (starting point) is required if the second is used

This post was last modified: 08-17-2007 08:07 AM by mikshaw.

08-17-2007 02:56 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
[WIP] MurgaLua Reference Tool - mikshaw - 07-10-2007, 05:00 PM
RE: [WIP] MurgaLua Reference Tool - a little help? - mikshaw - 08-17-2007 02:56 AM

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

Forum Jump: