jaberwacky Posted May 19, 2012 Share Posted May 19, 2012 (edited) I'm trying to write a lua function that will pop up a calltip for whenever the user hovers their mouse over a function. This is what I have so far:function myCallTips:OnDwellStart(position, word) print(word) return true endBut this doesn't seem to work. No print statements are executed. Do you have any ideas as to why this shouldn't work? If so, please share them.Edit:I just found this:SCI_SETMOUSEDWELLTIME(int milliseconds)SCI_GETMOUSEDWELLTIMEThese two messages set and get the time the mouse must sit still, in milliseconds, to generate a SCN_DWELLSTART notification. If set to SC_TIME_FOREVER, the default, no dwell events are generated.Let me experiment and I'll get back to you.Edit:Tried this:function myCallTips:OnOpen() scite.SendEditor(SCI_SETMOUSEDWELLTIME, 300) end function myCallTips:OnDwellStart(pos, word) print("OnDwellStart") scite.SendEditor(SCI_CALLTIPSHOW, 0, word) end function myCallTips:OnDwellEnd() print("OnDwellEnd") scite.SendEditor(SCI_CALLTIPCANCEL) endSadly, I can't get it to work right. Edited May 24, 2012 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
MvGulik Posted May 19, 2012 Share Posted May 19, 2012 Not sure how you got your code setup on your side, but ... 1) Linking those function up to AutoIt3SciTELUASciTEStartup.lua 2) renaming 'myCallTips:' to 'AutoItTools:' in your code. 3) save + scite restart, just in case. 4) open (not switching to) a au3 file. Its displaying the word under the cursor as tooltip on my side. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
jaberwacky Posted May 19, 2012 Author Share Posted May 19, 2012 Well, well, well. I just don't know what the problem is then. Refuses to work for me. I did what you said just now. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Valik Posted May 19, 2012 Share Posted May 19, 2012 OnDwellStart isn't called for some reason and I don't know why. Something may have changed in SciTE since I wrote the Event class. Maybe one of these days I'll remember to take a look as the feature sounds kind of interesting and I'm surprised I didn't think of it before. Link to comment Share on other sites More sharing options...
jaberwacky Posted May 21, 2012 Author Share Posted May 21, 2012 I can get it to work if I open a file. If I switch buffers then it stops working. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted May 21, 2012 Author Share Posted May 21, 2012 *FACEPALM* I put scite.SendEditor(SCI_SETMOUSEDWELLTIME, 300) inside of OnSwitchFile. Seems to work right now. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now