[plt-scheme] change-style

From: Romain (romain.legendre at gmail.com)
Date: Tue Jul 5 14:57:08 EDT 2005


I have a problem with the 299.106 version of DrScheme.
I want to insert some text in the definitions window, so I did

(send definitions-text insert "something"  0 'same #t)

And then I want to color this.
So I did

(send definitions-text change-style (send (make-object style-delta%)
set-delta-background color) 0 9))

And sometimes it works, and most of the time DrScheme tells me

sequence-contract-violation: negative: method change-style cannot be
called, except in states (unlocked), args #<struct:style%> 9 10 #f

I tried to wrap the color code with

(send definitions-text can-change-style?)
(send definitions-text is-locked?)
(send definitions-text  locked-for-flow?)
(send definitions-text  locked-for-read?)
(send definitions-text  locked-for-write?)

and they all said that I can change the style, but I still get the error.

Thanks in advance for your help.


Posted on the users mailing list.