How to focus a plot window?

Hi all,

Does anyone know how I can focus a plot window? Do I need to put the plot in a window? Here is an example.

Thanks!
//This doesn’t work - ERROR: Message ‘front’ not understood
~plot1 = Signal.newClear(2048/2).plot;
~plot1.front;
~plot1.alwaysOnTop_(true);
~plot1.alwaysOnTop_(false);

// But this does
~window1 = Window(“window1”, Rect(20, 30, 520, 450));
~window1.front;
~window1.alwaysOnTop_(true);
~window1.alwaysOnTop_(false);

In the first example, you’re not passing in a window to the method so the object (I think it’s a Plot or Plotter but don’t remember) doesn’t have a method. You have to pass the plot’s parent window to .alwaysOnTop_(true)

FWIW .front just makes the window visible. It doesn’t focus it.

Ah thanks, oh yeah of-course trying to get the signal go to the front isn’t going to work :rofl: that was a bad idea of mine. Do you know how I access the plot? I just want my midi controller to be able to switch between different plots.

Thanks again

You could plot in the midi message and then also close the other windows in the same midi message if you want a new window each time.

JS

The parent view (a Window in this case) of Plotter is stored in the .parent method. Try ~plot1.parent.front;.