How to disable main window when pop up window is active in AS3 AIR? - actionscript-3

I have a "Preferences" window that opens when the user clicks on Preferences in the desktop app's Edit menu.
It works fine, apart from that if the user clicks on Preferences in the edit menu while the Preferences window is open, another Preferences window is created.
I notice that most desktop apps disable the main window when a pop up window is opened. Is this possible in AS3, and if so how do I do this please?

When you create a pop up windows, you must set the modal flag to true so you can operate only on your windows and not in the below main window.
This is the snippet:
var popup:MyModalWindow =
MyModalWindow(
PopUpManager.createPopUp(
UIComponent(this.parentApplication), MyModalWindow, true,
PopUpManagerChildList.POPUP)
);
In the createPopUp method the third parameter is modal (set to true)

Related

Bokeh code to open pop up window showing data table on button click

I am developing a web application using bokeh. My requirement is to open pop up window on button click. The pop up window should display a data table widget. Secondly, This pop up window is draggable. Since my application is web based so cannot use pyqt. Is there any way to achieve this?

How to keep the Chrome extension window open after I click a link?

I'm having this issue with a simple extension I'm working on.
The extension consists of a bunch of links. When I click a single link, the extension closes.
I would like to keep the extension window open so I can open more links before closing the extension/clicking on the page to continue working.
Is there a way I can keep the extension open once a single link is clicked and only close it when I click on the page/lose focus?
Thanks.
Switching to another tab in the same window closes the popup because the popup is conceptually bound to the tab where it was invoked. When you open a URL it opens in a new active tab by default ("active" means it's currently in foreground), the old tab loses its active status, its popup closes.
The solution is to open the links in an inactive tab i.e. in background.
document.addEventListener('click', evt => {
const a = evt.target.closest('a[href]');
if (a) {
evt.preventDefault();
chrome.tabs.create({url: a.href, active: false});
}
});
Alternatively, open the links in a new window using chrome.windows.create.

How to retain the previous state of Viewer Toolbar

I have one custom toolbar buttons for the viewing 2d files. Clicking on same opens the panel for selecting file for comparison and loads the 'PixelCompare' extension. Once the operation is done, and when I click the 'Exit Comparing' toolbar button of PixelCompare, it doesn't show that extra custom toolbar button. Please suggest what is required. How can I handle the inbuilt extension unload. Thanks!

Keeping chrome extension popup open when opening link in background tab

I searched all over and haven't found an answer. I'm developing a Chrome extension and would like to know how to make the popup window stay open if the user chooses to open a link in a new background tab. (For example, clicking on the link while pressing the "ctrl" key.) Currently when I do that, the popup closes even though the user stays on the current tab.
It is different than How to keep Google Chrome Extension popup open?, as that's talking about when the user focuses on a different window, then the popup closes. I'm talking about when the user specifically stays focused on the popup, as in the example given that the user presses "ctrl" while clicking on the link, that the focus stays on current page.
chrome.tabs.create({ url, active: false });
From the docs:
active (boolean, optional): Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true.
Ref: https://developer.chrome.com/docs/extensions/reference/tabs/

window.location.reload refreshing the main window

the following is on a page, when i click it - I DO NOT want the page to refresh, but only the new window which this link opens - i want to refresh that newly opened page, not the main window.
clicking the link opens the new window correctly, but refreshes the main window also (where the link lies). that is undesirable and i want to know how to stop it from doing so.
clik to open new window
clik to open new window
pl advice.
as advised below, but not working: infact it is breaking the new window, new window appears as blank window!
clik to open new window
Here's the proper way to open a link in a new window. If javascript isn't available, the link will still work.
Click Me
mywin is a window name, not a variable.
You need to store the returned wobject from window.open() in a global variable:
onclick="window.mywin = window.open('URL','mywin');">
The problem with the main window reloading is likely the href="" line. This could be causing the browser to navigate to the same page where it is presently (and therefore refreshing). You should add return false; to the js, and likely also adopt a more standard link target like href="#" which will navigate to the top of the same page without a refresh (though this will still get cancelled by the false return).
friends, it is resolved by doing this:
clik to open new window