[Gtk-sharp-list] Using Tooltips QueryTooltipHandler

Wolfgang Mauer W.Mauer at top-soft.info
Sat Jan 3 09:49:21 EST 2009


Hi all,
i want to use "dynamic" tooltips with the QueryTooltipHandler.
Can anyone explain how this works right?

I have tryed 

this.mywidget.HasTooltip = true;
this.mywidget.QueryTooltip += new QueryTooltipHandler(mywidgettooltip);

...

public void mywidgettooltip(object sender, QueryTooltipArgs args)
{
	args.args.Tooltip.Text = this.ToolTipText;
	args.RetVal = true;
}

but the Text will not be displayed.

if i use 
public void mywidgettooltip(object sender, QueryTooltipArgs args)
{
	(sender as Entry).TooltipText = this.ToolTipText;
	args.RetVal = true;
}
it works!

is this the right way to set the tooltip?
/
Wolfgang


-- 
Top-Soft
Softwareentwicklung
Inhaber: Wolfgang Mauer
Reitersweg 9, 96103 Hallstadt
Tel.: +49 (0)951 / 2221520
Fax: +49 (0)951 / 2221521


More information about the Gtk-sharp-list mailing list