RE: [fltk.general] Fl_Box: hide/show/change image on mouse-over event - [General Use]

9 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Jan 22, 2018, 7:34:02 AM1/22/18
to fltkg...@googlegroups.com
> I'm using a window with a png file as a background. That png file shows
> buttons and I put insivible fltk buttons (actually subclassed Fl_Boxes)
> on top of those buttons.
> Now I want those buttons to become more interactive by putting an image
> of top of them that's only visible when I point with the mouse on it,
> but I can't seem to get it to work right.

> An example: the window shows a hand-drawn red button (part of
> background.png) and I want to highlight it with a lighter red color
> (red_button_highlight.png) when I move the mouse button above it.

> Any ideas?


This is usually done by catching the enter/leave events in the handle method of your "button" widget subclass.

Have you looked at the EnterExit widget in the subwindow.cxx test program - that's probably the simplest example that does what I *think* you are describing.




********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
Reply all
Reply to author
Forward
0 new messages