On 18-feb-2007, at 18:23, Mads Lindstrøm wrote: > Hi all > > I have created a text-control and I want to know which character the > mouse is hovering over. Getting the mouse position is easy enough. > However converting the mouse position to a character index (into the > text-control's text) seems very difficult. > > Anybody knows how to go from mouse position to character index?
First, you need to get a hold of the TextCtrl. Then on that you can use textCtrlPositionToXY to get the x- and y- coordinate of the character in character increments. textCtrlPositionToXY is in WXCore. One tip: try searching the wxWidgets docs first when trying to figure out how to do stuff. For me it tends to lead me to the result quicker than perusing just the wxHaskell docs. With regards, Arthur van Leeuwen. -- /\ / | [EMAIL PROTECTED] | Work like you don't need the money /__\ / | A friend is someone with whom | Love like you have never been hurt / \/__ | you can dare to be yourself | Dance like there's nobody watching ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ wxhaskell-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
