# Perspective 8.1 Popup to mouse offset

**URL:** <https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 27, 2024, 11:54am UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949 "2024-05-27T11:54:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 27, 2024, 11:54am UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/1 "2024-05-27T11:54:44Z")

</div>

I have a custom tooltip that I'm using and I've found that when hovering over an asset, it can sometimes lead to a situation where the popup blocks the mouse, causing it to close and reopen. Is there a way to provide a greater offset for the popup? I'm thinking I probably need to use a script to open the popup with a certain offset from the mouse. Any help is appreciated. Thanks!

```python
def runAction(self, event):
	# Get the bed name from the custom property
	BED = self.view.params.BED
	# Get the CC parameter from the custom property
	CC = self.view.params.CC
	
	# Call the custom function to get the jams tag values
	jamsTagValuesList = BedTooltip.getValues(CC, BED)
	# Initialize tooltip text
	tooltipText = "Bed: {}\n".format(BED)
	
	# Build the tooltip text with tag values
	for tag in jamsTagValuesList:
 		tooltipText += "{} : {}\n".format(tag['tagName'], tag['value'])
 		
 	lines = tooltipText.split("\n")
	self.custom.Lines = len(lines)	
    # Update the tooltip text and make it visible
	self.custom.ToolTip = tooltipText

```

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 27, 2024, 12:38pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/2 "2024-05-27T12:38:22Z")

</div>

I can't quite follow the logic of what you are doing, but have you specified `meta.tooltip.location` to something other than `mouse`? The other options anchor the tooltip relative to the component rather than the cursor.

---

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 27, 2024, 2:03pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/3 "2024-05-27T14:03:25Z")

</div>

Im using just a event popup no scripting for popup window . I want it to pop up next to the mouse just not in the way so that it closes. I'm just defining that i want it relative to the bottom right of the mouse but there is no option on how far away from the mouse . The script is to browse tags and update the ToolTip on hover and its trying to calculate the lines needed based on the Pre whitespace \n so that it can set the window size based on the number of tags for that asset.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 27, 2024, 2:16pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/4 "2024-05-27T14:16:20Z")

</div>

For what I see on the video the issue happens when you cross the border line, maybe take out the border line works.

---

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 27, 2024, 2:29pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/5 "2024-05-27T14:29:21Z")

</div>

There is a Close popup window on mouse exit the popup makes the mouse exit the focused asset . can get into a cycle where it makes it close then pop up multiple times before you can get over to stop it . i just need to look into relative to mouse plus x amount to give a buffer so the mouse wont end up over the popup.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 27, 2024, 2:35pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/6 "2024-05-27T14:35:04Z")

</div>

> [@byrcharl](#):
>
> Im using just a event popup no scripting for popup window

I'm still confused. `

1. What is "an event popup"? Is it a view?
2. How is it triggered?
3. Your script mentions `tooltip` but am I correct in thinking that you are not using a tooltip?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 27, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/7 "2024-05-27T14:40:17Z")

</div>

I'm confused as well, looks like a tooltip to me.

---

<div class="post-metadata">

**Author:** ![byrcharl](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@byrcharl](https://forum.inductiveautomation.com/u/byrcharl)\
**Post date:** [May 27, 2024, 2:46pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/8 "2024-05-27T14:46:53Z")

</div>

Sorry for the Confusion im calling a "TOOLTIP" because it kinda is but im aware there is a tooltip aswell for a view. Mine is a view that i popup based on a mouse enter event.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 27, 2024, 2:53pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/9 "2024-05-27T14:53:41Z")

</div>

Try scripting the popup instead of using a popup action.

[system.perspective.openPopup | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-openPopup) has

| Type | Parameter | Description |
| --- | --- | --- |
| Dictionary[String, Integer] | `position` | Dictionary of key-value pairs to use for position. Possible position keys are: left, top, right, bottom, width, height. Defaults to the center of the window. [optional] |
| | | |

This looks a lot more flexible and you should be able to read the position of your target object and offset that into the `position` dictionary of the popup.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 27, 2024, 3:13pm UTC](https://forum.inductiveautomation.com/t/perspective-8-1-popup-to-mouse-offset/90949/10 "2024-05-27T15:13:22Z")

</div>

Can you help us understand why using an actual tooltip is not desired?
