[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] drawFunc called despite window not visible



no worries.  i've worked around it (was actually the rates args to my synthdef and not the drawfunc setting params too quickly), and now these examples are the mail archive and in people's heads.
_f

Am 16.01.2008 um 20:23 schrieb Sciss:

hi fredrik,

i have gone through the refreshing behaviour of drawFunc and  
drawHook, and updated both. i'm sorry to say that they still behave  
different than those in cocoaGUI, but at least i think they have  
reasonable consistency now (see the introductory section of  
JSCUserView help file). Here's an example:

GUI.swing

// JSCWindow : drawHook

(
w= GUI.window.new;
w.drawHook= {
1111.postln; // NO
};
)

w.front; // YES
w.drawHook = { 2222.postln }; // YES
w.visible = false;
w.drawHook = { 3333.postln }; // NO
w.visible = true; // YES

w.visible = false;
w.visible = true;

w.close;
// JSCUserView : drawFunc

(
w = GUI.window.new;
u = GUI.userView.new( w, w.view.bounds.insetBy( 10, 10 )).background_ 
( Color.blue );
u.drawFunc= {
1111.postln; // NO
};
)

w.front; // YES
u.drawFunc = { 2222.postln }; // YES
u.visible = false;
u.drawFunc = { 3333.postln }; // NO
u.visible = true; // YES
w.visible = false;
u.drawFunc = { 4444.postln }; // NO
w.visible = true; // YES

w.close;
// JSCUserView inside container

(
w = GUI.window.new;
x = GUI.compositeView.new( w, w.view.bounds.insetBy( 10,  
10 )).background_( Color.red );
u = GUI.userView.new( x, x.bounds.insetBy( 10, 10 )).background_ 
( Color.blue );
u.drawFunc= {
1111.postln; // NO
};
)

w.front; // YES
u.drawFunc = { 2222.postln }; // YES
u.visible = false;
u.drawFunc = { 3333.postln }; // NO
u.visible = true; // YES
x.visible = false;
u.drawFunc = { 4444.postln }; // NO
x.visible = true; // YES
x.visible = false;
u.visible = false;
u.drawFunc = { 5555.postln }; // NO
x.visible = true; // NO
u.visible = true; // YES
x.visible = false;
u.visible = false;
u.drawFunc = { 6666.postln }; // NO
u.visible = true; // NO
w.visible = false;
x.visible = true; // NO
w.visible = true; // YES

w.close;





ciao, -sciss-





Am 16.01.2008 um 16:01 schrieb Fredrik Olofsson:

more swing vs cocoa differences.
how can i avoid that these functions are called.  the windows are not
visible and shouldn't refresh!


GUI.cocoa
GUI.swing

(
var w= GUI.window.new;
w.drawHook= {
1111.postln; //cocoa yes, swing no
};
)

(
var w= GUI.window.new;
var u= GUI.userView.new(w, Rect(0, 0, 10, 10));
u.drawFunc= {
1111.postln; //cocoa yes, swing yes
};
)




   #|
      fredrikolofsson.com     klippav.org     musicalfieldsforever.com
   |#

_______________________________________________
Sc-devel mailing list

_______________________________________________
Sc-devel mailing list



  #|

     fredrikolofsson.com     klippav.org     musicalfieldsforever.com

  |#