Setting a child widget sensitive from a sensitive parent - Motif

This is a discussion on Setting a child widget sensitive from a sensitive parent - Motif ; Hello, I ran into a problem and I need help. I designed a framework using X and Motif where I can register a widget and its sensitivity will depend on the state of other applications. Basically if the system is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Setting a child widget sensitive from a sensitive parent

  1. Setting a child widget sensitive from a sensitive parent

    Hello,

    I ran into a problem and I need help.

    I designed a framework using X and Motif where I can register a widget
    and its sensitivity will depend on the state of other applications.
    Basically if the system is paused, the registered widget will be
    insensitive, and when it will be unpaused, sensitive again. All my
    applications used to register the TopLevelShell and so all its
    children sensitivity will change accordingly.

    Now what I want to do is prevent some children from becoming
    insensitive on pause. Using a list of defined widget (All children of
    the topLevelShell) I was parsing it and preventing the selected widget
    to have its sensitivity changed. Unfortunatly it doesn't work since
    the TopLevelShell is set to insensitive and you can't set the
    sensitivity of its child independently. Right?

    What I would like to do is building a function that will set the
    sensitivity of all the TopLevelShell children independently without
    setting the parent. Using only the TopLevelShell widget as pointer in
    input. Is there a way to retreive the list of all the children of a
    widget using X functions?

    I'm using XFree86 on Linux.

    Thank you

  2. Re: Setting a child widget sensitive from a sensitive parent



    Martin Forget wrote:
    >
    > Hello,
    >
    > I ran into a problem and I need help.
    >
    > I designed a framework using X and Motif where I can register a widget
    > and its sensitivity will depend on the state of other applications.
    > Basically if the system is paused, the registered widget will be
    > insensitive, and when it will be unpaused, sensitive again. All my
    > applications used to register the TopLevelShell and so all its
    > children sensitivity will change accordingly.
    >
    > Now what I want to do is prevent some children from becoming
    > insensitive on pause. Using a list of defined widget (All children of
    > the topLevelShell) I was parsing it and preventing the selected widget
    > to have its sensitivity changed. Unfortunatly it doesn't work since
    > the TopLevelShell is set to insensitive and you can't set the
    > sensitivity of its child independently. Right?
    >
    > What I would like to do is building a function that will set the
    > sensitivity of all the TopLevelShell children independently without
    > setting the parent. Using only the TopLevelShell widget as pointer in
    > input. Is there a way to retreive the list of all the children of a
    > widget using X functions?


    All widgets that have children have an XtNchildren resource (type Widget
    *) and XtNnumChildren (type Cardinal). You can recursively descend the
    widget hierarchy using these.

    Note that popup shells are not normal children, and will not be found
    using this approach.

    It is somewhat difficult to do what you are trying without causing
    problems. If a widget is insensitive, none of its descendants are
    navigable. Perhaps you could navigate the widget hierarchy and set the
    sensitivity of all widgets for which XtIsComposite() is False.

    A better approach might be to redesign the GUI.

    >
    > I'm using XFree86 on Linux.
    >
    > Thank you


    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

+ Reply to Thread