🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sgi.graphics
Article #40

Re: motif convenience functions

#40
From: Mike Yang
Date: Fri, 01 Jan 1993 18:54
36 lines
1790 bytes
In article <1993Jan1.161847.2266@vela.acs.oakland.edu> sglanger@vela.acs.oakland.edu (LANGER STEVEN C) writes:
>When using functions like
>	dialog = XmCreateMessageDialog(parent, "my_dialog", NULL, 0);
>
>why does the dialog always come up with the title bar
>		"my_dialog_popup"
>
>I can override this from an app-defaults file, but I'd like to just do
>it in the code.

The title bar is controlled by the XmNdialogTitle resource of
MessageBox.  Note also that XmNdialogTitle has type XmString, not
String, so you can't just pass a (char *).  App-defaults files work
because of the type converter which converts a (char *) to a XmString.
XtSetValues requires you to pass the correct type.

>I've tried
>	XtVaSetValues (dialog, XmNlabelString, "my_dialog", NULL);
>
>and XtVaSetValues (dialog, XmNlabelType, "my_dialog", NULL);

XmNlabelString and XmNlabelType are not resources of the MessageBox.

You need to do something like:

	{
	  XmString xs;

	  xs = XmStringCreateSimple("my_dialog");
	  XtVaSetValues(dialog, XmNdialogTitle, xs, NULL);
	  XmStringFree(xs);
	}

-----------------------------------------------------------------------
                 Mike Yang        Silicon Graphics, Inc.
               mikey@sgi.com           415/390-1786
Technical Details
Message-ID: <1993Jan1.185456.16304@odin.corp.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!sgi!odin!mikey
References: <1993Jan1.161847.2266@vela.acs.oakland.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.sgi.graphics
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!sgi!odin!mikey
From: mikey@sgi.com (Mike Yang)
Subject: Re: motif convenience functions
Message-ID: <1993Jan1.185456.16304@odin.corp.sgi.com>
Sender: news@odin.corp.sgi.com (Net News)
Nntp-Posting-Host: eukanuba.wpd.sgi.com
Organization: Silicon Graphics, Inc.
References: <1993Jan1.161847.2266@vela.acs.oakland.edu>
Distribution: na
Date: Fri, 1 Jan 1993 18:54:56 GMT
Lines: 37