CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Location
    Denver
    Posts
    353

    [RESOLVED] X Windows widget questions...

    X Windows questions...

    1) Is there a call to retrieve the children widgets of a given parent?

    2) Can a widget be modified if you're in a callback that was executing by the same widget?

    The reason for question 2 is I would like to add children widgets to a particular widget, and I would like to do this from a callback that is currently executing from the widget in question. When I try this, my program core dumps. I can, however, add children to a particular widget if I am in some other callback that was executing from a completely different widget.

  2. #2
    Join Date
    Feb 2005
    Location
    Denver
    Posts
    353

    Re: X Windows widget questions...

    Never mind question 2, I think(?) I've found my problem. I do still need an answer for question 1. Thanks.

  3. #3
    Join Date
    Mar 2007
    Location
    Montreal, Quebec, Canada
    Posts
    185

    Re: X Windows widget questions...

    Which X library are you using? GTK+, qt, wxWidgets? There isn't a single API.

  4. #4
    Join Date
    Feb 2005
    Location
    Denver
    Posts
    353

    Re: X Windows widget questions...

    Quote Originally Posted by IllegalCharacter
    Which X library are you using? GTK+, qt, wxWidgets? There isn't a single API.
    Sorry, I've been on vacation for the last week and a half.

    The library is X11 (sorry, I didn't realize there were so many variants of X libraries). However, I found an answer to my problem a few days before I left on vacation. I needed two different retrieval methods. One using the widget.core.popup_list[] array, and the other using the XtNchildren and XtNnumChildren attributes with the XtGetValues() function. This seemed to retrieve everything I needed in order to traverse a widget tree both forward and backward.

    What I was doing was searching for a particular widget that existed in a particular widget tree from some given node in the middle of the tree. Of course, after doing all that work, about a day or two later, I discovered an even easier way to get what I wanted, using the XtNameToWidget() function. What I didn't realize at the time was that I had access to the top level widget and was able to use this function to traverse the entire tree starting at the top of the tree.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured