GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Oct-2009, 15:35
rc3 rc3 is offline
New Member
 
Join Date: Oct 2009
Posts: 6
rc3 will become famous soon enough

hotspot() not working


OK here's my second problem while working on my touch screen gui program:
I am trying to change the default mouse cursor position to [ for example (10,10) ] when the main window and here's what I have in my code

CPP / C++ / C Code:
...
    win->show(argc, argv);
    win->hotspot(10,10);
...

But it doesn't work, the initial position of the mouse cursor remains whereever it is before the main window shows. Am I using the wrong function?

fltk version: 1.1
OS: Debian etch
platform: armv4tl
fltk runs on Xorg but no windows manager is used.
  #2  
Old 27-Oct-2009, 13:34
rc3 rc3 is offline
New Member
 
Join Date: Oct 2009
Posts: 6
rc3 will become famous soon enough

Re: hotspot() not working


I just realized that hotspot is for changing the position of a window instead of the mouse cursor. And I am still strugling to find out how to change the initial position of mouse cursor in a window. Help, anybody?
  #3  
Old 27-Oct-2009, 14:23
rc3 rc3 is offline
New Member
 
Join Date: Oct 2009
Posts: 6
rc3 will become famous soon enough

Re: hotspot() not working


OK I just found the answer from
http://www.fltk.org/doc-1.0/osissues.html
http://www.mail-archive.com/fltk-opengl@easysw.com/msg00023.html


Solution:


CPP / C++ / C Code:
#include <FL/x.H>
extern Display *fl_display;

int jump_cursor (int new_x, int new_y)
{
      Window rootwindow = DefaultRootWindow(fl_display);
      XWarpPointer(fl_display, rootwindow, rootwindow, 0, 0, 0, 0,new_x, new_y);
      return 0; // Assume OK
} 


To use the function, call jump_cursor(0,0) before calling the show() method of the main window.
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
doskey not working in windows xp anil Computer Software Forum - Windows 0 09-Jun-2007 02:33
Re: Still working on the BBCodes II... admin GIDNetwork™ 1 01-Mar-2007 22:01
htaccess basic authentication just stops working zoolander Apache Web Server Forum 0 12-Jan-2007 13:41
What are hotspot crash? jaro Java Forum 0 18-May-2006 08:17
Re: Still working on the BBCodes... admin GIDNetwork™ 2 11-May-2005 23:28

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:21.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.