Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!lll-winken!unixhub!shelby!msi.umn.edu!sctc.com!pasturel From: pasturel@sctc.com (Pierre Pasturel) Newsgroups: comp.windows.x.motif Subject: Re: Motif 1.0 XmText problem Keywords: XmText, marginHeight resource Message-ID: <1990Nov21.234958.1854@sctc.com> Date: 21 Nov 90 23:49:58 GMT References: <1990Nov20.204225.23831@sctc.com> Distribution: comp.window.x.motif Organization: Secure Computing Technology Corporation Lines: 111 I did a little more investigating. I created an XmText widget, as described in my earlier posting, and after it is managed, I put the following code: #ifdef DEBUG for ( i = 0; i<= 10; i++ ) { XtSetArg (args[0], XmNmarginHeight, i); XtSetValues( LOCKtoTPT_Text, args, 1); printf("XtSetValues set XmNmarginHeight to %d\n",i); XFlush(display_ptr); XtSetArg (args[0], XmNmarginHeight, &margin_height); XtGetValues( LOCKtoTPT_Text, args, 1); printf("XtGetValues retrieved XmNmarginHeight as %d\n",margin_height); } printf("**************\n"); for ( i = 0; i<= 10; i++ ) { XtSetArg (args[0], XmNvalue, "testing 1 2 3" ); XtSetValues( LOCKtoTPT_Text, args, 1); printf("XtSetValues set XmNvalue.\n"); XFlush(display_ptr); XtSetArg (args[0], XmNmarginHeight, &margin_height); XtGetValues( LOCKtoTPT_Text, args, 1); printf("XtGetValues retrieved XmNmarginHeight as %d\n",margin_height); } #endif where LOCKtoTPT_Text is a XmText widget. and I get the following output: XtSetValues set XmNmarginHeight to 0 XtGetValues retrieved XmNmarginHeight as 8 XtSetValues set XmNmarginHeight to 1 XtGetValues retrieved XmNmarginHeight as 9 XtSetValues set XmNmarginHeight to 2 XtGetValues retrieved XmNmarginHeight as 10 XtSetValues set XmNmarginHeight to 3 XtGetValues retrieved XmNmarginHeight as 11 XtSetValues set XmNmarginHeight to 4 XtGetValues retrieved XmNmarginHeight as 12 XtSetValues set XmNmarginHeight to 5 XtGetValues retrieved XmNmarginHeight as 13 XtSetValues set XmNmarginHeight to 6 XtGetValues retrieved XmNmarginHeight as 14 XtSetValues set XmNmarginHeight to 7 XtGetValues retrieved XmNmarginHeight as 15 XtSetValues set XmNmarginHeight to 8 XtGetValues retrieved XmNmarginHeight as 16 XtSetValues set XmNmarginHeight to 9 XtGetValues retrieved XmNmarginHeight as 17 XtSetValues set XmNmarginHeight to 10 XtGetValues retrieved XmNmarginHeight as 18 ************** XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 26 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 34 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 42 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 50 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 58 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 66 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 74 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 82 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 90 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 98 XtSetValues set XmNvalue. XtGetValues retrieved XmNmarginHeight as 106 There seems to be two things going wrong here. First, XtGetValues is retrieving a value 8 bigger than the value set by XtSetValues. But my main conern is in the second loop, where the setting of the XmNValue resource appears to effect the marginHeight value retrieved by XtGetValues(). Funny thing, though, is that there is no effect on the appearence of the XmText widget (i.e., the distance between the top and bottom border of the text widget and the text itself does not reflect the every increasing marginHeight resource value). Seems to me that there is a problem with the X Toolkit XtGetValues?? The only reason that this whole thing is a problem for me is that eventually I get all these X toolkit messages warning me that my margin height has to be >= 0. All these warnings slow down my motif application program simulation and it does not look good. I tried countering this problem by always resetting the marginHeight resource anytime I changed XmNvalue using XtSetValues. But this resulted in the XmText text flickering too much on the screen. Pierre pasturel@sctc.com