edt.SetHint only displays in an empty TextEdit and cannot be seen at all without removing any content.
The tooltip is not associated with any control and can be displayed anywhere on the screen when required.
In the app from which the screenshot is taken, the TextEdit is prepopulated with a sampe URL and the tooltip is displayed when the "?" button is pressed.
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
img = app.CreateImage( "/Sys/Img/Droid1.png", 0.5 );
img.SetOnTouchUp( showTip );
lay.AddChild( img );
app.AddLayout( lay );
}
function showTip()
{
var pos = img.GetPosition();
var btm = pos.top + this.GetHeight()*2/3;
var msg = "This is a picture of a droid. <br>It comes from System Resources";
app.ShowTip(msg, pos.left, btm);
}
It has been replaced with
app.ShowTip()
There is example code in the latest docs.
I can't remember offhand whether ShowTip is a premium feature but it's not flagged in the docs as such.
Looks like nobody tested touching the tooltip.
function _Call( id, func, params)
{ if( func ) func.apply( _map[id], params ); }
_cbMap['3533501187'] = _dlgTip.Dismiss;
However don't keep that in your code because it will break if any slight change on the internal OnToch method is made.//Show a tooltip message.
var _dlgTip = null;
_ShowTip = function( msg, left, top, timeOut, options )
{
//Get options.
if( options ) options = options.toLowerCase();
else options = "";
//Remove old tip if still showing.
if( _dlgTip ) { _dlgTip.Dismiss(); clearTimeout(_dlgTip._tm) }
//Create dialog window.
_dlgTip = app.CreateDialog( null, "AutoCancel,NoDim,"+options );
_dlgTip.SetBackColor( "#00000000" );
_dlgTip.SetPosition( left, top );
//Create tip layout.
var layTipDlg = app.CreateLayout( "linear", "vertical,fillxy" );
//Create tip text.
var txt = app.CreateText( msg, -1,-1, "MultiLine,left,Html" );
txt.SetTextSize( 22, "ps" );
if( options.indexOf("up")>-1 ) txt.SetBackground( "/Res/drawable/tooltip_up" );
else txt.SetBackground( "/Res/drawable/tooltip_down" );
txt.SetOnTouch( function() { _dlgTip.Dismiss() } );
layTipDlg.AddChild( txt );
//Add dialog layout and show dialog.
_dlgTip.AddLayout( layTipDlg );
_dlgTip.Show();
if( timeOut ) {
_dlgTip._tm = setTimeout( function(){
if(_dlgTip)_dlgTip.Dismiss(); _dlgTip=null
}, timeOut );
}
}