X With No Mouse Cursor
innocent_white_lamb writes "I am using an X-based menu that doesn't recognize a mouse. Keyboard input only. I load the menu with the command "startx -e menu", which loads the menu and gets stuff going without any need for a window manager. The problem is that the mouse cursor sits in the middle of the screen and, without a mouse attached, there appears to be no way to move it or get rid of it. I've asked around and nobody seems to have run into this situation before. So my question is, how do you get rid of the mouse cursor under X without using a window manager?"
Just check the mplayer sources.
I don't know if what mplayer does is pure X stuff or if it talks window manager into hiding mouse cursor. But when you move mouse cursor into mplayer video window it disapears after a while.
Just check the sources and see if you can implement the same in your menu program. But beware, mplayer is GPL so if you use this code directly you would have to license your program GPL too.
You can of course check what it is doing and reimplement it.
Robert
Bastard Operator From 193.219.28.162
A long time ago, at a time in my life when I had more money than brains, I bought myself a Fat Mac with 512K memory and two floppy disk drives the day this model first hit the streets in Toronto.
My girlfriend at the time (I guess there is an upside to having more money than brains) needed to conduct an experiment in cognitive psychogology to complete her undergraduate philosophy degree.
She decided to conduct an experiment in reading comprehension. Both groups were asked to read the text, but with different reading instructions. One group was instructed to proofread the text, the other group was instructed to read for comprehension.
We decided that programming this experiment for my new Mac would automate the timing controls, automatically measure the proofing reading results (how many words were marked with a mouse click), to collect the multiple choice results, and record the text of a written response question (in a dialog box roughly as feeble and distigusting as the web form input box used to compose posts for slashdot twenty years later).
When I showed her the first version, her remark was this, "you have to remove the menu bar or I'll fail". I could see her point. For an experiment in reading comprehension you want to control every word of text presented to the subject. Her professor would see it the same way.
At this point I should have pulled out a roll of duct tape, sliced off a half inch think strip, and covered over the top half inch of the display.
But ego prevailed. Surely, I thought, I just need to read the big Apple developer guide phone book thing to find the right flag to the right system call to remove the menu bar.
Thus began three weeks in hell.
The only way I could find to suppress the menu bar was to skip the initial call to some of the Apple windowing subsystems. It seemed to work. But then my program began to crash in dozens of mysterious and different ways. Eventually I learned that the call I had skipped initialized data structures required by many other subsystems.
Then I found other system calls that would hide the menu bar temporarily. But the nasty thing would reappear randomly as the user performed mouse actions. No matter what I tried, the cat came back.
Within a few months I several other frustrating encounters with the Mac architecture. I grew to despise the architecture of the Mac windowing system. I thought I could escape from Pascal hell by installing the Aztec C compiler. I was instantly much happier, but it wasn't a productive situation because the underlying C to Pascal mapping was full of bugs.
Then I was forced to buy an 8MHz PC for a programming contract. I put the hideously Fat Mac into a closet and I can barely recall using it since. I made one effort to salvage my investment by inquiring about the cost of a making a modification to install an internal hard drive, but the price was outrageous (almost as much as the entire turbo PC I bought instead).
Thanks to Apple, I learned a extremely valuable lesson about decoupling policy from implementation. One man's policy (Steve's) is another man's hell (mine).
Twenty years later, I never complain about X Windows. At least I know that this of kind of question *can* be answered.
Gawd I hated that machine. And it turned out the girlfriend wasn't much better.