Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)
[email]waterskier19@yahoo.com[/email] (Ryan DesRoches) wrote in message news:<6d97702.0307091135.27d65f51@posting.google.com>...
[color=blue]
> 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. [...][/color]
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
Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)
[email]nojunk@gate.cpmet.ufpel.tche.br[/email] (Carlos A M dos Santos) wrote in message news:<94bfb09f.0307100526.705a43c@posting.google.com>...[color=blue]
> [email]waterskier19@yahoo.com[/email] (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[/color]
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<char *>(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
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" <waterskier19@yahoo.com> wrote in message
news:6d97702.0307100918.16240131@posting.google.com...[color=blue]
> [email]nojunk@gate.cpmet.ufpel.tche.br[/email] (Carlos A M dos Santos) wrote in message[/color]
news:<94bfb09f.0307100526.705a43c@posting.google.com>...[color=blue][color=green]
> > [email]waterskier19@yahoo.com[/email] (Ryan DesRoches) wrote in message[/color][/color]
news:<6d97702.0307091135.27d65f51@posting.google.com>...[color=blue][color=green]
> >
> > Are you using the plain GLwDrawingArea or the Motif one,[/color][/color]
GLwMDrawingArea?[color=blue][color=green]
> >
> > Is it the one provided by XFree86, by SGI/Irix or the original code from
> > Doug Young's book?
> >
> > --- Casantos[/color]
>
>
> 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<char *>(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[/color]
Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)
"JB West" <jbwest@NOSPAM_acm.org> wrote in message news:<dAOdnbta6OkSuJOiU-KYgg@comcast.com>...[color=blue]
> Are you sure you aren't updating another field on your GUI that causes
> focus to shift there?[/color]
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
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" <waterskier19@yahoo.com> wrote in message
news:6d97702.0307110407.5743809a@posting.google.com...[color=blue]
> "JB West" <jbwest@NOSPAM_acm.org> wrote in message[/color]
news:<dAOdnbta6OkSuJOiU-KYgg@comcast.com>...[color=blue][color=green]
> > Are you sure you aren't updating another field on your GUI that causes
> > focus to shift there?[/color]
>
> 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[/color]
Re: losing focus border on glwDrawingArea widget whe redrawing (still have focus though!)
[email]waterskier19@yahoo.com[/email] (Ryan DesRoches) wrote in message news:<6d97702.0307140404.b51b23e@posting.google.com>...[color=blue]
> "JB West" <jbwest@NOSPAM_acm.org> wrote in message news:<w4WdnfY46pD1ppKiU-KYgw@comcast.com>...[color=green]
> > 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...
> >[/color]
>
> 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[/color]
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