Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!umn-d-ub!umn-cs!kulkarni From: kulkarni@umn-cs.CS.UMN.EDU (Srinivas R. Kulkarni) Newsgroups: comp.windows.x Subject: Scrolling a spreadsheet inside a Viewport Message-ID: <15318@umn-cs.CS.UMN.EDU> Date: 18 Aug 89 23:52:04 GMT Distribution: usa Organization: University of Minnesota, Minneapolis Lines: 62 I am developing a small spreadsheet sort of application using Xaw. I am using X11R3. Since I want the spreadsheet to scroll both horizontally and vertically, I have implemented the spreadsheet canvas as the child of a viewport widget. concise problem description: ^^^^^^^^^^^^^^^^^^^^^^^^^^ I want Column titles on the top row and Row titles in the leftmost column of my spreadsheet. The Column titles scroll ONLY horizontally and similarly the Row titles scroll ONLY vertically. That is the problem. I am not quite sure if (and how) I can achieve such 'partial' scrolling. a few things I tried: ^^^^^^^^^^^^^^^^^^^^^ I thought of using label widgets for the Column titles and making them the children of the Viewport's horizontall scroll bar using XtNameToWidget(viewport, "horizontal") but that's out of question since a scrollbar/viewport widget can have only child. So I created a form widget as the child of my viewport widget and made the canvas and the column/row label widgets the child of my form widget. But now, as expected, the whole form widget i.e ALL its children scroll. I somehow need to stop ( can i do this?) the vertical scroll bar from scrolling Column label widgets and vice versa for the Row label widgets. Is there a better design? Would using two Scrollbar widgets help? If so, how can I do that? Also, can I scroll in units of CELL_HEIGHT(vertically) and CELL_WIDTH(horizontally) by 'intercepting' the values passed to ScrollUpDownProc? Please help. Thanks in advance. Please e-mail me directly. Srinivas R. Kulkarni kulkarni@umn-cs.cs.umn.edu (612) 341-2921 (home)