Tool tips

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Tool tips

Submitted by Anonymous (not verified) on Fri, 06/15/2012 - 12:07

What is the secret to getting the tool-tip feature to work? We are using the openmotif that comes with Fedora Core 1:
openmotif-2.2.2-16.1
openmotif-devel-2.2.2-16.1
Despite having the XmNtoolTipEnabled = True and an XmNtoolTipString set on a number of pushbuttons, they are not displaying.
We use BxPro (6.12 Final), and the tool tips on its interface display properly. I've tried setting the resources in the code and in the application-defaults file.
john
‹ child windows Help!!! Motif Newbie

Anonymous

Tue, 03/30/2004 - 13:54#1

Re: Tool tips

Here is a working sample using tool tips.

<br />
#include <stdlib.h><br />
#include <Xm/XmAll.h></p>
<p>int main(int argc, char *argv[])<br />
{<br />
XtAppContext app_context;<br />
Widget top_level, helloworld_main, exitButton;<br />
XmString tmp;</p>
<p> top_level = XtVaAppInitialize(&app_context, "test1",<br />
NULL, 0, &argc, argv, NULL,<br />
XmNtoolTipEnable, True,<br />
XmNtoolTipPostDelay, 500,<br />
XmNtoolTipPostDuration, 3000, NULL);</p>
<p> helloworld_main =<br />
XmCreateMainWindow(top_level, "helloworld_main", NULL, 0);</p>
<p> tmp = XmStringCreateLocalized("Exit the program");<br />
exitButton =<br />
XtVaCreateWidget("Exit", xmPushButtonWidgetClass,<br />
helloworld_main, XmNtoolTipString, tmp, NULL);<br />
XtAddCallback(exitButton, XmNactivateCallback,<br />
(XtCallbackProc) exit, NULL);<br />
XmStringFree(tmp);<br />
XtManageChild(exitButton);</p>
<p> XtManageChild(helloworld_main);</p>
<p> XtRealizeWidget(top_level);</p>
<p> XtAppMainLoop(app_context);</p>
<p> return (0);<br />
}<br />