home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / graphics / 81 < prev    next >
Encoding:
Text File  |  1993-01-01  |  1.7 KB  |  51 lines

  1. Newsgroups: comp.sys.sgi.graphics
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!sgi!odin!mikey
  3. From: mikey@sgi.com (Mike Yang)
  4. Subject: Re: motif convenience functions
  5. Message-ID: <1993Jan1.185456.16304@odin.corp.sgi.com>
  6. Sender: news@odin.corp.sgi.com (Net News)
  7. Nntp-Posting-Host: eukanuba.wpd.sgi.com
  8. Organization: Silicon Graphics, Inc.
  9. References: <1993Jan1.161847.2266@vela.acs.oakland.edu>
  10. Distribution: na
  11. Date: Fri, 1 Jan 1993 18:54:56 GMT
  12. Lines: 37
  13.  
  14. In article <1993Jan1.161847.2266@vela.acs.oakland.edu> sglanger@vela.acs.oakland.edu (LANGER STEVEN C) writes:
  15. >When using functions like
  16. >    dialog = XmCreateMessageDialog(parent, "my_dialog", NULL, 0);
  17. >
  18. >why does the dialog always come up with the title bar
  19. >        "my_dialog_popup"
  20. >
  21. >I can override this from an app-defaults file, but I'd like to just do
  22. >it in the code.
  23.  
  24. The title bar is controlled by the XmNdialogTitle resource of
  25. MessageBox.  Note also that XmNdialogTitle has type XmString, not
  26. String, so you can't just pass a (char *).  App-defaults files work
  27. because of the type converter which converts a (char *) to a XmString.
  28. XtSetValues requires you to pass the correct type.
  29.  
  30. >I've tried
  31. >    XtVaSetValues (dialog, XmNlabelString, "my_dialog", NULL);
  32. >
  33. >and XtVaSetValues (dialog, XmNlabelType, "my_dialog", NULL);
  34.  
  35. XmNlabelString and XmNlabelType are not resources of the MessageBox.
  36.  
  37. You need to do something like:
  38.  
  39.     {
  40.       XmString xs;
  41.  
  42.       xs = XmStringCreateSimple("my_dialog");
  43.       XtVaSetValues(dialog, XmNdialogTitle, xs, NULL);
  44.       XmStringFree(xs);
  45.     }
  46.  
  47. -----------------------------------------------------------------------
  48.                  Mike Yang        Silicon Graphics, Inc.
  49.                mikey@sgi.com           415/390-1786
  50.  
  51.