Re: [qooxdoo-devel] Programmatically closing Window while contained tooltip open causes problems.

2011-06-28 Thread arnis_andy
And since I'm on a roll and can't seem to help myself:

/**
 * Adds a "clean-up handler" to destroy window after it is closed.  Note
 * use this function with awareness that it will destroy the window after
 * all listeners to the window's "close" event have been called such that
 * the window should no longer be used.
 * 
 * @param win {qx.ui.window.Window} Window to destroy after it is closed
 */
destroyWindowOnClose: function(win) {
function cleanUp() {
// Setup a timer routine to call immediately.  Using a timer 
routine
// will guarantee that the current thread of processing will 
complete
// before this function is called.
qx.util.TimerManager.getInstance().start(
   function() {
  win.destroy();
  win = null;
   }
);  
}
win.addListener("close", cleanUp, win);
}

It might even be useful to have "destroyOnClose" and option for the window
class.  This method will also ensure any other listeners to the "close"
event will get called before the window is destroyed.

I'm making the assumption here that "close" is the last event the window
will fire...?


-
"The wise know their weakness too well to assume infallibility; and he who 
knows most, knows best how little he knows." - Thomas Jefferson
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Programmatically-closing-Window-while-contained-tooltip-open-causes-problems-tp6518756p6527617.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Programmatically closing Window while contained tooltip open causes problems.

2011-06-28 Thread arnis_andy
I posted comments on the previously referenced post.  There's a suggestion to
delay the destruction of the window via a one-shot timer such that current
processing can be completed.  This method seems to solve my problems.  Here
is an example of it's usage:

var win = new
dohickie.ui.configuration.ConfigurationWindow(this.__mdvr.getConfiguration());

win.setModal(true);
win.addListener("myWhizBangEvent", this._handleWhizBang, this);

function cleanUp() {
   // Setup a timer routine to call immediately.  Using a timer routine
   // will guarantee that the current thread of processing will complete
   // before this function is called.
   qx.util.TimerManager.getInstance().start(
  function() {
 win.destroy();
 win = null;
  }
   ); 
   
}
win.addListener("close", cleanUp, win);

win.open();


-
"The wise know their weakness too well to assume infallibility; and he who 
knows most, knows best how little he knows." - Thomas Jefferson
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Programmatically-closing-Window-while-contained-tooltip-open-causes-problems-tp6518756p6527559.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Programmatically closing Window while contained tooltip open causes problems.

2011-06-28 Thread arnis_andy
I think this is the post you were referring to:

http://qooxdoo.678.n2.nabble.com/how-to-dispose-a-tabview-page-from-a-window-td6462553.html

That does help in understanding, thank you.

What I'd like to see in the documentation are more examples of
best-practices for handling memory management of composite objects. 
Extending the Widget object takes care of most of this if adding the child
widgets via _add() (as long as you remember to add all children that way.) 
However, sometimes a Widget is overkill and a simple Composite will do the
trick.

Maybe some better examples in this section:

http://manual.qooxdoo.org/1.4.x/pages/development/memory_management.html

These examples could show these best practices as far as creating windows,
composites, and other containers, how to handle disposing contained objects,
and how to correctly dispose of temporary windows.

I realize it will be a lot of additional documentation, but having examples
would have saved me a good bit of time in my qooxdoo learning curve (and
avoided the problem I'm encountering now.)  My application creates many
temporary windows and objects and list items that have to be managed.

Just thought I'd throw out that suggestion.  Thanks, again.



-
"The wise know their weakness too well to assume infallibility; and he who 
knows most, knows best how little he knows." - Thomas Jefferson
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Programmatically-closing-Window-while-contained-tooltip-open-causes-problems-tp6518756p6524765.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Programmatically closing Window while contained tooltip open causes problems.

2011-06-27 Thread Alexander Steitz
Hi,

is it possible for you to create a playground demo of this issue? This would 
help us to reproduce this issue.

Regards,
  Alex

On Monday 27 June 2011 05:17:21 arnis_andy wrote:
> I'm running into an issue which I can reliably reproduce by
> programmatically closing a window when a tooltip for a contained widget is
> still visible. The way I first encountered it was by having a key handler
> dismiss the window (calling default "OK" buttons execute method via key
> handler if Enter pressed.)  I event tried hiding the tooltip via the
> global tooltip Manager, but still get the error.
> 
> The error is encountered in the qx.ui.core.Widget.renderLayout() on line
> 1076 (when called for the tootip) when the styles are attempted to be set
> on the container, which no longer exists (is null)
> 
> Here's some example code that is part of my Window's constructor:
>   ...
>   // Add key handlers
>   function keyHandler(keyEvent) {
>  var key = keyEvent.getKeyIdentifier();
>  
>  // Hide any shown tooltip. 
>  var tooltip = qx.ui.tooltip.Manager.getInstance().getCurrent();
>  
>  if ( tooltip !== null ) {
> tooltip.hide();  // This didn't work
>  }
>  if (key === "Enter") {
> this.__okButton.execute();
>  } else if (key === "Escape") {
> this.__cancelButton.execute();
>  }
>   }
>   this.addListener("keypress", keyHandler, this);  
>   ...
> 
> So:
> (1) What's the right dismiss the tooltip before closing the window? 
> Normally the tooltip would be dismissed a window would be closed via mouse
> action and the mouse actions leading up to the clicks would have caused the
> tooltip to be closed.
> (2) Is this a qooxdoo bug or just bad form on my part?

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel