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 
Fluid to lua converter
Author Message
Juergen
Member
***


Posts: 81
Group: Registered
Joined: May 2007
Status: Offline
Reputation: 0
Post: #1
RE: Fluid to lua converter

Tobi Wrote:

JohnMurga Wrote:
Hi,

I was playing with the fluid_parser and I was wondering how easy it would be to change it so that it is able to cope with menu entries, as murgaLua 0.6 can now has all the same functionality as FLTK.


Oh, it's easy to do that. I thought it already works, but now it turns out that Fluid does widgets of type "MenuItem" which the fluid converter tries to build. There is no widget type MenuItem though, menu items need to be done with menu:add()...
Should be quite straightforward to fix.


I'm not completely sure, but I guess you mean arrays of the struct Fl_Menu_Item, because there is no "type" "MenuItem".

Yes the Fl_Menu_Bar:copy() and Fl_Menu_Bar:menu() methods don't work as expected (At least I think so).

But the Fl_Menu_Bar:copy() method can easily be emulated from Lua:

Code:
function Fl_Menu_Bar:copy(MI_table)
for _,j ipairs(MI_table) do self:add(j[1],j[2],j[3],j[4],j[5],j[6]) end
end

menu_table={{"File/close",0,nil},{"File/test",0,nil}}

menu_bar=fltk.Fl_Menu_Bar(0,0,w1:w(),30)
menu_bar:copy(menu_table)


Of course this is quite a hack, but it works surprisingly well.

Juergen

02-08-2008 03:40 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Fluid to lua converter - Tobi - 12-19-2007, 07:55 AM
RE: Fluid to lua converter - iGame3D - 12-19-2007, 12:33 PM
RE: Fluid to lua converter - Tobi - 12-20-2007, 01:38 AM
RE: Fluid to lua converter - xleitex - 12-24-2007, 07:06 AM
RE: Fluid to lua converter - iGame3D - 12-26-2007, 11:16 AM
RE: Fluid to lua converter - Tobi - 12-27-2007, 09:52 PM
RE: Fluid to lua converter - Tobi - 01-29-2008, 08:14 AM
Fluid to lua converter update - iGame3D - 02-06-2008, 09:33 AM
RE: Fluid to lua converter - JohnMurga - 02-06-2008, 08:15 PM
RE: Fluid to lua converter - Tobi - 02-08-2008, 01:50 AM
RE: Fluid to lua converter - Juergen - 02-08-2008 03:40 AM
RE: Fluid to lua converter - mikshaw - 02-08-2008, 07:23 AM
RE: Fluid to lua converter - Juergen - 02-08-2008, 09:15 AM
RE: Fluid to lua converter - mikshaw - 02-08-2008, 10:55 AM
RE: Fluid to lua converter - iGame3D - 02-15-2008, 02:30 PM
RE: Fluid to lua converter - Tobi - 04-23-2008, 04:35 AM

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

Forum Jump: