Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!rose.cis.ohio-state.edu!cso From: cso@rose.cis.ohio-state.edu (Dr. Conleth S. O'Connell Jr.) Newsgroups: comp.windows.x Subject: Resetting fromHoriz or fromVert resources Keywords: Form widget Message-ID: <84330@tut.cis.ohio-state.edu> Date: 3 Oct 90 15:27:25 GMT Sender: news@tut.cis.ohio-state.edu Reply-To: Dr. Conleth S. O'Connell Jr. Organization: Ohio State University Computer and Information Science Lines: 82 Hi there. I am basically trying to display an organizational-chart type of tree with label widgets containing strings connected by lines that show their dependencies. I have the line drawing stuff working just fine. I have 2 problems with the following scenario: The label widgets are placed in a form widget inside of a viewport widget inside of a toplevelShell widget. After the descriptions, I'll include the declarations of the resources for these widgets. When I first create/place a label widget, everything works okay, i.e., the scrollbars are correct. However, I am pretty printing the tree, e.g., root | ----------------------------- | | | child1 child2 child3 | ----------- | | child2.1 child2.2 Pretty printing takes place as such for child2.1 for example: I want to place myself relative to the rightmost widget that I've seen so far (in a postfix traversal), in this case - child1. I get the x and width values of child1 I get the x value of child2.1 if I need to change the x value of child2.1, I make it 10 pixels + the x and width values of child1. I move the child2.1 widget with XtMoveWidget. What I want to do is just reset the fromHoriz resource, but nothing happens when I do this. Any ideas? ANyway, because I am using XtMoveWidget one of two (or both) problems occur: 1) The scrollbars no longer display the correct percentage nor allow the user to get to the far right items, but they do before the pretty printing occurs. 2) The form widget is not resizing correctly because the resources of the children are not quite right, i.e., the fromHoriz resource. I've tried lots of combinations but nothing seems to quite work. Here are the resource declarations for everything but the label widgets: cnt = 0; Treeshell = XtAppCreateShell("Navigation_Tree", "tree", topLevelShellWidgetClass, XtDisplay(Toplevel), args, cnt); cnt = 0; XtSetArg(args[cnt], XtNallowHoriz, True); cnt++; XtSetArg(args[cnt], XtNallowVert, True); cnt++; XtSetArg(args[cnt], XtNforceBars, True); cnt++; XtSetArg(args[cnt], XtNwidth, 500); cnt++; XtSetArg(args[cnt], XtNheight, 250); cnt++; treeview = XtCreateManagedWidget("treeview", viewportWidgetClass, Treeshell, args, cnt); cnt = 0; XtSetArg(args[cnt], XtNdefaultDistance, 10); cnt++; treeframe = XtCreateManagedWidget("treeframe", formWidgetClass, treeview, args, cnt); Thanks for any explanation! Con -- Dr. Conleth S. O'Connell Jr. Department of Computer and Information Science The Ohio State University cso@cis.ohio-state.edu 2036 Neil Ave., Columbus, OH USA 43210-1277