home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8155 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.1 KB  |  63 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!ulowell!koverber
  3. From: koverber@cs.ulowell.edu (Kurt Overberg)
  4. Subject: Re: How can I make Drawing Area invisible?
  5. Message-ID: <BzM853.1Gy@ulowell.ulowell.edu>
  6. Originator: koverber@bigmax.ulowell.edu
  7. Sender: usenet@ulowell.ulowell.edu (News manager - ulowell)
  8. Organization: University of Massachusetts at Lowell Computer Science
  9. References:  <TERO.92Dec19203824@vipunen.hut.fi>
  10. Distribution: comp
  11. Date: Mon, 21 Dec 1992 15:24:38 GMT
  12. Lines: 49
  13.  
  14.  
  15.  
  16. 1)  I can't really think of anyway to make a drawing area invisible.
  17.     I have never seen it done, and am not sure it is possible.  If I were
  18.     to guess HOW to do it, perhaps you could hack access to the server's
  19.     backing store pixmap, and figure out which part of that should
  20.     be visible in your window.  In any event, it would probably require
  21.     a lot of very low level X hacking.  Ugh.
  22.  
  23. 2)  All you need is the widget ID of the push button in the menu structure.
  24.     You could either declare it as a global (not a good idea), or use
  25.     XtNameToWidget.  Example: your pushbutton in your menu structure is called
  26.     "RulerOption".  Note: NOT the variable name.  This is the WIDGET name.  It is
  27.     the first parameter in XtVaCreateManagedWidget.  You need to know the Widget ID
  28.     this button's parent.  Example:
  29.  
  30.     {
  31.     Widget localWidgetVariable;
  32.  
  33.     localWidgetVariable = XtVaCreateManagedWidget("RulerHiddenOrShown", 
  34.                                parent_form,    /* parent */
  35.     ...
  36.     ...
  37.     }
  38.  
  39. *now we are in an entirely different part of program where 'localWidgetVariable'
  40. is not visible, but parent_form IS visible*
  41.  
  42.     {
  43.     Widget tmp;
  44.     XmString str;
  45.  
  46.     tmp = XtNameToWidget(parent_form, "RulerHiddenOrShown");
  47.  
  48.     /* now, tmp contains the widget ID of your menu item */
  49.  
  50.     str = XmStringCreateLtoR("Hide Ruler", XmSTRING_DEFAULT_CHARSET);
  51.  
  52.     XtVaSetValues(tmp, 
  53.             XmNlabelString, str, 
  54.             NULL);
  55.     /* This will change the string of our menu item */
  56.      }
  57.     
  58. -- 
  59. Kurt Overberg            | Opinions expressed here are MINE!           
  60. U of Mass, Lowell        | "Poke a double-decker on a Llama taboot,       
  61. koverber@cs.ulowell.edu  |  Llama taboot, taboot!"      -Phish
  62.  
  63.