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 
my_widget.bind_lua_typeinfo.name
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
my_widget.bind_lua_typeinfo.name

Inside the table of each widget class there is a table called bind_lua_typeinfo. That table contains the key "name" whose value is the widget class.
In other words:

Code:
my_button=fltk:Fl_Button(x,y,w,h)
print(my_button.bind_lua_typeinfo.name)

This prints "Fl_Button", which might be a useful piece of information in some cases, for example if a particular function needed to be called depending on what type of widget was activated.

I wonder if bind_lua_typeinfo is an intentionally created table, or if it's merely a product of whatever was used to create the FLTK bindings (tolua?). I ask this because if I ever find this info truly useful myself, it would be rather bothersome if suddenly a murgaLua version was released that no longer held the info (it doesn't appear to be available elsewhere). It seems like it might be a byproduct of the binding, which might mean that it would be much easier for something like this to slip through the cracks than something that was puposefully included.

09-15-2007 04:31 AM
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: #2
RE: my_widget.bind_lua_typeinfo.name

The bindings are not created with to "tolua", however a lot of them are generated with heavily hacked scripts that I knocked up over a long weekend I was playing with srtti ... There is also a fair amount of "hand crafting", which is a pain in arse.

Either way you CAN count on the bind_lua_typeinfo being set for all the FLTK stuff, now and into the future ... In any case it may be expanded for some widgets.

Cheers
JohnM

09-15-2007 07:20 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: #3
RE: my_widget.bind_lua_typeinfo.name

=o)

Thanks.

09-15-2007 07:40 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: