Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Pop up window at mouse pointer

Engaged ,
Jun 14, 2013 Jun 14, 2013

Hi there,  I am totally new to events, never really needed them so excuse my lack of knowledge on this. I am trying to pop up a window at the mouse pointer.

The solution I have is clunky. So I pop up a window, maybe maximum size - make it's opacity zero, so the user can't see it. Then I set up a 'mousemove' listener

on this large invisible window which triggers the next window to appear at the right position.

So I have to move the mouse to pop up the window, I would rather a keyboard event to pop the window up, but there is no screenX, screenY property in the keyboard event object.

Any pointers appreciated...  am I totally up the wrong path....?

Many thanks.

Alan.

var w = new Window ("dialog");

             w.preferredSize=[700,700];

             w.addEventListener ("mousemove", function (m) {eventHandler(m)});

 

                                        function eventHandler (ev){

                                                  //b.text =  ("X: " + ev.screenX+"Y: " + ev.screenY);

                     

                                                  var w2= new Window ("dialog");

                      w2.location = [ev.screenX,ev.screenY];

                      w2.show();

                      w.close();

                                        }

 

           

                              w.show ();

TOPICS
Scripting
689
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 14, 2013 Jun 14, 2013

I just noticed my unintentional pun 'Any POINTERS appreciated'.  Excellent.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 14, 2013 Jun 14, 2013
LATEST

Actually this is working perfectly, I just had to kill the eventListener once it was triggered once.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines