r table widget causing trouble with xtquerygeometry contents problems with table widgets in r the following part of a program an user interface for a simulation system did work in r but refused to in r of cause the r version did not know about the xptablewidgetclass we used tablewidgetclass instead caught from the net in times of r and xptablechildposition formerly xttblposition since compiling with r the program causes a zero width or height error on sparc stations the trouble shooter is the re computation of the model init table table widget though its childs label and asciitext widgets exist xtquerygeometry returns a prefered width and height of zero thus the following asignment cannot perform anything else but set the width and height of the newly created widget to zero no wonder xtpopup or xtmanage child create zero width or height errors dependent on whether width and height of the shell widget are set in the resource file or not question does anyone know why xtquerygeometry returns so low prefered values when working on table widgets or perhaps what to do about i ll be happy if someone is able to help me germans are requested to answer in german siegfried kaiser email kaiser uniko uni koblenz de the part of interest graphischer neuaufbau des model init formulars storing the old width and height of the viewport widget which is the parent of the troubling table widget before the viewport widget is destroyed the destroying of widgets before resizing them is a relict from r age if model init popped up xtunmapwidget model init form view xtdestroywidget model init form view creating the subtree within the shell of which the root is the viewport widget n xtsetarg args n xtnfromvert model init title n xtsetarg args n xtnfromhoriz model init button view n xtsetarg args n xtnallowvert true n xtsetarg args n xtnforcebars true n model init form view xtcreatewidget form view viewportwidgetclass model init form args n n model init table xtcreatewidget table xptablewidgetclass model init form view args n create form widget does create and position table widget s childs to position them it uses xptable childposition in r and xttblposition in r create form widget ptr model init obj model init table the crucial function call intended to return the maximum height possible if there isn t sufficient space to show the whole table widget then the viewport shall grow as large as possible but not beyond the border of screen if there is enough space the window is intended to shrienk to the smallest possible height xtquerygeometry model init table null pref according to the algorithms idea the new value of viewport widget s height is selected unfortunately pref height leads to new height if form view height pref height new height pref height else new height form view height setting the new values to viewport widgets ancestors w xtnametowidget model init form form view xtresizewidget w width new height pref border width xtresizewidget model init form view width new height pref border width if model init popped up in case the shell which contains model init form view and model init table allready exists is has to be resized too n xtsetarg args n xtnwidth shell width n xtsetarg args n xtnheight shell height n xtsetarg args n xtnborderwidth shell bw n xtgetvalues model init shell args n xtresizewidget model init shell shell width shell height height new height shell bw end of if n xtsetarg args n xtnwidth width n xtsetarg args n xtnborderwidth bw n xtgetvalues model init button view args n xtresizewidget model init button view width new height bw xtresizewidget vert bar sbar width sbar bw resize inits if there is the shell s height set within the resource file the program terminates within the first xtmanagechild on its second pass through the observed function the first pass succeeds xtmanagechild model init form view xtmanagechild model init table if model init popped up in case the shell isn t popped up it has to be done if there is no value set to the shell s height within the resource file the program terminates here xtpopup model init shell xtgrabnone model init pop flag true set model init attributes end of if get actual init ptr actual load form ptr actual if someone suspects the creation of table widget s contents causes all the trouble there are the sources of create form create form widget ptr table t obj ptr widget table ptr is a linear list containing attributes and para meters of the model and additionally the correspon ding widgets arg args int n row col t obj ptr obj t ident ptr ident initialization of the local variables ptr obj ptr col row schleife ueber die objekte bzw das pseudo objekt fuer die parameter loop through the list of objects and pseudo objects every object occuring in the model has zero or more attributes and some parameters which can be shared by several objects because of locality the attributes of one object are listed in a second linear list of type t ident whereas the parameters which can belong to any ob ject are put together in a pseudo object thus the program loops through the list of objects and pseudo objects and for each object through the list of its attributes resp parameters while ptr obj t obj null each object and pseudo object is represented in a label widget n xtsetarg args n xtnlabel ptr obj name n ptr obj label w xtcreatemanagedwidget object labelwidgetclass table args n xptablechildposition ptr obj label w col row col row ptr ident ptr obj ident schleife ueber die objekt attribute bzw parameter while ptr ident t ident null each attribute and parameter is represented in a label and has a corresponding asciitext widget in which it is to be initialized n xtsetarg args n xtnlabel ptr ident name n ptr ident label w xtcreatemanagedwidget ident labelwidgetclass table args n xptablechildposition ptr ident label w col row col n xtsetarg args n xtnlength row length n xtsetarg args n xtnstring ptr ident text n xtsetarg args n xtnedittype xawtextedit n xtsetarg args n xtnwrap xawtextwrapword n xtsetarg args n xtnresize xawtextresizeheight n xtsetarg args n xtnusestringinplace true n ptr ident text w xtcreatemanagedwidget text asciitextwidgetclass table args n xptablechildposition ptr ident text w col row col row get next ident ptr ident end of while col get next obj ptr obj end of while end of create form widget so far the problem in detail
