Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!) - Motif

This is a discussion on Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!) - Motif ; waterskier19@yahoo.com (Ryan DesRoches) wrote in message news: ... > I am using OpenGL with X/Motif and I need to accept keyboard input on the > glwDrawingArea widget that I am using to do all my OpenGL drawing in. [...] > ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

  1. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    waterskier19@yahoo.com (Ryan DesRoches) wrote in message news:<6d97702.0307091135.27d65f51@posting.google.com>...

    > I am using OpenGL with X/Motif and I need to accept keyboard input on the
    > glwDrawingArea widget that I am using to do all my OpenGL drawing in. [...]
    > the problem that I am having is that the border around the widget that shows
    > that the widget has focus disappears after I do a redraw in openGL. The
    > widget STILL has focus though, as it still accepts keyboard input after I
    > finish my redraw - it just that the border around the widget is now gone. [...]


    Are you using the plain GLwDrawingArea or the Motif one, GLwMDrawingArea?

    Is it the one provided by XFree86, by SGI/Irix or the original code from
    Doug Young's book?

    --- Casantos

  2. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    nojunk@gate.cpmet.ufpel.tche.br (Carlos A M dos Santos) wrote in message news:<94bfb09f.0307100526.705a43c@posting.google.com>...
    > waterskier19@yahoo.com (Ryan DesRoches) wrote in message news:<6d97702.0307091135.27d65f51@posting.google.com>...
    >
    > Are you using the plain GLwDrawingArea or the Motif one, GLwMDrawingArea?
    >
    > Is it the one provided by XFree86, by SGI/Irix or the original code from
    > Doug Young's book?
    >
    > --- Casantos



    It's a GLwMDrawingArea widget. I am running on a Sun box, Solaris 7.5
    (moving up to 8.0 shortly from what I'm hearing from our Tools team).

    I'll even do you one better - here's the code creating the widget:

    ////////////////////////////////////////////////////////////
    // Method: initialize
    //
    // Purpose: do the initialization needed for
    // GlobeScreen once all the values are
    // set by Session being managed.
    //
    void
    DcGui_Impl::GlobeScreen::initialize()
    {

    // take out the openGL lock to safeguard the openGL commands

    GlobeOpenGLLock lock;


    // now create the widget. This has to be the OpenGL version of the
    // Motif Drawing Area widget to ensure that the visual and depth
    are set
    // properly.
    //
    Arg al[64];
    int num = 0;
    XtSetArg(al[num], XmNtopAttachment, XmATTACH_FORM); num++;
    XtSetArg(al[num], XmNbottomAttachment, XmATTACH_FORM); num++;
    XtSetArg(al[num], XmNleftAttachment, XmATTACH_FORM); num++;
    XtSetArg(al[num], XmNrightAttachment, XmATTACH_FORM); num++;
    XtSetArg(al[num], GLwNvisualInfo, vi_); num++;
    XtSetArg(al[num], XtNcolormap, colormap_); num++;
    XtSetArg(al[num], XmNkeyboardFocusPolicy, XmEXPLICIT); num++;
    XtSetArg(al[num], XmNtraversalOn, TRUE); num++;
    XtSetArg(al[num], XmNhighlightThickness, 2); num++;

    // create the drawing area with the all the settings and the
    // name that was set
    drawingArea_ =
    GLwCreateMDrawingArea(parent_,
    const_cast(widgetName_.c_str()),
    al, num);

    // create callbacks on the drawing area

    // gets called when the OpenGL drawing Area gets first created
    XtAddCallback(drawingArea_, GLwNginitCallback,
    initCB, (XtPointer) this);

    // gets called when another window moves off of the widget
    // The GLwNexposeCallback automatically compresses multiple
    // Expose events into a single callback.
    //
    XtAddCallback(drawingArea_, GLwNexposeCallback,
    exposeCB, (XtPointer)this);

    // gets called with input. This will be mouse only. The
    // keyboard commands get caught by session window.
    XtAddCallback(drawingArea_, GLwNinputCallback,
    inputCB, (XtPointer)this);

    // Manage this new widget
    XtManageChild(drawingArea_);

    } // end of GlobeScreen initialize

    Am I missing something here??

    Thanks
    Ryan

  3. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    Are you sure you aren't updating another field on your GUI that causes
    focus to shift there?

    "Ryan DesRoches" wrote in message
    news:6d97702.0307100918.16240131@posting.google.co m...
    > nojunk@gate.cpmet.ufpel.tche.br (Carlos A M dos Santos) wrote in message

    news:<94bfb09f.0307100526.705a43c@posting.google.com>...
    > > waterskier19@yahoo.com (Ryan DesRoches) wrote in message

    news:<6d97702.0307091135.27d65f51@posting.google.com>...
    > >
    > > Are you using the plain GLwDrawingArea or the Motif one,

    GLwMDrawingArea?
    > >
    > > Is it the one provided by XFree86, by SGI/Irix or the original code from
    > > Doug Young's book?
    > >
    > > --- Casantos

    >
    >
    > It's a GLwMDrawingArea widget. I am running on a Sun box, Solaris 7.5
    > (moving up to 8.0 shortly from what I'm hearing from our Tools team).
    >
    > I'll even do you one better - here's the code creating the widget:
    >
    > ////////////////////////////////////////////////////////////
    > // Method: initialize
    > //
    > // Purpose: do the initialization needed for
    > // GlobeScreen once all the values are
    > // set by Session being managed.
    > //
    > void
    > DcGui_Impl::GlobeScreen::initialize()
    > {
    >
    > // take out the openGL lock to safeguard the openGL commands
    >
    > GlobeOpenGLLock lock;
    >
    >
    > // now create the widget. This has to be the OpenGL version of the
    > // Motif Drawing Area widget to ensure that the visual and depth
    > are set
    > // properly.
    > //
    > Arg al[64];
    > int num = 0;
    > XtSetArg(al[num], XmNtopAttachment, XmATTACH_FORM); num++;
    > XtSetArg(al[num], XmNbottomAttachment, XmATTACH_FORM); num++;
    > XtSetArg(al[num], XmNleftAttachment, XmATTACH_FORM); num++;
    > XtSetArg(al[num], XmNrightAttachment, XmATTACH_FORM); num++;
    > XtSetArg(al[num], GLwNvisualInfo, vi_); num++;
    > XtSetArg(al[num], XtNcolormap, colormap_); num++;
    > XtSetArg(al[num], XmNkeyboardFocusPolicy, XmEXPLICIT); num++;
    > XtSetArg(al[num], XmNtraversalOn, TRUE); num++;
    > XtSetArg(al[num], XmNhighlightThickness, 2); num++;
    >
    > // create the drawing area with the all the settings and the
    > // name that was set
    > drawingArea_ =
    > GLwCreateMDrawingArea(parent_,
    > const_cast(widgetName_.c_str()),
    > al, num);
    >
    > // create callbacks on the drawing area
    >
    > // gets called when the OpenGL drawing Area gets first created
    > XtAddCallback(drawingArea_, GLwNginitCallback,
    > initCB, (XtPointer) this);
    >
    > // gets called when another window moves off of the widget
    > // The GLwNexposeCallback automatically compresses multiple
    > // Expose events into a single callback.
    > //
    > XtAddCallback(drawingArea_, GLwNexposeCallback,
    > exposeCB, (XtPointer)this);
    >
    > // gets called with input. This will be mouse only. The
    > // keyboard commands get caught by session window.
    > XtAddCallback(drawingArea_, GLwNinputCallback,
    > inputCB, (XtPointer)this);
    >
    > // Manage this new widget
    > XtManageChild(drawingArea_);
    >
    > } // end of GlobeScreen initialize
    >
    > Am I missing something here??
    >
    > Thanks
    > Ryan




  4. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    "JB West" wrote in message news:...
    > Are you sure you aren't updating another field on your GUI that causes
    > focus to shift there?


    Yeah - preaty sure, I still have focus after a redraw, as the widget
    still is accepting keyboard input. The only issue is that the focus
    border is going away.

    Ryan

  5. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    Hmm, I'm pretty sure this is a Motif issue, not an OPENGL one.

    If you TAB around, do you see where focus is? I never explicitly set the
    Motif traversal
    policy, & life is just fine. Indeed, with pointer focus, you don't need to
    have a highlight
    border...


    "Ryan DesRoches" wrote in message
    news:6d97702.0307110407.5743809a@posting.google.co m...
    > "JB West" wrote in message

    news:...
    > > Are you sure you aren't updating another field on your GUI that causes
    > > focus to shift there?

    >
    > Yeah - preaty sure, I still have focus after a redraw, as the widget
    > still is accepting keyboard input. The only issue is that the focus
    > border is going away.
    >
    > Ryan




  6. Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)

    waterskier19@yahoo.com (Ryan DesRoches) wrote in message news:<6d97702.0307140404.b51b23e@posting.google.com>...
    > "JB West" wrote in message news:...
    > > Hmm, I'm pretty sure this is a Motif issue, not an OPENGL one.
    > >
    > > If you TAB around, do you see where focus is? I never explicitly set the
    > > Motif traversal
    > > policy, & life is just fine. Indeed, with pointer focus, you don't need to
    > > have a highlight
    > > border...
    > >

    >
    > Yeah - I see the focus border when I tab around the window, it's
    > just after a redraw that it vanishes. I went to motifdeveloper.com
    > and posted this question there, it is looking more and more likely
    > that there is a bug internal to glWMDrawingArea widget, but untill we
    > find out for sure - I am still open for suggestions.
    >
    > As for setting the highlight border - no I really do not have to set
    > that explisitly, I just wanted to make it a little bit bigger than the
    > default (for testing purposes).
    >
    > I do however have to explisitly set the keyboard traversial, as this
    > widget by default does not accept keyboard traversial - (you do have
    > to set it manually as fatr as I know). I need to have it set to
    > XmEXPLICIT due to the requirements specifications on this project.
    > Thought I probibly should switch it to XmPOINTER just to see what will
    > happen.
    >
    > If anyone has any suggestions on what else I can try - let me know - I
    > am open to suggestions
    >
    > Thanks
    > Ryan


    Bump - anyone have any ideas?? The only thing I can think of is to
    create a new widget, and set the focus to that dummy widget, just so I
    can have my drawing area take it back after every redraw - but this I
    do believe will result in a flicker of the focus border - which is not
    desireable.

    Thanks
    Ryan

+ Reply to Thread