add event to a Gutter

Questions on using RSyntaxTextArea should go here.

Moderator: robert

add event to a Gutter

Postby rache » Fri Feb 19, 2010 11:15 am

Hi,

I am using the Guttor to show icons in the scroll pane, in cetain line numbers.

I want to add event handling / listener when clicking on the guttor and when the mouse goes over the icon.

can I do that?

thank you.
rache
 

Re: add event to a Gutter

Postby robert » Fri Feb 19, 2010 2:06 pm

Hi Rache,

The gutter API isn't very clean at the moment. There's no easy way for you to intercept mouse events yet. This is one thing I'd like to add (besides adding custom gutter components). You'll have to hack into the source to add this functionality. In particular, take a look at:

org.fife.ui.rtextarea.Gutter
org.fife.ui.rtextarea.IconRowHeader

IconRowHeader is likely what you'll need to edit. It already has code to intercept mouse events, you'll just have to add your own custom logic there.

There's already a Feature Request to add MouseLIstener support to the Gutter. Feel free to comment with suggestions there, or open a new Feature Request if you think it isn't accurate enough for what you want.
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 4 guests

cron