Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Scripting_function



Panel
titleDescription

Converts a pair of coordinates that are relative to the upper-left corner of some component to be relative to the upper-left corner of the entire screen.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.gui.convertPointToScreen(x, y, event)

  • Parameters

int x - The X-coordinate, relative to the component that fired the event.

int y - The Y-coordinate, relative to the component that fired the event.

EventObject event - An event object for a component event.

  • Returns

PyTuple - A tuple of (x,y) in screen coordinates.

  • Scope

All



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
#This# This example will get the coordinates where the mouse is (from the corner of the monitor) and display them in a label.
#Get# Get the screen coordinates of the pointer and write them to a label.
coords = system.gui.convertPointToScreen(event.x, event.y, event)
event.source.getComponent('Label').text = "x: %s y: %s" %(coords[0], coords[1])