Thread View: comp.sys.sgi.graphics
3 messages
3 total messages
Started by LANGER STEVEN C
Fri, 01 Jan 1993 16:18
motif convenience functions
Author: LANGER STEVEN C
Date: Fri, 01 Jan 1993 16:18
Date: Fri, 01 Jan 1993 16:18
30 lines
1687 bytes
1687 bytes
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. I've tried XtVaSetValues (dialog, XmNlabelString, "my_dialog", NULL); and XtVaSetValues (dialog, XmNlabelType, "my_dialog", NULL); but the title bar always has _popup appended to it. XtCreateManagedWidget does not do this, but is not as conveneient. Any suggestions? --thanks in advance, steve -- Steve Langer sglanger@argo.acs.oakland.edu (VMS) Oakland University sglanger@vela.acs.oakland.edu (Ultrix) --------------------------------------------------------------------------- Standard disclaimers apply. In addition, the author makes no guarantees, concerning the grammatical accuracy of his writing. Therefore, any ^B's, ^C's, midword character additions/deletions and other non-sense which occurs (after the work leaves the author's decade old text editor via his decade old Amiga, struggles through a local 1200 baud Merit server to be further mauled via the remote VAX mail servers) is someone elses problem - namely yours. ---------------------------------------------------------------------------
Re: motif convenience functions
Author: Mike Yang
Date: Fri, 01 Jan 1993 18:54
Date: Fri, 01 Jan 1993 18:54
36 lines
1790 bytes
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
Re: motif convenience functions
Author: Bob Blean
Date: Tue, 05 Jan 1993 02:13
Date: Tue, 05 Jan 1993 02:13
40 lines
2042 bytes
2042 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. I've tried |> XtVaSetValues (dialog, XmNlabelString, "my_dialog", NULL); |> |> and XtVaSetValues (dialog, XmNlabelType, "my_dialog", NULL); |> |> but the title bar always has _popup appended to it. |> XtCreateManagedWidget does not do this, but is not as conveneient. |> Any suggestions? The convenience function XmCreateMessageDialog() creates a DialogShell (named my_dialog_popup), with a MessageBox child (named my_dialog). The widget ID of the Message Box is returned to you. The title you see is is the name of the Dialog Shell unless you set the dialog shell's title. * setting the app-default file provides a title for the Dialog Shell * Doing SetValues on the Message box does not. Doing it on XtParent(dialog) should. * Passing an arg list to the XmCreateMessageDialog call would work, because these args are also passed along to the Dialog Shell when it is created. XtCreateManagedWidget works differently because, unlike the convenience function, it is not creating a dialog shell behind your back. I seem to recall that this is all explained in some manual, but I could not quickly locate it. --Bob
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads