[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] limit window constraints?
Thor,
I didn't create my own font--I'm just using Pen's string methods:
(
w = GUI.window.new;
v = GUI.userView.new(w, w.view.bounds).background_(Color.yellow).resize_(5);
v.drawFunc = {
8.squared.do({ arg i; GUI.pen.stringAtPoint("monkey",
(v.bounds.width/8 * (i % 8))@(v.bounds.height/8 * (i div: 8))
) });
};
w.front;
bench({v.drawFunc}).asFraction
)
This admittedly simple example takes around 1/500,000 of a second to
run on my macbook. It seems like a similar approach could work for the
Spectrogram window.
Chad
On Mon, Mar 16, 2009 at 2:47 AM, thor <th.list@xxxxxxxxx> wrote:
>
> On 15 Mar 2009, at 23:52, Chad Kirby wrote:
>
>> As far as I know, the only way to re-scale the text on the left in the
>> Spectrogram window would be to draw the text with Pen and
>> algorithmically lay it out depending on the window bounds. That's what
>> I do in my app.
>
> Which app is that?
> But have you benchmarked how much processing it takes to draw
> that? In Spectrogram I'm drawing 24 frames per second and I'd rather
> not draw text with Pen. (the thought of it makes me dizzy anyway : )
> did you create your own font?)
>
>
>> My little resize control doesn't address anything like
>> that. It's just a one-trick pony--lets you set limits on the size of
>> the window--for certain windows.
>
> I know. I was just pointing out that there is a need for looking at this in
> Window.
>
>
> cheers
> thor
>
>
>
>>
>>
>> Chad
>>
>> On Sun, Mar 15, 2009 at 1:58 PM, thor <th.list@xxxxxxxxx> wrote:
>>>
>>> On 15 Mar 2009, at 20:35, Chad Kirby wrote:
>>>
>>>> As for the drawHook, it's just there to draw the diagonal lines in the
>>>> control. You could do it without the drawHook--just remove the Pen
>>>> stuff and set the background of the SCUserView to a color that
>>>> contrasts with the window background so the user can see to click in
>>>> the corner.
>>>
>>> I wasn't talking about the drawHook in your code. I was pointing out that
>>> if you want to rearrange a window on its resize, you can't do it properly
>>> unless
>>> putting things into a drawHook, thus my suggestion of .onResize({})
>>>
>>> If you check the SpectrogramWindow Quark, you'll see what I mean. The
>>> frequencies
>>> on the left (StaticText) cannot be rearranged on resize. Or at least I
>>> can't
>>> see the
>>> way to do that.
>>>
>>>
>>>
>>> _______________________________________________
>>> sc-users mailing list
>>>
>>> info (subscription, etc.):
>>> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>>> archive: https://listarc.bham.ac.uk/marchives/sc-users/
>>> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.):
>> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-users/
>> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.):
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/