Adding XmScrolledWindow to an existing application - Motif

This is a discussion on Adding XmScrolledWindow to an existing application - Motif ; Hi, In an existing application, I want to make a window scrollable. The application globally does: wmain = XtAppCreateShell(...); wform = XmCreateFormDialog(wmain, ...); wrow = XmCreateRowColumn(wform, ....); As this window (the one getting all the form elements in its rows) ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Adding XmScrolledWindow to an existing application

  1. Adding XmScrolledWindow to an existing application

    Hi,

    In an existing application, I want to make a window scrollable.
    The application globally does:

    wmain = XtAppCreateShell(...);
    wform = XmCreateFormDialog(wmain, ...);
    wrow = XmCreateRowColumn(wform, ....);

    As this window (the one getting all the form elements in its rows)
    often becomes too large, I need to add scrollbars to it.

    I tried to insert an XmCreateScrolledWindow in the widget creation
    "chain", but that resulted in a window of just a few pixels (while
    I gave a correct height/width to the scrolled window widget).

    Is there sample code showing how to do this or can someone give
    me some hints to solve this?

    Thanks,

    --
    -- Jos Vos
    -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
    -- Amsterdam, The Netherlands | Fax: +31 20 6948204

  2. Re: Adding XmScrolledWindow to an existing application

    Jos Vos wrote:

    > I tried to insert an XmCreateScrolledWindow in the widget creation
    > "chain", but that resulted in a window of just a few pixels (while
    > I gave a correct height/width to the scrolled window widget).


    Sounds like missing form attachments. Presumably, you want the scrolled
    window to track to the changes made in the shell, so you have to attach
    it to them explicitly.

    If you insert it in the chain, you probably have to move the constraint
    resources from the RowColumn to the scrolled window.

  3. Re: Adding XmScrolledWindow to an existing application

    ST wrote:

    > Sounds like missing form attachments. Presumably, you want the scrolled
    > window to track to the changes made in the shell, so you have to attach
    > it to them explicitly.
    >
    > If you insert it in the chain, you probably have to move the constraint
    > resources from the RowColumn to the scrolled window.


    Ah yes, that works better, but now I have a new problem:

    In the old situation the form dialog window's width was ok, but
    the height did not fit on the screen (that's why I need a scrollbar).

    In the new situation it looks like I have to specify a width and,
    height for the form dialog widget, otherwise some small size is used.
    I do want to specify the height, but not the width.

    What I would like to see is that the width is "what's needed"
    (determined by the form's contents) and that I specify only a
    fixed height for which the scrollbar is used.

    Is this possible?

    --
    -- Jos Vos
    -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
    -- Amsterdam, The Netherlands | Fax: +31 20 6948204

  4. Re: Adding XmScrolledWindow to an existing application

    Jos Vos wrote:

    > What I would like to see is that the width is "what's needed"
    > (determined by the form's contents) and that I specify only a
    > fixed height for which the scrollbar is used.


    Now way I know of. The scroller has no preferred size, as its entire
    purpose in life is to make something impossible fit on the screen. You
    might have to do it explicitly in code.

  5. Re: Adding XmScrolledWindow to an existing application

    Now that I think of it, I may have done something like this before:

    Create another form with only one row of the elements you want to lay
    out. Attach it identically as main form, so it would normally overlap
    it. Manage it so it does a geometry pass, but keep it unmapped
    (mappedWhenManaged = False).

    That way you get the geometry management of one row's worth of widgets,
    but the widgets are hidden.

+ Reply to Thread