]> git.saurik.com Git - wxWidgets.git/blob - src/motif/toolbar.cpp
Include wx/panel.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / motif / toolbar.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/toolbar.cpp
3 // Purpose: wxToolBar
4 // Author: Julian Smart
5 // Modified by: 13.12.99 by VZ during toolbar classes reorganization
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
22
23 #ifdef __VMS
24 #define XtDisplay XTDISPLAY
25 #endif
26
27 #include "wx/toolbar.h"
28
29 #ifndef WX_PRECOMP
30 #include "wx/app.h"
31 #endif
32
33 #include "wx/settings.h"
34 #include "wx/timer.h"
35 #include "wx/frame.h"
36
37 #ifdef __VMS__
38 #pragma message disable nosimpint
39 #endif
40 #include <Xm/Xm.h>
41 #include <Xm/PushBG.h>
42 #include <Xm/PushB.h>
43 #include <Xm/Label.h>
44 #include <Xm/ToggleB.h>
45 #include <Xm/ToggleBG.h>
46 #include <Xm/Form.h>
47 #ifdef __VMS__
48 #pragma message enable nosimpint
49 #endif
50
51 #include "wx/motif/private.h"
52 #include "wx/motif/bmpmotif.h"
53
54 // ----------------------------------------------------------------------------
55 // wxWin macros
56 // ----------------------------------------------------------------------------
57
58 IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
59
60 // ----------------------------------------------------------------------------
61 // private functions
62 // ----------------------------------------------------------------------------
63
64 static void wxToolButtonCallback (Widget w, XtPointer clientData,
65 XtPointer ptr);
66 static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
67 XEvent *event, Boolean *continue_to_dispatch);
68
69 // ----------------------------------------------------------------------------
70 // private classes
71 // ----------------------------------------------------------------------------
72
73 class wxToolBarTimer : public wxTimer
74 {
75 public:
76 virtual void Notify();
77
78 static Widget help_popup;
79 static Widget buttonWidget;
80 static wxString helpString;
81 };
82
83 class wxToolBarTool : public wxToolBarToolBase
84 {
85 public:
86 wxToolBarTool(wxToolBar *tbar,
87 int id,
88 const wxString& label,
89 const wxBitmap& bmpNormal,
90 const wxBitmap& bmpToggled,
91 wxItemKind kind,
92 wxObject *clientData,
93 const wxString& shortHelp,
94 const wxString& longHelp)
95 : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpToggled, kind,
96 clientData, shortHelp, longHelp)
97 {
98 Init();
99 }
100
101 wxToolBarTool(wxToolBar *tbar, wxControl *control)
102 : wxToolBarToolBase(tbar, control)
103 {
104 Init();
105 }
106
107 virtual ~wxToolBarTool();
108
109 // accessors
110 void SetWidget(Widget widget) { m_widget = widget; }
111 Widget GetButtonWidget() const { return m_widget; }
112
113 Pixmap GetArmPixmap()
114 {
115 m_bitmapCache.SetBitmap( GetNormalBitmap() );
116 return (Pixmap)m_bitmapCache.GetArmPixmap( (WXWidget)m_widget );
117 }
118
119 Pixmap GetInsensPixmap()
120 {
121 m_bitmapCache.SetBitmap( GetNormalBitmap() );
122 return (Pixmap)m_bitmapCache.GetInsensPixmap( (WXWidget)m_widget );
123 }
124 protected:
125 void Init();
126
127 Widget m_widget;
128 wxBitmapCache m_bitmapCache;
129 };
130
131 // ----------------------------------------------------------------------------
132 // globals
133 // ----------------------------------------------------------------------------
134
135 static wxToolBarTimer* wxTheToolBarTimer = (wxToolBarTimer*) NULL;
136
137 Widget wxToolBarTimer::help_popup = (Widget) 0;
138 Widget wxToolBarTimer::buttonWidget = (Widget) 0;
139 wxString wxToolBarTimer::helpString;
140
141 // ============================================================================
142 // implementation
143 // ============================================================================
144
145 // ----------------------------------------------------------------------------
146 // wxToolBarTool
147 // ----------------------------------------------------------------------------
148
149 wxToolBarToolBase *wxToolBar::CreateTool(int id,
150 const wxString& label,
151 const wxBitmap& bmpNormal,
152 const wxBitmap& bmpToggled,
153 wxItemKind kind,
154 wxObject *clientData,
155 const wxString& shortHelp,
156 const wxString& longHelp)
157 {
158 return new wxToolBarTool(this, id, label, bmpNormal, bmpToggled, kind,
159 clientData, shortHelp, longHelp);
160 }
161
162
163 wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
164 {
165 return new wxToolBarTool(this, control);
166 }
167
168 void wxToolBarTool::Init()
169 {
170 m_widget = (Widget)0;
171 }
172
173 wxToolBarTool::~wxToolBarTool()
174 {
175 if ( m_widget )
176 XtDestroyWidget(m_widget);
177 }
178
179 // ----------------------------------------------------------------------------
180 // wxToolBar construction
181 // ----------------------------------------------------------------------------
182
183 void wxToolBar::Init()
184 {
185 m_maxWidth = -1;
186 m_maxHeight = -1;
187 m_defaultWidth = 24;
188 m_defaultHeight = 22;
189 m_toolPacking = 2;
190 m_toolSeparation = 8;
191 m_xMargin = 2;
192 m_yMargin = 2;
193 m_maxRows = 100;
194 m_maxCols = 100;
195 }
196
197 bool wxToolBar::Create(wxWindow *parent,
198 wxWindowID id,
199 const wxPoint& pos,
200 const wxSize& size,
201 long style,
202 const wxString& name)
203 {
204 if( !wxControl::CreateControl( parent, id, pos, size, style,
205 wxDefaultValidator, name ) )
206 return false;
207
208 m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
209
210 Widget parentWidget = (Widget) parent->GetClientWidget();
211
212 Widget toolbar = XtVaCreateManagedWidget("toolbar",
213 xmBulletinBoardWidgetClass, (Widget) parentWidget,
214 XmNmarginWidth, 0,
215 XmNmarginHeight, 0,
216 XmNresizePolicy, XmRESIZE_NONE,
217 NULL);
218 /*
219 Widget toolbar = XtVaCreateManagedWidget("toolbar",
220 xmFormWidgetClass, (Widget) m_clientWidget,
221 XmNtraversalOn, False,
222 XmNhorizontalSpacing, 0,
223 XmNverticalSpacing, 0,
224 XmNleftOffset, 0,
225 XmNrightOffset, 0,
226 XmNmarginWidth, 0,
227 XmNmarginHeight, 0,
228 NULL);
229 */
230
231 m_mainWidget = (WXWidget) toolbar;
232
233 ChangeFont(false);
234
235 wxPoint rPos = pos;
236 wxSize rSize = size;
237
238 if( rPos.x == -1 ) rPos.x = 0;
239 if( rPos.y == -1 ) rPos.y = 0;
240 if( rSize.x == -1 && GetParent() )
241 rSize.x = GetParent()->GetSize().x;
242
243 AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
244 rPos.x, rPos.y, rSize.x, rSize.y);
245
246 ChangeBackgroundColour();
247
248 return true;
249 }
250
251 wxToolBar::~wxToolBar()
252 {
253 delete wxTheToolBarTimer;
254 wxTheToolBarTimer = NULL;
255 }
256
257 bool wxToolBar::Realize()
258 {
259 if ( m_tools.GetCount() == 0 )
260 {
261 // nothing to do
262 return true;
263 }
264
265 bool isVertical = GetWindowStyle() & wxTB_VERTICAL;
266
267 // Separator spacing
268 const int separatorSize = GetToolSeparation(); // 8;
269 wxSize margins = GetToolMargins();
270 int packing = GetToolPacking();
271 int marginX = margins.x;
272 int marginY = margins.y;
273
274 int currentX = marginX;
275 int currentY = marginY;
276
277 int buttonHeight = 0, buttonWidth = 0;
278
279 Widget button;
280 Pixmap pixmap, insensPixmap;
281 wxBitmap bmp, insensBmp;
282
283 wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
284 while ( node )
285 {
286 wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
287
288 switch ( tool->GetStyle() )
289 {
290 case wxTOOL_STYLE_CONTROL:
291 {
292 wxControl* control = tool->GetControl();
293 wxSize sz = control->GetSize();
294 wxPoint pos = control->GetPosition();
295 // Allow a control to specify a y[x]-offset by setting
296 // its initial position, but still don't allow it to
297 // position itself above the top[left] margin.
298 int controlY = (pos.y > 0) ? pos.y : currentY;
299 int controlX = (pos.x > 0) ? pos.x : currentX;
300 control->Move( isVertical ? controlX : currentX,
301 isVertical ? currentY : controlY );
302 if ( isVertical )
303 currentY += sz.y + packing;
304 else
305 currentX += sz.x + packing;
306
307 break;
308 }
309 case wxTOOL_STYLE_SEPARATOR:
310 // skip separators for vertical toolbars
311 if( !isVertical )
312 {
313 currentX += separatorSize;
314 }
315 break;
316
317 case wxTOOL_STYLE_BUTTON:
318 button = (Widget) 0;
319
320 if ( tool->CanBeToggled() && !tool->GetButtonWidget() )
321 {
322 button = XtVaCreateWidget("toggleButton",
323 xmToggleButtonWidgetClass, (Widget) m_mainWidget,
324 XmNx, currentX, XmNy, currentY,
325 XmNindicatorOn, False,
326 XmNshadowThickness, 2,
327 XmNborderWidth, 0,
328 XmNspacing, 0,
329 XmNmarginWidth, 0,
330 XmNmarginHeight, 0,
331 XmNmultiClick, XmMULTICLICK_KEEP,
332 XmNlabelType, XmPIXMAP,
333 NULL);
334 XtAddCallback ((Widget) button,
335 XmNvalueChangedCallback,
336 (XtCallbackProc) wxToolButtonCallback,
337 (XtPointer) this);
338
339 XtVaSetValues ((Widget) button,
340 XmNselectColor,
341 m_backgroundColour.AllocColour
342 (XtDisplay((Widget) button)),
343 NULL);
344 }
345 else if( !tool->GetButtonWidget() )
346 {
347 button = XtVaCreateWidget("button",
348 xmPushButtonWidgetClass, (Widget) m_mainWidget,
349 XmNx, currentX, XmNy, currentY,
350 XmNpushButtonEnabled, True,
351 XmNmultiClick, XmMULTICLICK_KEEP,
352 XmNlabelType, XmPIXMAP,
353 NULL);
354 XtAddCallback (button,
355 XmNactivateCallback,
356 (XtCallbackProc) wxToolButtonCallback,
357 (XtPointer) this);
358 }
359
360 if( !tool->GetButtonWidget() )
361 {
362 wxDoChangeBackgroundColour((WXWidget) button,
363 m_backgroundColour, true);
364
365 tool->SetWidget(button);
366 }
367 else
368 {
369 button = (Widget)tool->GetButtonWidget();
370 XtVaSetValues( button,
371 XmNx, currentX, XmNy, currentY,
372 NULL );
373 }
374
375 // For each button, if there is a mask, we must create
376 // a new wxBitmap that has the correct background colour
377 // for the button. Otherwise the background will just be
378 // e.g. black if a transparent XPM has been loaded.
379 bmp = tool->GetNormalBitmap();
380 insensBmp = tool->GetDisabledBitmap();
381 if ( bmp.GetMask() || insensBmp.GetMask() )
382 {
383 int backgroundPixel;
384 XtVaGetValues(button, XmNbackground, &backgroundPixel,
385 NULL);
386
387 wxColour col;
388 col.SetPixel(backgroundPixel);
389
390 if( bmp.Ok() && bmp.GetMask() )
391 {
392 bmp = wxCreateMaskedBitmap(bmp, col);
393 tool->SetNormalBitmap(bmp);
394 }
395
396 if( insensBmp.Ok() && insensBmp.GetMask() )
397 {
398 insensBmp = wxCreateMaskedBitmap(insensBmp, col);
399 tool->SetDisabledBitmap(insensBmp);
400 }
401 }
402
403 // Create a selected/toggled bitmap. If there isn't a 2nd
404 // bitmap, we need to create it (with a darker, selected
405 // background)
406 int backgroundPixel;
407 if ( tool->CanBeToggled() )
408 XtVaGetValues(button, XmNselectColor, &backgroundPixel,
409 NULL);
410 else
411 XtVaGetValues(button, XmNarmColor, &backgroundPixel,
412 NULL);
413 wxColour col;
414 col.SetPixel(backgroundPixel);
415
416 pixmap = (Pixmap) bmp.GetDrawable();
417 {
418 wxBitmap tmp = tool->GetDisabledBitmap();
419
420 insensPixmap = tmp.Ok() ?
421 (Pixmap)tmp.GetDrawable() :
422 tool->GetInsensPixmap();
423 }
424
425 if (tool->CanBeToggled())
426 {
427 // Toggle button
428 Pixmap pixmap2 = tool->GetArmPixmap();
429 Pixmap insensPixmap2 = tool->GetInsensPixmap();
430
431 XtVaSetValues (button,
432 XmNfillOnSelect, True,
433 XmNlabelPixmap, pixmap,
434 XmNselectPixmap, pixmap2,
435 XmNlabelInsensitivePixmap, insensPixmap,
436 XmNselectInsensitivePixmap, insensPixmap2,
437 XmNlabelType, XmPIXMAP,
438 NULL);
439 }
440 else
441 {
442 Pixmap pixmap2 = tool->GetArmPixmap();
443
444 // Normal button
445 XtVaSetValues(button,
446 XmNlabelPixmap, pixmap,
447 XmNlabelInsensitivePixmap, insensPixmap,
448 XmNarmPixmap, pixmap2,
449 NULL);
450 }
451
452 XtManageChild(button);
453
454 {
455 Dimension width, height;
456 XtVaGetValues(button,
457 XmNwidth, &width,
458 XmNheight, & height,
459 NULL);
460 if ( isVertical )
461 currentY += height + packing;
462 else
463 currentX += width + packing;
464 buttonHeight = wxMax(buttonHeight, height);
465 buttonWidth = wxMax(buttonWidth, width);
466 }
467
468 XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask,
469 False, wxToolButtonPopupCallback, (XtPointer) this);
470
471 break;
472 }
473
474 node = node->GetNext();
475 }
476
477 SetSize( -1, -1,
478 isVertical ? buttonWidth + 2 * marginX : -1,
479 isVertical ? -1 : buttonHeight + 2*marginY );
480
481 return true;
482 }
483
484 wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
485 wxCoord WXUNUSED(y)) const
486 {
487 wxFAIL_MSG( _T("TODO") );
488
489 return (wxToolBarToolBase *)NULL;
490 }
491
492 bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
493 {
494 tool->Attach(this);
495
496 return true;
497 }
498
499 bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
500 {
501 tool->Detach();
502
503 bool isVertical = GetWindowStyle() & wxTB_VERTICAL;
504 const int separatorSize = GetToolSeparation(); // 8;
505 int packing = GetToolPacking();
506 int offset = 0;
507
508 for( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
509 node; node = node->GetNext() )
510 {
511 wxToolBarTool *t = (wxToolBarTool*)node->GetData();
512
513 if( t == tool )
514 {
515 switch ( t->GetStyle() )
516 {
517 case wxTOOL_STYLE_CONTROL:
518 {
519 wxSize size = t->GetControl()->GetSize();
520 offset = isVertical ? size.y : size.x;
521 offset += packing;
522 break;
523 }
524 case wxTOOL_STYLE_SEPARATOR:
525 offset = isVertical ? 0 : separatorSize;
526 break;
527 case wxTOOL_STYLE_BUTTON:
528 {
529 Widget w = t->GetButtonWidget();
530 Dimension width, height;
531
532 XtVaGetValues( w,
533 XmNwidth, &width,
534 XmNheight, &height,
535 NULL );
536
537 offset = isVertical ? height : width;
538 offset += packing;
539 break;
540 }
541 }
542 }
543 else if( offset )
544 {
545 switch ( t->GetStyle() )
546 {
547 case wxTOOL_STYLE_CONTROL:
548 {
549 wxPoint location = t->GetControl()->GetPosition();
550
551 if( isVertical )
552 location.y -= offset;
553 else
554 location.x -= offset;
555
556 t->GetControl()->Move( location );
557 break;
558 }
559 case wxTOOL_STYLE_SEPARATOR:
560 break;
561 case wxTOOL_STYLE_BUTTON:
562 {
563 Dimension x, y;
564 XtVaGetValues( t->GetButtonWidget(),
565 XmNx, &x,
566 XmNy, &y,
567 NULL );
568
569 if( isVertical )
570 y = (Dimension)(y - offset);
571 else
572 x = (Dimension)(x - offset);
573
574 XtVaSetValues( t->GetButtonWidget(),
575 XmNx, x,
576 XmNy, y,
577 NULL );
578 break;
579 }
580 }
581 }
582 }
583
584 return true;
585 }
586
587 void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
588 {
589 wxToolBarTool *tool = (wxToolBarTool *)toolBase;
590 if (tool->GetButtonWidget()){
591 XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable);
592 } else if (wxTOOL_STYLE_CONTROL == tool->GetStyle()){
593 // Controls (such as wxChoice) do not have button widgets
594 tool->GetControl()->Enable(enable);
595 }
596 }
597
598 void wxToolBar::DoToggleTool(wxToolBarToolBase *toolBase, bool toggle)
599 {
600 wxToolBarTool *tool = (wxToolBarTool *)toolBase;
601
602 XmToggleButtonSetState(tool->GetButtonWidget(), (Boolean) toggle, False);
603 }
604
605 void wxToolBar::DoSetToggle(wxToolBarToolBase * WXUNUSED(tool),
606 bool WXUNUSED(toggle))
607 {
608 // nothing to do
609 }
610
611 void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags)
612 {
613 int old_width, old_height;
614 GetSize(&old_width, &old_height);
615
616 // Correct width and height if needed.
617 if ( width == -1 || height == -1 )
618 {
619 wxSize defaultSize = GetSize();
620
621 if ( width == -1 )
622 width = defaultSize.x;
623 if ( height == -1 )
624 height = defaultSize.y;
625 }
626
627 wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags);
628
629 // We must refresh the frame size when the toolbar changes size
630 // otherwise the toolbar can be shown incorrectly
631 if ( old_width != width || old_height != height )
632 {
633 // But before we send the size event check it
634 // we have a frame that is not being deleted.
635 wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
636 if ( frame && !frame->IsBeingDeleted() )
637 {
638 frame->SendSizeEvent();
639 }
640 }
641 }
642
643 // ----------------------------------------------------------------------------
644 // Motif callbacks
645 // ----------------------------------------------------------------------------
646
647 wxToolBarToolBase *wxToolBar::FindToolByWidget(WXWidget w) const
648 {
649 wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();
650 while ( node )
651 {
652 wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
653 if ( tool->GetButtonWidget() == w)
654 {
655 return tool;
656 }
657
658 node = node->GetNext();
659 }
660
661 return (wxToolBarToolBase *)NULL;
662 }
663
664 static void wxToolButtonCallback(Widget w,
665 XtPointer clientData,
666 XtPointer WXUNUSED(ptr))
667 {
668 wxToolBar *toolBar = (wxToolBar *) clientData;
669 wxToolBarToolBase *tool = toolBar->FindToolByWidget((WXWidget) w);
670 if ( !tool )
671 return;
672
673 if ( tool->CanBeToggled() )
674 tool->Toggle();
675
676 if ( !toolBar->OnLeftClick(tool->GetId(), tool->IsToggled()) )
677 {
678 // revert
679 tool->Toggle();
680 }
681 }
682
683
684 static void wxToolButtonPopupCallback(Widget w,
685 XtPointer client_data,
686 XEvent *event,
687 Boolean *WXUNUSED(continue_to_dispatch))
688 {
689 // TODO: retrieve delay before popping up tooltip from wxSystemSettings.
690 static const int delayMilli = 800;
691
692 wxToolBar* toolBar = (wxToolBar*) client_data;
693 wxToolBarToolBase *tool = toolBar->FindToolByWidget((WXWidget) w);
694
695 if ( !tool )
696 return;
697
698 wxString tooltip = tool->GetShortHelp();
699 if ( !tooltip )
700 return;
701
702 if (!wxTheToolBarTimer)
703 wxTheToolBarTimer = new wxToolBarTimer;
704
705 wxToolBarTimer::buttonWidget = w;
706 wxToolBarTimer::helpString = tooltip;
707
708 /************************************************************/
709 /* Popup help label */
710 /************************************************************/
711 if (event->type == EnterNotify)
712 {
713 if (wxToolBarTimer::help_popup != (Widget) 0)
714 {
715 XtDestroyWidget (wxToolBarTimer::help_popup);
716 XtPopdown (wxToolBarTimer::help_popup);
717 }
718 wxToolBarTimer::help_popup = (Widget) 0;
719
720 // One shot
721 wxTheToolBarTimer->Start(delayMilli, true);
722
723 }
724 /************************************************************/
725 /* Popdown help label */
726 /************************************************************/
727 else if (event->type == LeaveNotify)
728 {
729 if (wxTheToolBarTimer)
730 wxTheToolBarTimer->Stop();
731 if (wxToolBarTimer::help_popup != (Widget) 0)
732 {
733 XtDestroyWidget (wxToolBarTimer::help_popup);
734 XtPopdown (wxToolBarTimer::help_popup);
735 }
736 wxToolBarTimer::help_popup = (Widget) 0;
737 }
738 }
739
740 void wxToolBarTimer::Notify()
741 {
742 Position x, y;
743
744 /************************************************************/
745 /* Create shell without window decorations */
746 /************************************************************/
747 help_popup = XtVaCreatePopupShell ("shell",
748 overrideShellWidgetClass, (Widget) wxTheApp->GetTopLevelWidget(),
749 NULL);
750
751 /************************************************************/
752 /* Get absolute position on display of toolbar button */
753 /************************************************************/
754 XtTranslateCoords (buttonWidget,
755 (Position) 0,
756 (Position) 0,
757 &x, &y);
758
759 // Move the tooltip more or less above the button
760 int yOffset = 20; // TODO: What should be really?
761 y = (Position)(y - yOffset);
762 if (y < yOffset) y = 0;
763
764 /************************************************************/
765 /* Set the position of the help popup */
766 /************************************************************/
767 XtVaSetValues (help_popup,
768 XmNx, (Position) x,
769 XmNy, (Position) y,
770 NULL);
771
772 /************************************************************/
773 /* Create help label */
774 /************************************************************/
775 XmString text = XmStringCreateSimple ((char*) (const char*) helpString);
776 XtVaCreateManagedWidget ("help_label",
777 xmLabelWidgetClass, help_popup,
778 XmNlabelString, text,
779 XtVaTypedArg,
780 XmNforeground, XtRString, "black",
781 strlen("black")+1,
782 XtVaTypedArg,
783 XmNbackground, XtRString, "LightGoldenrod",
784 strlen("LightGoldenrod")+1,
785 NULL);
786 XmStringFree (text);
787
788 /************************************************************/
789 /* Popup help label */
790 /************************************************************/
791 XtPopup (help_popup, XtGrabNone);
792 }