Hi joakim,

joakim_ schrieb:
> Hi there.
> 
> I've some questions regarding development of custom widgets which I hope
> someone can help me with.
> 
> I developing a simple dialog widget which extends Composite. The dialog have
> a slideDown and slideUp method as well as a overlay which fades in. The
> dialog's content is set via the setLayout() property. The content should be
> reset every time the dialog closes. So I'm wondering if it's a good practice
> to create the dialog and overlay on-the-fly every time when using the
> slideDown method and then remove it all when using the slideUp method, or
> does this stuff belong to the Constructor?

Generally, you want to reuse widgets if you can because creating and 
disposing them is fairly expensive in terms of processing time and 
memory usage. I'd create the widgets in the constructor and just set 
their content/visibility/whatever properties in the slideUp and 
slideDown methods.

> 
> I also wondering what's the best way to define "this" throughout the widget
> class? Should I put it in a global variable in the constructor like:
> 
> dialog = this;
> 
> or is there a better way?

Hmm, global variables are almost never a good idea. What are you trying 
to achieve with this?

> 
> Any help is very appreciated. Thanks! :)
> 

Regards,
Daniel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to