nanogui: Thread: Return to text mode


[<<] [<] Page 1 of 1 [>] [>>]
Subject: [nanogui] Return to text mode
From: "Georg Potthast" ####@####.####
Date: 17 Jul 2011 17:13:40 -0000
Message-Id: <000701cc44a4$dc272520$6a00a8c0@SCHREIBTISCHGP>

Dear Greg,

when I use an Xlib program with NXlib I had the problem, that I could just 
return to text mode when pressing the ESC key. Selecting X of the window 
terminated the program but left the screen in SVGA mode and sent the 
following console output to that so it could not be read.

So I enabled GrClose() in CLDisplay.c of NXlib and now I can return to text 
mode from an Xlib application.

However, this does not work with FLTK yet. I can return to text mode from an 
FLTK application by pressing ESC but not when selecting X from the window or 
pressing a Quit button if the application offers that.

What can I do so XCloseDisplay() in CLDisplay.c works just as well as 
pressing the ESC key?

I also have a question regarding the mouse driver:

The mou_dos.c driver has these functions:
MOUSEDEVICE mousedev = {
MOU_Open,
MOU_Close,
MOU_GetButtonInfo,
MOU_GetDefaultAccel,
MOU_Read,
MOU_Poll
};

while the mou_x11.c driver has these functions:
MOUSEDEVICE mousedev = {
X11_Open,
X11_Close,
X11_GetButtonInfo,
X11_GetDefaultAccel,
X11_Read,
NULL,
MOUSE_NORMAL /* flags*/
};

Should I replace the "MOU_Poll" with "NULL,MOUSE_NORMAL" or will that make 
no difference?

Georg 

Subject: Re: [nanogui] Return to text mode
From: "Greg Haerr" ####@####.####
Date: 25 Jul 2011 22:29:47 -0000
Message-Id: <3CD866E5219D4F29B080668107A647D0@winXP>

: when I use an Xlib program with NXlib I had the problem, that I could just
: return to text mode when pressing the ESC key. Selecting X of the window
: terminated the program but left the screen in SVGA mode and sent the
: following console output to that so it could not be read.
:
: So I enabled GrClose() in CLDisplay.c of NXlib and now I can return to 
text
: mode from an Xlib application.

This was removed for some cases of which I can't remember.  You
might enable this #ifdef MSDOS so that it only happens when not
running in a graphic environment.


:
: However, this does not work with FLTK yet. I can return to text mode from 
an
: FLTK application by pressing ESC but not when selecting X from the window 
or
: pressing a Quit button if the application offers that.
:
: What can I do so XCloseDisplay() in CLDisplay.c works just as well as
: pressing the ESC key?

I'm not quite sure yet what the bug is here.  Try to find out whether
FLTK calls XCloseDisplay() or not, lets start from there.



:
: I also have a question regarding the mouse driver:
:
: The mou_dos.c driver has these functions:
: MOUSEDEVICE mousedev = {
: MOU_Open,
: MOU_Close,
: MOU_GetButtonInfo,
: MOU_GetDefaultAccel,
: MOU_Read,
: MOU_Poll
: };
:
: while the mou_x11.c driver has these functions:
: MOUSEDEVICE mousedev = {
: X11_Open,
: X11_Close,
: X11_GetButtonInfo,
: X11_GetDefaultAccel,
: X11_Read,
: NULL,
: MOUSE_NORMAL /* flags*/
: };
:
: Should I replace the "MOU_Poll" with "NULL,MOUSE_NORMAL" or will that make
: no difference?

The Poll entry point allows polling of the mouse driver when no
select() OS entry point is implemented, which I think is the case for
your DOS port.  Is the DOS mouse working?

If you remove the MOU_Poll entry point then your driver will never be
called unless the GrSelect() routine (usually hanging in select()), returns
a mouse event, which then calls the MOU_Read routine.  Otherwise,
the Poll routine is called, which internally checks for mouse input and
the Read routine is called from another procedure (IIRC GrSelect() #ifdef'd
for MSDOS)

Regards,

Greg 

Subject: Re: [nanogui] Return to text mode
From: "Georg Potthast" ####@####.####
Date: 26 Jul 2011 19:08:46 -0000
Message-Id: <003301cc4bc7$46ee4fe0$6a00a8c0@SCHREIBTISCHGP>

>
> I'm not quite sure yet what the bug is here.  Try to find out whether
> FLTK calls XCloseDisplay() or not, lets start from there.
>

You were right, FLTK does not call XCloseDisplay() and recommends not to do 
that. The demo applications just make an exit(0);

You have to add the function: "fl_close_display();" just before the 
"exit(0);" in the application code to have NXlib execute GrClose(); (if 
enabled)

To be able to use this function you have to include this header file: 
"#include <FL/x.H>"

Georg 

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.