~ubuntu-branches/ubuntu/raring/openmotif/raring-proposed

« back to all changes in this revision

Viewing changes to lib/Xm/ToolTip.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bauer
  • Date: 2010-06-29 09:42:21 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100629094221-yee9gtet2dngu6cv
Tags: 2.3.3-1
* New upstream release
* Drop patch for autoconf-bug as this was fixed upstream
* Applied patch to fix implicit pointer conversion (Closes: #587461)
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 *
3
 
 * $Id: ToolTip.c,v 1.12 2004/12/07 11:36:31 yura Exp $
 
3
 * $Id: ToolTip.c,v 1.12.2.3 2009/09/28 13:16:39 ihayvuk Exp $
4
4
 *
5
5
 **/
6
6
 
18
18
#include <Xm/ToolTipT.h>
19
19
#include "BaseClassI.h"
20
20
#include "ToolTipI.h"
 
21
#include "XmI.h"
 
22
 
 
23
#ifdef FIX_1388
 
24
static void ToolTipLabelDestroyCallback(Widget w, XtPointer client_data, XtPointer call_data)
 
25
{
 
26
    XmToolTipConfigTrait ttcp;
 
27
    
 
28
    ttcp = (XmToolTipConfigTrait) XmeTraitGet(w, XmQTtoolTipConfig);
 
29
    
 
30
    if (ttcp != NULL)
 
31
        if (ttcp->label != NULL) {
 
32
            Widget shell = XtParent(ttcp->label);
 
33
            XtDestroyWidget(ttcp->label);
 
34
            ttcp->label = NULL;
 
35
            XtDestroyWidget(shell);
 
36
        }
 
37
}
 
38
#endif /* FIX_1388 */
21
39
 
22
40
static XmToolTipConfigTrait
23
41
ToolTipGetData (Widget w)
32
50
 
33
51
   ttp = (XmToolTipConfigTrait) XmeTraitGet (top, XmQTtoolTipConfig);
34
52
 
35
 
   if (ttp->label == NULL)
 
53
   if (ttp != NULL && ttp->label == NULL && !top->core.being_destroyed)
36
54
   {
37
55
      Widget shell;
38
56
 
42
60
 
43
61
      ttp->label = XmCreateLabel (shell, "TipLabel", NULL, 0);
44
62
      XtManageChild (ttp->label);
 
63
#ifdef FIX_1388
 
64
      XtAddCallback(top, XmNdestroyCallback, (XtCallbackProc) ToolTipLabelDestroyCallback, (XtPointer) NULL);
 
65
#endif
45
66
   }
46
67
   return ttp;
47
68
}
68
89
      ttp->slider = NULL;
69
90
   }
70
91
 
71
 
   if (!XtParent (ttp->label)->core.being_destroyed)
 
92
   if (ttp->label != NULL && !XtParent (ttp->label)->core.being_destroyed)
72
93
   {
73
94
      XtPopdown (XtParent (ttp->label));
74
95
   }
267
288
 
268
289
}
269
290
 
 
291
#ifdef FIX_1388
 
292
void _XmToolTipRemove(Widget w)
 
293
{
 
294
    XmToolTipTrait ttp;
 
295
    
 
296
    _XmToolTipLeave(w, NULL, NULL, NULL);
 
297
    ttp = (XmToolTipTrait) XmeTraitGet(w, XmQTtoolTip);
 
298
    if (ttp != NULL) {
 
299
        XmStringFree(ttp->tool_tip_string); 
 
300
        XmeTraitSet(w, XmQTtoolTip, (XtPointer) NULL); 
 
301
        XtFree((char*)ttp);
 
302
    }
 
303
}
 
304
#endif /* FIX_1388 */
 
305
 
270
306
Widget 
271
307
XmToolTipGetLabel(Widget wid)
272
308
{