]> git.saurik.com Git - wxWidgets.git/blame - src/motif/toolbar.cpp
Start of actual filling in of wxFrame.
[wxWidgets.git] / src / motif / toolbar.cpp
CommitLineData
4bb6408c 1/////////////////////////////////////////////////////////////////////////////
8a0681f9 2// Name: motif/toolbar.cpp
4bb6408c
JS
3// Purpose: wxToolBar
4// Author: Julian Smart
8a0681f9 5// Modified by: 13.12.99 by VZ during toolbar classes reorganization
4bb6408c
JS
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
8a0681f9 9// Licence: wxWindows licence
4bb6408c
JS
10/////////////////////////////////////////////////////////////////////////////
11
8a0681f9
VZ
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
4bb6408c 20#ifdef __GNUG__
8a0681f9 21 #pragma implementation "toolbar.h"
4bb6408c
JS
22#endif
23
24#include "wx/wx.h"
1a3ac83f
JS
25#include "wx/app.h"
26#include "wx/timer.h"
1ccbb61a 27#include "wx/toolbar.h"
0d57be45 28
338dd992
JJ
29#ifdef __VMS__
30#pragma message disable nosimpint
31#endif
0d57be45
JS
32#include <Xm/Xm.h>
33#include <Xm/PushBG.h>
34#include <Xm/PushB.h>
1a3ac83f 35#include <Xm/Label.h>
0d57be45
JS
36#include <Xm/ToggleB.h>
37#include <Xm/ToggleBG.h>
38#include <Xm/Form.h>
338dd992
JJ
39#ifdef __VMS__
40#pragma message enable nosimpint
41#endif
0d57be45
JS
42
43#include "wx/motif/private.h"
4bb6408c 44
8a0681f9
VZ
45// ----------------------------------------------------------------------------
46// wxWin macros
47// ----------------------------------------------------------------------------
48
49#if !USE_SHARED_LIBRARY
50IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
51#endif
4bb6408c 52
8a0681f9
VZ
53// ----------------------------------------------------------------------------
54// private functions
55// ----------------------------------------------------------------------------
4bb6408c 56
1a3ac83f 57static void wxToolButtonCallback (Widget w, XtPointer clientData,
bf6c2b35 58 XtPointer ptr);
1a3ac83f
JS
59static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
60 XEvent *event, Boolean *continue_to_dispatch);
61
8a0681f9
VZ
62// ----------------------------------------------------------------------------
63// private classes
64// ----------------------------------------------------------------------------
65
66class wxToolBarTimer : public wxTimer
1a3ac83f
JS
67{
68public:
8a0681f9 69 virtual void Notify();
1a3ac83f 70
8a0681f9
VZ
71 static Widget help_popup;
72 static Widget buttonWidget;
73 static wxString helpString;
1a3ac83f
JS
74};
75
8a0681f9
VZ
76class wxToolBarTool : public wxToolBarToolBase
77{
78public:
79 wxToolBarTool(wxToolBar *tbar,
80 int id,
81 const wxBitmap& bitmap1,
82 const wxBitmap& bitmap2,
83 bool toggle,
84 wxObject *clientData,
85 const wxString& shortHelpString,
86 const wxString& longHelpString)
87 : wxToolBarToolBase(tbar, id, bitmap1, bitmap2, toggle,
88 clientData, shortHelpString, longHelpString)
89 {
90 Init();
91 }
92
93 wxToolBarTool(wxToolBar *tbar, wxControl *control)
94 : wxToolBarToolBase(tbar, control)
95 {
96 Init();
97 }
98
99 virtual ~wxToolBarTool();
100
101 // accessors
102 void SetWidget(Widget widget) { m_widget = widget; }
103 Widget GetButtonWidget() const { return m_widget; }
104
105 void SetPixmap(Pixmap pixmap) { m_pixmap = pixmap; }
106 Pixmap GetPixmap() const { return m_pixmap; }
107
108protected:
109 void Init();
110
111 Widget m_widget;
112 Pixmap m_pixmap;
113};
114
115// ----------------------------------------------------------------------------
116// globals
117// ----------------------------------------------------------------------------
118
1a3ac83f
JS
119static wxToolBarTimer* wxTheToolBarTimer = (wxToolBarTimer*) NULL;
120
121Widget wxToolBarTimer::help_popup = (Widget) 0;
122Widget wxToolBarTimer::buttonWidget = (Widget) 0;
8a0681f9
VZ
123wxString wxToolBarTimer::helpString;
124
125// ============================================================================
126// implementation
127// ============================================================================
128
129// ----------------------------------------------------------------------------
130// wxToolBarTool
131// ----------------------------------------------------------------------------
132
982b2cfc
VZ
133wxToolBarToolBase *wxToolBar::CreateTool(int id,
134 const wxBitmap& bitmap1,
135 const wxBitmap& bitmap2,
136 bool toggle,
137 wxObject *clientData,
138 const wxString& shortHelpString,
139 const wxString& longHelpString)
8a0681f9 140{
982b2cfc 141 return new wxToolBarTool(this, id, bitmap1, bitmap2, toggle,
8a0681f9
VZ
142 clientData, shortHelpString, longHelpString);
143}
1a3ac83f 144
982b2cfc 145wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control)
4bb6408c 146{
982b2cfc 147 return new wxToolBarTool(this, control);
4bb6408c
JS
148}
149
8a0681f9
VZ
150void wxToolBarTool::Init()
151{
152 m_widget = (Widget)0;
153 m_pixmap = (Pixmap)0;
154}
155
156wxToolBarTool::~wxToolBarTool()
157{
982b2cfc
VZ
158 if ( m_widget )
159 XtDestroyWidget(m_widget);
160 if ( m_pixmap )
161 XmDestroyPixmap(DefaultScreenOfDisplay((Display*)wxGetDisplay()),
162 m_pixmap);
8a0681f9
VZ
163}
164
165// ----------------------------------------------------------------------------
166// wxToolBar construction
167// ----------------------------------------------------------------------------
168
169void wxToolBar::Init()
4bb6408c
JS
170{
171 m_maxWidth = -1;
172 m_maxHeight = -1;
4bb6408c
JS
173 m_defaultWidth = 24;
174 m_defaultHeight = 22;
8a0681f9
VZ
175}
176
177bool wxToolBar::Create(wxWindow *parent,
178 wxWindowID id,
179 const wxPoint& pos,
180 const wxSize& size,
181 long style,
182 const wxString& name)
183{
184 Init();
185
186 m_windowId = id;
187
4bb6408c 188 SetName(name);
0d57be45
JS
189 m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
190 m_foregroundColour = parent->GetForegroundColour();
4bb6408c
JS
191 m_windowStyle = style;
192
193 SetParent(parent);
194
195 if (parent) parent->AddChild(this);
196
0d57be45
JS
197 Widget parentWidget = (Widget) parent->GetClientWidget();
198
199 Widget toolbar = XtVaCreateManagedWidget("toolbar",
7fe7d506
JS
200 xmBulletinBoardWidgetClass, (Widget) parentWidget,
201 XmNmarginWidth, 0,
202 XmNmarginHeight, 0,
203 XmNresizePolicy, XmRESIZE_NONE,
204 NULL);
205/*
206 Widget toolbar = XtVaCreateManagedWidget("toolbar",
207 xmFormWidgetClass, (Widget) m_clientWidget,
0d57be45
JS
208 XmNtraversalOn, False,
209 XmNhorizontalSpacing, 0,
210 XmNverticalSpacing, 0,
1a3ac83f
JS
211 XmNleftOffset, 0,
212 XmNrightOffset, 0,
213 XmNmarginWidth, 0,
214 XmNmarginHeight, 0,
0d57be45 215 NULL);
7fe7d506 216*/
0d57be45
JS
217
218 m_mainWidget = (WXWidget) toolbar;
219
da175b2c 220 m_font = parent->GetFont();
4b5f3fe6
JS
221 ChangeFont(FALSE);
222
0d57be45
JS
223 SetCanAddEventHandler(TRUE);
224 AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
225
0d57be45 226 ChangeBackgroundColour();
bf6c2b35 227
0d57be45 228 return TRUE;
4bb6408c
JS
229}
230
231wxToolBar::~wxToolBar()
232{
1a3ac83f
JS
233 delete wxTheToolBarTimer;
234 wxTheToolBarTimer = NULL;
4bb6408c
JS
235}
236
8a0681f9 237bool wxToolBar::Realize()
7fe7d506 238{
8a0681f9
VZ
239 if ( m_tools.GetCount() == 0 )
240 {
241 // nothing to do
242 return TRUE;
243 }
7fe7d506
JS
244
245 // Separator spacing
246 const int separatorSize = GetToolSeparation(); // 8;
247 wxSize margins = GetToolMargins();
248 int marginX = margins.x;
249 int marginY = margins.y;
250
251 int currentX = marginX;
252 int currentY = marginY;
253
254 int buttonHeight = 0;
255
256 int currentSpacing = 0;
257
8a0681f9
VZ
258 Widget button;
259 Pixmap pixmap, insensPixmap;
260 wxBitmap bmp;
261
262 wxToolBarToolsList::Node *node = m_tools.GetFirst();
263 while ( node )
7fe7d506 264 {
8a0681f9 265 wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
7fe7d506 266
8a0681f9 267 switch ( tool->GetStyle() )
7fe7d506 268 {
8a0681f9
VZ
269 case wxTOOL_STYLE_CONTROL:
270 wxFAIL_MSG( _T("not implemented") );
271 break;
7fe7d506 272
8a0681f9
VZ
273 case wxTOOL_STYLE_SEPARATOR:
274 currentX += separatorSize;
275 break;
7fe7d506 276
8a0681f9
VZ
277 case wxTOOL_STYLE_BUTTON:
278 button = (Widget) 0;
bf6c2b35 279
8a0681f9 280 if ( tool->CanBeToggled() )
7fe7d506 281 {
8a0681f9
VZ
282 button = XtVaCreateWidget("toggleButton",
283 xmToggleButtonWidgetClass, (Widget) m_mainWidget,
284 XmNx, currentX, XmNy, currentY,
e838cc14
VZ
285 XmNindicatorOn, False,
286 XmNshadowThickness, 2,
287 XmNborderWidth, 0,
288 XmNspacing, 0,
289 XmNmarginWidth, 0,
290 XmNmarginHeight, 0,
8a0681f9
VZ
291 XmNmultiClick, XmMULTICLICK_KEEP,
292 XmNlabelType, XmPIXMAP,
293 NULL);
294 XtAddCallback ((Widget) button, XmNvalueChangedCallback, (XtCallbackProc) wxToolButtonCallback,
295 (XtPointer) this);
296
297 XtVaSetValues ((Widget) button,
298 XmNselectColor, m_backgroundColour.AllocColour(XtDisplay((Widget) button)),
299 NULL);
bf6c2b35 300 }
7fe7d506 301 else
8a0681f9
VZ
302 {
303 button = XtVaCreateWidget("button",
304 xmPushButtonWidgetClass, (Widget) m_mainWidget,
305 XmNx, currentX, XmNy, currentY,
306 XmNpushButtonEnabled, True,
307 XmNmultiClick, XmMULTICLICK_KEEP,
308 XmNlabelType, XmPIXMAP,
309 NULL);
310 XtAddCallback (button,
311 XmNactivateCallback, (XtCallbackProc) wxToolButtonCallback,
312 (XtPointer) this);
313 }
7fe7d506 314
8a0681f9 315 DoChangeBackgroundColour((WXWidget) button, m_backgroundColour, TRUE);
7fe7d506 316
8a0681f9 317 tool->SetWidget(button);
7fe7d506 318
8a0681f9
VZ
319 // For each button, if there is a mask, we must create
320 // a new wxBitmap that has the correct background colour
321 // for the button. Otherwise the background will just be
322 // e.g. black if a transparent XPM has been loaded.
323 bmp = tool->GetBitmap1();
324 if ( bmp.GetMask() )
7fe7d506 325 {
8a0681f9
VZ
326 int backgroundPixel;
327 XtVaGetValues(button, XmNbackground, &backgroundPixel,
328 NULL);
329
330 wxColour col;
331 col.SetPixel(backgroundPixel);
332
e838cc14 333 bmp = wxCreateMaskedBitmap(bmp, col);
8a0681f9 334
e838cc14 335 tool->SetBitmap1(bmp);
7fe7d506 336 }
8a0681f9
VZ
337
338 // Create a selected/toggled bitmap. If there isn't a 2nd
339 // bitmap, we need to create it (with a darker, selected
340 // background)
341 int backgroundPixel;
342 if ( tool->CanBeToggled() )
343 XtVaGetValues(button, XmNselectColor, &backgroundPixel,
344 NULL);
7fe7d506 345 else
8a0681f9
VZ
346 XtVaGetValues(button, XmNarmColor, &backgroundPixel,
347 NULL);
348
349 wxColour col;
350 col.SetPixel(backgroundPixel);
351
352 if (tool->GetBitmap2().Ok() && tool->GetBitmap2().GetMask())
7fe7d506 353 {
8a0681f9
VZ
354 // Use what's there
355 wxBitmap newBitmap = wxCreateMaskedBitmap(tool->GetBitmap2(), col);
356 tool->SetBitmap2(newBitmap);
7fe7d506 357 }
8a0681f9 358 else
7fe7d506 359 {
8a0681f9
VZ
360 // Use unselected bitmap
361 if ( bmp.GetMask() )
362 {
363 wxBitmap newBitmap = wxCreateMaskedBitmap(bmp, col);
364 tool->SetBitmap2(newBitmap);
365 }
366 else
367 tool->SetBitmap2(bmp);
368 }
369
370 pixmap = (Pixmap) bmp.GetPixmap();
371 insensPixmap = (Pixmap) bmp.GetInsensPixmap();
372
373 if (tool->CanBeToggled())
374 {
375 // Toggle button
376 Pixmap pixmap2 = (Pixmap) 0;
377 Pixmap insensPixmap2 = (Pixmap) 0;
378
379 // If there's a bitmap for the toggled state, use it,
380 // otherwise generate one.
381 if (tool->GetBitmap2().Ok())
382 {
383 wxBitmap bmp2 = tool->GetBitmap2();
384 pixmap2 = (Pixmap) bmp2.GetPixmap();
385 insensPixmap2 = (Pixmap) bmp2.GetInsensPixmap();
386 }
387 else
388 {
389 pixmap2 = (Pixmap) bmp.GetArmPixmap(button);
390 insensPixmap2 = XCreateInsensitivePixmap((Display*) wxGetDisplay(), pixmap2);
391 }
392
982b2cfc
VZ
393 tool->SetPixmap(pixmap2);
394
8a0681f9 395 XtVaSetValues (button,
8a0681f9
VZ
396 XmNfillOnSelect, True,
397 XmNlabelPixmap, pixmap,
398 XmNselectPixmap, pixmap2,
399 XmNlabelInsensitivePixmap, insensPixmap,
400 XmNselectInsensitivePixmap, insensPixmap2,
401 XmNlabelType, XmPIXMAP,
402 NULL);
7fe7d506
JS
403 }
404 else
405 {
8a0681f9
VZ
406 Pixmap pixmap2 = (Pixmap) 0;
407
408 // If there's a bitmap for the armed state, use it,
409 // otherwise generate one.
410 if (tool->GetBitmap2().Ok())
411 {
412 pixmap2 = (Pixmap) tool->GetBitmap2().GetPixmap();
413 }
414 else
415 {
416 pixmap2 = (Pixmap) bmp.GetArmPixmap(button);
417
418 }
982b2cfc
VZ
419
420 tool->SetPixmap(pixmap2);
421
8a0681f9
VZ
422 // Normal button
423 XtVaSetValues(button,
424 XmNlabelPixmap, pixmap,
425 XmNlabelInsensitivePixmap, insensPixmap,
426 XmNarmPixmap, pixmap2,
427 NULL);
428 }
982b2cfc 429
8a0681f9 430 XtManageChild(button);
7fe7d506 431
8a0681f9
VZ
432 {
433 Dimension width, height;
434 XtVaGetValues(button,
435 XmNwidth, &width,
436 XmNheight, & height,
437 NULL);
438 currentX += width + marginX;
439 buttonHeight = wxMax(buttonHeight, height);
7fe7d506 440 }
8a0681f9
VZ
441
442 XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask,
443 False, wxToolButtonPopupCallback, (XtPointer) this);
444
445 currentSpacing = 0;
446 break;
7fe7d506 447 }
8a0681f9
VZ
448
449 node = node->GetNext();
7fe7d506
JS
450 }
451
452 SetSize(-1, -1, currentX, buttonHeight + 2*marginY);
453
454 return TRUE;
455}
456
982b2cfc
VZ
457wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x),
458 wxCoord WXUNUSED(y)) const
4bb6408c 459{
8a0681f9 460 wxFAIL_MSG( _T("TODO") );
4b5f3fe6 461
982b2cfc 462 return (wxToolBarToolBase *)NULL;
4bb6408c
JS
463}
464
982b2cfc 465bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
4bb6408c 466{
8a0681f9 467 tool->Attach(this);
4bb6408c 468
8a0681f9 469 return TRUE;
4bb6408c
JS
470}
471
982b2cfc 472bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
4bb6408c 473{
8a0681f9 474 tool->Detach();
0d57be45 475
8a0681f9 476 return TRUE;
4bb6408c
JS
477}
478
982b2cfc 479void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable)
1a3ac83f 480{
982b2cfc
VZ
481 wxToolBarTool *tool = (wxToolBarTool *)toolBase;
482
8a0681f9 483 XtSetSensitive(tool->GetButtonWidget(), (Boolean) enable);
1a3ac83f
JS
484}
485
982b2cfc 486void wxToolBar::DoToggleTool(wxToolBarToolBase *toolBase, bool toggle)
4bb6408c 487{
982b2cfc
VZ
488 wxToolBarTool *tool = (wxToolBarTool *)toolBase;
489
8a0681f9 490 XmToggleButtonSetState(tool->GetButtonWidget(), (Boolean) toggle, False);
4bb6408c
JS
491}
492
982b2cfc
VZ
493void wxToolBar::DoSetToggle(wxToolBarToolBase * WXUNUSED(tool),
494 bool WXUNUSED(toggle))
1a3ac83f 495{
982b2cfc 496 // nothing to do
1a3ac83f
JS
497}
498
8a0681f9
VZ
499// ----------------------------------------------------------------------------
500// Motif callbacks
501// ----------------------------------------------------------------------------
1a3ac83f 502
982b2cfc 503wxToolBarToolBase *wxToolBar::FindToolByWidget(WXWidget w) const
7fe7d506 504{
8a0681f9
VZ
505 wxToolBarToolsList::Node* node = m_tools.GetFirst();
506 while ( node )
507 {
508 wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
509 if ( tool->GetButtonWidget() == w)
510 {
511 return tool;
512 }
7fe7d506 513
8a0681f9
VZ
514 node = node->GetNext();
515 }
7fe7d506 516
982b2cfc 517 return (wxToolBarToolBase *)NULL;
7fe7d506
JS
518}
519
8a0681f9
VZ
520static void wxToolButtonCallback(Widget w,
521 XtPointer clientData,
522 XtPointer WXUNUSED(ptr))
1a3ac83f
JS
523{
524 wxToolBar *toolBar = (wxToolBar *) clientData;
982b2cfc 525 wxToolBarToolBase *tool = toolBar->FindToolByWidget((WXWidget) w);
8a0681f9
VZ
526 if ( !tool )
527 return;
1a3ac83f 528
8a0681f9
VZ
529 if ( tool->CanBeToggled() )
530 tool->Toggle();
531
532 if ( !toolBar->OnLeftClick(tool->GetId(), tool->IsToggled()) )
1a3ac83f 533 {
8a0681f9
VZ
534 // revert
535 tool->Toggle();
1a3ac83f 536 }
1a3ac83f
JS
537}
538
1a3ac83f 539
8a0681f9
VZ
540static void wxToolButtonPopupCallback(Widget w,
541 XtPointer client_data,
542 XEvent *event,
543 Boolean *WXUNUSED(continue_to_dispatch))
1a3ac83f
JS
544{
545 // TODO: retrieve delay before popping up tooltip from wxSystemSettings.
8a0681f9 546 static const int delayMilli = 800;
1a3ac83f 547
8a0681f9 548 wxToolBar* toolBar = (wxToolBar*) client_data;
982b2cfc 549 wxToolBarToolBase *tool = toolBar->FindToolByWidget((WXWidget) w);
1a3ac83f 550
8a0681f9
VZ
551 if ( !tool )
552 return;
1a3ac83f 553
8a0681f9
VZ
554 wxString tooltip = tool->GetShortHelp();
555 if ( !tooltip )
556 return;
1a3ac83f 557
8a0681f9
VZ
558 if (!wxTheToolBarTimer)
559 wxTheToolBarTimer = new wxToolBarTimer;
1a3ac83f 560
8a0681f9
VZ
561 wxToolBarTimer::buttonWidget = w;
562 wxToolBarTimer::helpString = tooltip;
1a3ac83f
JS
563
564 /************************************************************/
565 /* Popup help label */
566 /************************************************************/
567 if (event->type == EnterNotify)
568 {
569 if (wxToolBarTimer::help_popup != (Widget) 0)
570 {
571 XtDestroyWidget (wxToolBarTimer::help_popup);
572 XtPopdown (wxToolBarTimer::help_popup);
bf6c2b35 573 }
1a3ac83f
JS
574 wxToolBarTimer::help_popup = (Widget) 0;
575
576 // One shot
577 wxTheToolBarTimer->Start(delayMilli, TRUE);
578
579 }
580 /************************************************************/
581 /* Popdown help label */
582 /************************************************************/
583 else if (event->type == LeaveNotify)
584 {
585 if (wxTheToolBarTimer)
586 wxTheToolBarTimer->Stop();
587 if (wxToolBarTimer::help_popup != (Widget) 0)
588 {
589 XtDestroyWidget (wxToolBarTimer::help_popup);
590 XtPopdown (wxToolBarTimer::help_popup);
bf6c2b35 591 }
1a3ac83f
JS
592 wxToolBarTimer::help_popup = (Widget) 0;
593 }
1a3ac83f
JS
594}
595
596void wxToolBarTimer::Notify()
597{
598 Position x, y;
599
600 /************************************************************/
601 /* Create shell without window decorations */
602 /************************************************************/
bf6c2b35
VZ
603 help_popup = XtVaCreatePopupShell ("shell",
604 overrideShellWidgetClass, (Widget) wxTheApp->GetTopLevelWidget(),
1a3ac83f
JS
605 NULL);
606
607 /************************************************************/
608 /* Get absolute position on display of toolbar button */
609 /************************************************************/
610 XtTranslateCoords (buttonWidget,
bf6c2b35
VZ
611 (Position) 0,
612 (Position) 0,
1a3ac83f
JS
613 &x, &y);
614
615 // Move the tooltip more or less above the button
616 int yOffset = 20; // TODO: What should be really?
617 y -= yOffset;
618 if (y < yOffset) y = 0;
619
620 /************************************************************/
621 /* Set the position of the help popup */
622 /************************************************************/
bf6c2b35
VZ
623 XtVaSetValues (help_popup,
624 XmNx, (Position) x,
625 XmNy, (Position) y,
1a3ac83f 626 NULL);
bf6c2b35 627
1a3ac83f
JS
628 /************************************************************/
629 /* Create help label */
630 /************************************************************/
631 XmString text = XmStringCreateSimple ((char*) (const char*) helpString);
bf6c2b35
VZ
632 XtVaCreateManagedWidget ("help_label",
633 xmLabelWidgetClass, help_popup,
1a3ac83f 634 XmNlabelString, text,
bf6c2b35
VZ
635 XtVaTypedArg,
636 XmNforeground, XtRString, "black",
637 strlen("black")+1,
638 XtVaTypedArg,
639 XmNbackground, XtRString, "LightGoldenrod",
640 strlen("LightGoldenrod")+1,
1a3ac83f
JS
641 NULL);
642 XmStringFree (text);
643
644 /************************************************************/
645 /* Popup help label */
646 /************************************************************/
647 XtPopup (help_popup, XtGrabNone);
648}
649