I create an object of window, and put tabpanel in this window. but window.close() method does not destroy window. When I click button to open window again it display 2 different tabpanel, one from old window and another from new window and it crash my user interface.
I also called listener "beforeclose" and in this method destroy tabpanel but that doest not work.
What can be done?
Are you sure that closeAction option is set to destroy?
Of course it is a good idea to show simplified sources, so we can understand where the problem exists.
Add closeAction:'destroy' to your window. It should work.
Related
I need an event which handles clicks on main window of my program.
I used button-press-event but when i click on my window nothing happens.
I'm designing my GUI using Glade Interface Designer.
please explain for me when button-press-event will be called in gtk+ & is it the event i need or not?
Check you've got the button press event mask set for the window under the
Window Properties - Common tab in glade
'button-press-event' should give you mouse button presses. It may be that you need to use gtk_widget_add_device_events () to add button presses to the list of events that are received by the window but I think it should get them by default, can you post you code please?
New Thought, Maybe I am looking at this totally incorrectly. So Here is exactly what I am trying to do in case there is another option I am not aware of.
I have a WPF app, the main window shows a smaller dialog window using ShowDialog(), when a user clicks on the parent window that showed the dialog, I need to make the dialog window, flash, shake or blink.
AresAvatar posted a link that looks like it might be able to use, but is there another option I am not aware of?
My original Question.
Mouse click event when Modal window's parent is clicked in WPF app?
I have a wpf app that shows a modal window using ShowDialog().
I would like to fire an event when the user tries to click the parent window that is now disabled.
Is it possible on the parent to receive a click event when it has shown a modal window?
When I attempted this using an interaction trigger, the events never fired on parent window.
Otherwise, what suggestions / options are there.
Thanks
No WPF events are sent under these conditions. The only Windows message I can see that gets sent is WM_WINDOWPOSCHANGING. You could check for that message, and check if the window was disabled when it occurred. Here's a good article on checking WM_WINDOWPOSCHANGING.
Edit: that link seems to be dead. Here's an example on StackOverflow of checking window messages.
I know this is an old question but I'll post my solution in case any one needs it.
Set the dialog.owner prior to calling ShowDialog().
var dialog = new DialogWindow();
dialog.owner = MainWindow;
dialog.ShowDialog();
The result is that clicking on the main window, brings the dialog window to the front and makes the dialog window flash.
I have a checkbox that triggers a function that opens a small window with a grid and a form.
If closeAction:'close' the window is not reopened after closing (some error).
If closeAction:'hide' the window is reopened with a mess instead of its items.
I know that I can solve the problem by id:Ext.id() though I have other functions that are using the id's.
Is there a way to reopen the window without these problems?
Part of the function creating the window, nothing unusual:
var errWindow = new Ext.Window({
width:300,
title:headerStr,
closeAction:'hide',
items: [errForm,problemsGrid]
});
errWindow.show();
The items of the form have id's like: "textfieldNumber1". Without the id's everithing works fine, but with them I get this
If you use closeAction: 'close' which is the default, then the window cannot be reopened with show(). If you use use closeAction: 'hide' then the window can be shown and hidden but you must do this with hide() and show() calls. A call to close() will destroy the window regardless of what closeAction is set to.
Is it that you want to destroy your form when user clicks on close, while keeping window hidden for re-use?
if so,
Listen to beforeClose event, and remove form from window's items
Call windows.hide()
Also, you need to add new form (since you destroyed it), while showing window again. listen to beforeShow to do that.
I had the same problem . As "Narenda Kamma" already mentioned before need to listen to beforeClose and then call to destroy function . See example below
var me = this
this.window.on("beforeclose",
function (com, eOpts) { me.closeWindow() });
i am using a factory function (which has grids within windows called using button handler)within one form.
so when i click the button and open a grid and than close it,it works correctly,
but say for example in a situation:
if i open both grids and close , and than try to open other grid the previous grids contents are loaded,but as i have set the store to load in button handler that particular store is loading correctly(i have checked with fire bug) but contents of grid are not changing
win.hide();//use to hide the window after using it
closeAction: 'hide',//in window config
I am assuming that you are using gridpanels for each of these grids. You could force the stores to reload(). Or on the Window's close or hide event, you could try and clear the data on the store or reset the gridpanel.
You may want to read up on the closeAction property on the Window object. That lets you define the behavior of the close button on the window.
I have a WPF-window, in this you can click a button to see a new window. Now I want to disable, that you can click the main-window. It should be like a MessageBox.
You want to use dialog.ShowDialog().
Modeless dialogs (via dialog.Show) are ones that you can interact with the background window. Modal dialogs (via dialog.ShowDialog() are ones that don't allow you to interact with the parent window.
You're looking for Window.ShowDialog()
Try this:
dialogYouNeedToShow.Owner = App.Current.MainWindow;
dialogYouNeedToShow.ShowDialog();
ShowDialog will always show your dialog as a modal one, so you won't have access to background form.
Do you mean
MessageBox.Show()
or
myWindowName.ShowDialog()
?