Call tips
Call tips are small windows displaying the arguments to a function and are displayed after the user has typed the name of the function. They normally display characters using the font facename, size and character set defined by STYLE_DEFAULT. You can choose to use STYLE_CALLTIP to define the facename, size, foreground and background colours and character set with calltip_use_style() . This also enables support for Tab characters. There is some interaction between call tips and autocompletion lists in that showing a call tip cancels any active autocompletion list, and vice versa.
Call tips can highlight part of the text within them. You could use this to highlight the current argument to a function by counting the number of commas.
The mouse may be clicked on call tips and this causes a calltip-click notification to be sent to the container. Small up and down arrows may be displayed within a call tip by, respectively, including the characters ‘001’, or ‘002’. This is useful for showing that there are overloaded variants of one function name and that the user can click on the arrows to cycle through the overloads.
Alternatively, call tips can be displayed when you leave the mouse pointer for a while over a word in response to the dwell-start notification and cancelled in response to dwell-end . This method could be used in a debugger to give the value of a variable, or during editing to give information about the word under the pointer.
-
gtkscintilla.Scintilla.calltip_show(posStart, definition)
- This message starts the process by displaying the call tip window. If a call tip is already active, this has no effect.
posStart is the position in the document at which to align the call tip. The call tip text is aligned to start 1 line below this character unless you have included up and/or down arrows in the call tip text in which case the tip is aligned to the right-hand edge of the rightmost arrow. The assumption is that you will start the text with something like “001 1 of 3 002”.
definition is the call tip text. This can contain multiple lines separated by ‘n’ (Line Feed, ASCII code 10) characters. Do not include ‘r’ (Carriage Return, ASCII code 13), as this will most likely print as an empty box. ‘t’ (Tab, ASCII code 9) is supported if you set a tabsize with call_tip_use_style() .
-
gtkscintilla.Scintilla.calltip_cancel()
- This message cancels any displayed call tip. Scintilla will also cancel call tips for you if you use any keyboard commands that are not compatible with editing the argument list of a function.
-
gtkscintilla.Scintilla.calltip_active()
- This returns 1 if a call tip is active and 0 if it is not active.
-
gtkscintilla.Scintilla.calltip_pos_start()
- This message returns the value of the current position when calltip_show() started to display the tip.
-
gtkscintilla.Scintilla.calltip_set_hlt(hlStart, hlEnd)
This sets the region of the call tips text to display in a highlighted style. hlStart is the zero-based index into the string of the first character to highlight and hlEnd is the index of the first character after the highlight. hlEnd must be greater than hlStart; hlEnd-hlStart is the number of characters to highlight. Highlights can extend over line ends if this is required.
Unhighlighted text is drawn in a mid gray. Selected text is drawn in a dark blue. The background is white. These can be changed with calltip_set_back() , calltip_set_fore() , and calltip_set_fore_hlt() .
-
gtkscintilla.Scintilla.calltip_set_back(colour)
- The background colour of call tips can be set with this message; the default colour is white. It is not a good idea to set a dark colour as the background as the default colour for normal calltip text is mid gray and the defaultcolour for highlighted text is dark blue. This also sets the background colour of STYLE_CALLTIP.
-
gtkscintilla.Scintilla.calltip_set_fore(colour)
- The colour of call tip text can be set with this message; the default colour is mid gray. This also sets the foreground colour of STYLE_CALLTIP.
-
gtkscintilla.Scintilla.calltip_set_fore_hlt(colour)
- The colour of highlighted call tip text can be set with this message; the default colour is dark blue.
-
gtkscintilla.Scintilla.calltip_use_style(tabsize)
- This message changes the style used for call tips from STYLE_DEFAULT to STYLE_CALLTIP and sets a tab size in screen pixels. If tabsize is less than 1, Tab characters are not treated specially. Once this call has been used, the call tip foreground and background colours are also taken from the style.