Re: How can I get my XmContainer widget to scroll? - Motif

This is a discussion on Re: How can I get my XmContainer widget to scroll? - Motif ; "Fred L. Kleinschmidt" wrote in message news: ... > Julie S wrote: > > > > I have an XmPanedWindow that contains an XmForm that contains an > > XmContainer widget, which contains several icon gadgets. This works > > ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Re: How can I get my XmContainer widget to scroll?

  1. Re: How can I get my XmContainer widget to scroll?

    "Fred L. Kleinschmidt" wrote in message news:<3F4FC2B1.E619250D@boeing.com>...
    > Julie S wrote:
    > >
    > > I have an XmPanedWindow that contains an XmForm that contains an
    > > XmContainer widget, which contains several icon gadgets. This works
    > > great unless there are too many icons to display in the pane. The
    > > pane can be resized but often not enough to show all the icons.
    > >
    > > So I am trying to make the XmContainer widget scrollable. To do this,
    > > I kept my XmPanedWindow and its child the XmForm widget but then
    > > created an XmScrollingWindow widget as a child of the form. I then
    > > create the XmContainer as a child of the scrolling window. My problem
    > > is, my icon gadgets (still children of the XmContainer) have stopped
    > > being displayed.
    > >
    > > They still exist, I can access them from my program and get their
    > > settings, but they do now appear on the screen.
    > >
    > > Does anybody have any suggestions for me for how to get my container
    > > to scroll? I have searched the Motif FAQ and the MotifZone website
    > > but haven't found anything like this.
    > >
    > > I would sincerely appreciate any advice.
    > > Thank you!
    > > Julie

    >
    > Seems like the Form is extraneous - make the ScrolledWindow the child of
    > the Pane.
    >
    > After you create the XmContainer as the child of the ScrolledWindow,
    > check the ScrolledWindow's XmNworkWindow and see if it is indeed the
    > XmContainer. if not, use SetValues to set it to the container.


    Thank you so much, Fred. Once again you've solved my problem. I
    really appreciate your expertise.

    I have one question, though, now that I am able to see my icon gadgets
    getting adding to my container widget. Before when I had an XmPane
    containing an XmForm, containing an XmContainer, when I added icon
    gadgets to the window, they were added horizontally until reaching the
    right-most border of the container, then they "wrapped" - starting
    another row. For example, if my container was wide enough to fit 8
    icons per row, I'd see 15 icons as:
    X X X X X X X X
    X X X X X X X

    Now for some reason, when I add icon gadgets to my container, they
    seem to want to have an equal number of rows and columns, and icons
    are being added in a box shape. For example, 15 icons are displayed
    as:
    X X X X
    X X X X
    X X X X
    X X X

    Is there any way that you know of to solve this problem? THANK YOU!!!

    Julie

  2. Re: How can I get my XmContainer widget to scroll?



    Julie S wrote:
    >
    > "Fred L. Kleinschmidt" wrote in message news:<3F4FC2B1.E619250D@boeing.com>...
    > > Julie S wrote:
    > > >
    > > > I have an XmPanedWindow that contains an XmForm that contains an
    > > > XmContainer widget, which contains several icon gadgets. This works
    > > > great unless there are too many icons to display in the pane. The
    > > > pane can be resized but often not enough to show all the icons.
    > > >
    > > > So I am trying to make the XmContainer widget scrollable. To do this,
    > > > I kept my XmPanedWindow and its child the XmForm widget but then
    > > > created an XmScrollingWindow widget as a child of the form. I then
    > > > create the XmContainer as a child of the scrolling window. My problem
    > > > is, my icon gadgets (still children of the XmContainer) have stopped
    > > > being displayed.
    > > >
    > > > They still exist, I can access them from my program and get their
    > > > settings, but they do now appear on the screen.
    > > >
    > > > Does anybody have any suggestions for me for how to get my container
    > > > to scroll? I have searched the Motif FAQ and the MotifZone website
    > > > but haven't found anything like this.
    > > >
    > > > I would sincerely appreciate any advice.
    > > > Thank you!
    > > > Julie

    > >
    > > Seems like the Form is extraneous - make the ScrolledWindow the child of
    > > the Pane.
    > >
    > > After you create the XmContainer as the child of the ScrolledWindow,
    > > check the ScrolledWindow's XmNworkWindow and see if it is indeed the
    > > XmContainer. if not, use SetValues to set it to the container.

    >
    > Thank you so much, Fred. Once again you've solved my problem. I
    > really appreciate your expertise.
    >
    > I have one question, though, now that I am able to see my icon gadgets
    > getting adding to my container widget. Before when I had an XmPane
    > containing an XmForm, containing an XmContainer, when I added icon
    > gadgets to the window, they were added horizontally until reaching the
    > right-most border of the container, then they "wrapped" - starting
    > another row. For example, if my container was wide enough to fit 8
    > icons per row, I'd see 15 icons as:
    > X X X X X X X X
    > X X X X X X X
    >
    > Now for some reason, when I add icon gadgets to my container, they
    > seem to want to have an equal number of rows and columns, and icons
    > are being added in a box shape. For example, 15 icons are displayed
    > as:
    > X X X X
    > X X X X
    > X X X X
    > X X X
    >
    > Is there any way that you know of to solve this problem? THANK YOU!!!
    >
    > Julie


    try setting XmNspatialResizeModel to XmGROW_MAJOR (assuming
    layoutDirection is Horizontal).
    --
    Fred L. Kleinschmidt
    Associate Technical Fellow
    Boeing Common User Interface Services

  3. Re: How can I get my XmContainer widget to scroll?

    "Fred L. Kleinschmidt" wrote in message news:<3F563FA8.8A8CA68B@boeing.com>...
    > Julie S wrote:
    > >
    > > "Fred L. Kleinschmidt" wrote in message news:<3F4FC2B1.E619250D@boeing.com>...
    > > > Julie S wrote:
    > > > >
    > > > > I have an XmPanedWindow that contains an XmForm that contains an
    > > > > XmContainer widget, which contains several icon gadgets. This works
    > > > > great unless there are too many icons to display in the pane. The
    > > > > pane can be resized but often not enough to show all the icons.
    > > > >
    > > > > So I am trying to make the XmContainer widget scrollable. To do this,
    > > > > I kept my XmPanedWindow and its child the XmForm widget but then
    > > > > created an XmScrollingWindow widget as a child of the form. I then
    > > > > create the XmContainer as a child of the scrolling window. My problem
    > > > > is, my icon gadgets (still children of the XmContainer) have stopped
    > > > > being displayed.
    > > > >
    > > > > They still exist, I can access them from my program and get their
    > > > > settings, but they do now appear on the screen.
    > > > >
    > > > > Does anybody have any suggestions for me for how to get my container
    > > > > to scroll? I have searched the Motif FAQ and the MotifZone website
    > > > > but haven't found anything like this.
    > > > >
    > > > > I would sincerely appreciate any advice.
    > > > > Thank you!
    > > > > Julie
    > > >
    > > > Seems like the Form is extraneous - make the ScrolledWindow the child of
    > > > the Pane.
    > > >
    > > > After you create the XmContainer as the child of the ScrolledWindow,
    > > > check the ScrolledWindow's XmNworkWindow and see if it is indeed the
    > > > XmContainer. if not, use SetValues to set it to the container.

    > >
    > > Thank you so much, Fred. Once again you've solved my problem. I
    > > really appreciate your expertise.
    > >
    > > I have one question, though, now that I am able to see my icon gadgets
    > > getting adding to my container widget. Before when I had an XmPane
    > > containing an XmForm, containing an XmContainer, when I added icon
    > > gadgets to the window, they were added horizontally until reaching the
    > > right-most border of the container, then they "wrapped" - starting
    > > another row. For example, if my container was wide enough to fit 8
    > > icons per row, I'd see 15 icons as:
    > > X X X X X X X X
    > > X X X X X X X
    > >
    > > Now for some reason, when I add icon gadgets to my container, they
    > > seem to want to have an equal number of rows and columns, and icons
    > > are being added in a box shape. For example, 15 icons are displayed
    > > as:
    > > X X X X
    > > X X X X
    > > X X X X
    > > X X X
    > >
    > > Is there any way that you know of to solve this problem? THANK YOU!!!
    > >
    > > Julie

    >
    > try setting XmNspatialResizeModel to XmGROW_MAJOR (assuming
    > layoutDirection is Horizontal).



    Thanks for the tip.
    I just checked and I have XmNspatialResizeModel set to XmGROW_MAJOR
    and XmNlayoutDirection set to XmLEFT_TO_RIGHT (see below). I just
    can't seem to get my icons to grow by rows - they seem to position
    themselves to have an equal number of rows and columns, which causes
    the icons to not all be displayed simultaneously since the window and
    screen aren't big enough. My dilemma is that these icons are for air
    traffic controller workstations and need to be visible all at once.
    There's so much room left over on the right side of each row of icons,
    but the widget wants to keep adding new rows instead of adding columns
    to the existing rows. Are there any other resources that look suspect
    to you?
    Thank you again very much for your help.

    ac = 0;
    XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
    XtSetArg(args[ac], XmNspatialStyle, XmCELLS); ac++;
    XtSetArg(args[ac], XmNspatialIncludeModel, XmFIRST_FIT); ac++;
    XtSetArg(args[ac], XmNspatialResizeModel, XmGROW_MAJOR); ac++;
    XtSetArg(args[ac], XmNspatialSnapModel, XmSNAP_TO_GRID); ac++;

    XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
    XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    icon_container = (Widget)XmCreateContainer(parent,
    "icon_container", args, ac);
    XtVaSetValues(icon_container,
    XmNlargeCellWidth, 50,
    XmNlargeCellHeight, 80,
    XmNentryViewType, XmLARGE_ICON,
    XmNmarginHeight, 10,
    XmNmarginWidth, 10,
    XmNselectionPolicy, XmMULTIPLE_SELECT,
    XmNautomaticSelection, XmNO_AUTO_SELECT,
    NULL);

    Julie

  4. Re: How can I get my XmContainer widget to scroll?



    Julie S wrote:
    >
    > "Fred L. Kleinschmidt" wrote in message news:<3F563FA8.8A8CA68B@boeing.com>...
    > > Julie S wrote:
    > > >
    > > > "Fred L. Kleinschmidt" wrote in message news:<3F4FC2B1.E619250D@boeing.com>...
    > > > > Julie S wrote:
    > > > > >
    > > > > > I have an XmPanedWindow that contains an XmForm that contains an
    > > > > > XmContainer widget, which contains several icon gadgets. This works
    > > > > > great unless there are too many icons to display in the pane. The
    > > > > > pane can be resized but often not enough to show all the icons.
    > > > > >
    > > > > > So I am trying to make the XmContainer widget scrollable. To do this,
    > > > > > I kept my XmPanedWindow and its child the XmForm widget but then
    > > > > > created an XmScrollingWindow widget as a child of the form. I then
    > > > > > create the XmContainer as a child of the scrolling window. My problem
    > > > > > is, my icon gadgets (still children of the XmContainer) have stopped
    > > > > > being displayed.
    > > > > >
    > > > > > They still exist, I can access them from my program and get their
    > > > > > settings, but they do now appear on the screen.
    > > > > >
    > > > > > Does anybody have any suggestions for me for how to get my container
    > > > > > to scroll? I have searched the Motif FAQ and the MotifZone website
    > > > > > but haven't found anything like this.
    > > > > >
    > > > > > I would sincerely appreciate any advice.
    > > > > > Thank you!
    > > > > > Julie
    > > > >
    > > > > Seems like the Form is extraneous - make the ScrolledWindow the child of
    > > > > the Pane.
    > > > >
    > > > > After you create the XmContainer as the child of the ScrolledWindow,
    > > > > check the ScrolledWindow's XmNworkWindow and see if it is indeed the
    > > > > XmContainer. if not, use SetValues to set it to the container.
    > > >
    > > > Thank you so much, Fred. Once again you've solved my problem. I
    > > > really appreciate your expertise.
    > > >
    > > > I have one question, though, now that I am able to see my icon gadgets
    > > > getting adding to my container widget. Before when I had an XmPane
    > > > containing an XmForm, containing an XmContainer, when I added icon
    > > > gadgets to the window, they were added horizontally until reaching the
    > > > right-most border of the container, then they "wrapped" - starting
    > > > another row. For example, if my container was wide enough to fit 8
    > > > icons per row, I'd see 15 icons as:
    > > > X X X X X X X X
    > > > X X X X X X X
    > > >
    > > > Now for some reason, when I add icon gadgets to my container, they
    > > > seem to want to have an equal number of rows and columns, and icons
    > > > are being added in a box shape. For example, 15 icons are displayed
    > > > as:
    > > > X X X X
    > > > X X X X
    > > > X X X X
    > > > X X X
    > > >
    > > > Is there any way that you know of to solve this problem? THANK YOU!!!
    > > >
    > > > Julie

    > >
    > > try setting XmNspatialResizeModel to XmGROW_MAJOR (assuming
    > > layoutDirection is Horizontal).

    >
    > Thanks for the tip.
    > I just checked and I have XmNspatialResizeModel set to XmGROW_MAJOR
    > and XmNlayoutDirection set to XmLEFT_TO_RIGHT (see below). I just
    > can't seem to get my icons to grow by rows - they seem to position
    > themselves to have an equal number of rows and columns, which causes
    > the icons to not all be displayed simultaneously since the window and
    > screen aren't big enough. My dilemma is that these icons are for air
    > traffic controller workstations and need to be visible all at once.
    > There's so much room left over on the right side of each row of icons,
    > but the widget wants to keep adding new rows instead of adding columns
    > to the existing rows. Are there any other resources that look suspect
    > to you?
    > Thank you again very much for your help.
    >
    > ac = 0;
    > XtSetArg(args[ac], XmNlayoutDirection, XmLEFT_TO_RIGHT); ac++;
    > XtSetArg(args[ac], XmNspatialStyle, XmCELLS); ac++;
    > XtSetArg(args[ac], XmNspatialIncludeModel, XmFIRST_FIT); ac++;
    > XtSetArg(args[ac], XmNspatialResizeModel, XmGROW_MAJOR); ac++;
    > XtSetArg(args[ac], XmNspatialSnapModel, XmSNAP_TO_GRID); ac++;
    >
    > XtSetArg(args[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
    > XtSetArg(args[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
    > XtSetArg(args[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
    > XtSetArg(args[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
    > XtSetArg(args[ac], XmNleftOffset, 0); ac++;
    > XtSetArg(args[ac], XmNrightOffset, 0); ac++;
    > XtSetArg(args[ac], XmNtopOffset, 0); ac++;
    > XtSetArg(args[ac], XmNbottomOffset, 0); ac++;
    > icon_container = (Widget)XmCreateContainer(parent,
    > "icon_container", args, ac);
    > XtVaSetValues(icon_container,
    > XmNlargeCellWidth, 50,
    > XmNlargeCellHeight, 80,
    > XmNentryViewType, XmLARGE_ICON,
    > XmNmarginHeight, 10,
    > XmNmarginWidth, 10,
    > XmNselectionPolicy, XmMULTIPLE_SELECT,
    > XmNautomaticSelection, XmNO_AUTO_SELECT,
    > NULL);
    >
    > Julie


    If you are placing the container widget in a scrolled window, you may
    have trouble positioning the children as you want them. If you use
    GROW_MAJOR, the container will tell its parent that it wants to be
    wider; the scrolled window just says "sure, be as wide as you want -
    I'll just adjust the horizontal scrollbar". Similarly with GROW_MINOR.
    And GROW_BALANCED tries to place the children as square as possible.


    --
    Fred L. Kleinschmidt
    Associate Technical Fellow
    Boeing Common User Interface Services

+ Reply to Thread