Skip navigation
Currently Being Moderated

static_text change text color on hover/roll over?

Jun 17, 2009 5:08 PM

Hi,

 

If you have a look at the Export to Facebook plugin by Jeffrey Friedl, its Plugin Info dialog includes static_text items that change colour when the mouse hovers over them.  A while back I posted about initiating an action when a user clicks on a static_text item.  He has used this to inidcate when static_text items are interactive and I want to do this too.  Unfortunately Jeffrey can't talk about it.

 

Can someone (Eric?) shed light on what field needs to be added to static_text to do this?  I know how to enable left and right mouse clicks on a static_text item but haven't figured out how to react to other mouse events yet.

 

Thanks,

Matt

 
Replies
  • Currently Being Moderated
    Jun 17, 2009 5:23 PM   in reply to Matt Dawson

    Matt, would it not be an onHover event? like mouse_hover or similar..

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 18, 2009 1:07 AM   in reply to Matt Dawson

    I was having exactly the same thoughts a few days ago and tried various key names too - decided I'd make do with buttons where I wanted people to click and worry about it when I had more time.

     

    Hopefully someone can nudge us in the right direction...

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2009 6:53 AM   in reply to Matt Dawson

    Unfortunately this looks like a situation where we do not have a publicly available API to handle this. Jeffrey is probably using something undocumented. Sorry about that, hopefully we will be able to address this in the next release.

     

    I realize this is an unsatisfactory answer but we don't want to publish anything in the SDK until we make sure it is properly tested and not likely to change.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2009 1:39 AM   in reply to Matt Dawson

    "LrDialog runOpenPanel's initialDirectory field is missing from the SDK reference"

     

    Well, well. I was only wondering about this yesterday . Surely the SDK documentation needs to be continually updated wiki style?

     

    John

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 6, 2009 9:18 AM   in reply to Matt Dawson

    WARNING:  What you'll see here is undocumented, unsupported, could break at any time, should not be used to control critical functions like landing airplanes, yada, yada, etc., etc.  Use at your own risk -- it's up to you to make it work.  I have no recollection of ever typing this, so can't be held accountable.

     

    Phew!  Anyway, a couple of months ago, I asked Jeffrey Friedl the same question.  His reply:

     

    I asked for (and was given) permission to tell you:

     

         f:static_text {
             title = 'Visit Site',
             mouse_down = function()
                LrHttp.openUrlInBrowser( someUrl )
             end,
             [ WIN_ENV and 'adjustCursor' or 'adjust_cursor' ] = function()
                logger:debug('mouse_over handler activated')
             end,
             text_color = LrColor( 0, 0, 1 ),
         }       

    Enjoy!

     

    When asked if I could share the information, he replied:

     

    The permission didn't come with any restrictions, so I guess it's okay to
    spread around.

     

    Anyway, the critical part of the code snippet that's missing is what to do in the "mouse_over handler" function.  What I did for all of my links was to call a common function that would launch an async task that would change the color of the link, then change it back after a period of time.

     

    I passed "self" (the static_text being hovered over) to my common routine so it could keep track of the active link, and reset the previous link when the user hovers somewhere new.

     

    Good luck, and, as Jeffrey said, Enjoy!

     

    -Don

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points