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 
FLU - FLTK Utility Widgets
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: FLU - FLTK UTILITY WIDGETS

This is a simple (but probably not efficient) way to create a rollover button using a timer. I thought it might have been possible to use when() instead of a loop, but I guess not.

Code:
w=fltk:Fl_Window(200,100,"Rollover Test")
b=fltk:Fl_Button(10,10,180,30,"rollover")

bg=b:color()
fg=b:labelcolor()
function loop()
if Fl:event_inside(b)==1 then
b:color(fg); b:labelcolor(bg)
else
b:color(bg); b:labelcolor(fg)
end
b:redraw()
timer:doWait(0.05)
end

timer=murgaLua.createFltkTimer()
timer:callback(loop)
timer:do_callback()

w:show()
Fl:run()

I'm not even going to attempt to do the file chooser, although I'm betting it's possible without adding anything to murgaLua.

02-09-2008 02:43 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
FLU - FLTK Utility Widgets - iGame3D - 02-08-2008, 05:48 PM
RE: FLU - FLTK UTILITY WIDGETS - JohnMurga - 02-08-2008, 07:28 PM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 01:24 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008 02:43 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 03:26 AM
RE: FLU - FLTK UTILITY WIDGETS - mikshaw - 02-09-2008, 07:46 AM
RE: FLU - FLTK UTILITY WIDGETS - iGame3D - 02-11-2008, 07:13 AM

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

Forum Jump: