On Monday 12 December 2005 18:29, Istvan Varga wrote: A few minor corrections (although the example apparently works without these, it may be confusing; see comments below mixed with quoting the original code): > #!/usr/bin/python > > import sys > from Tkinter import * > from ScrolledText import ScrolledText > import csnd > import threading > > cs = csnd.Csound() > > w = ScrolledText(width=80, height=24, foreground='white', background='black') > w.pack() > w.tag_config('warningTag', foreground='white') This should be: w.tag_config('normalTag', foreground='white') > w.tag_config('warningTag', foreground='white', background='blue') > w.tag_config('errorTag', foreground='white', background='red') > w.tag_config('redTag', foreground='red') > w.tag_config('greenTag', foreground='green') > w.tag_config('blueTag', foreground='cyan') > w.tag_config('yellowTag', foreground='yellow') > > def guiThread(): > w.mainloop() > > # create and start a GUI thread > > th = threading.Thread(None, guiThread) > th.start() > > # pyCallbacks is a subclass of CsoundCallbackWrapper that can > # override the methods MessageCallback(), InputValueCallback(), > # OutputValueCallback(), and YieldCallback() for defining callbacks > > class pyCallbacks(csnd.CsoundCallbackWrapper): > def MessageCallback(self, attr, msg): > s = self.CharPtrToString(msg) > if (attr & csnd.CSOUNDMSG_TYPE_MASK) == csnd.CSOUNDMSG_WARNING: > w.insert(END, s, 'warningTag') > elif (attr & csnd.CSOUNDMSG_TYPE_MASK) == csnd.CSOUNDMSG_ERROR: > w.insert(END, s, 'errorTag') > elif (attr & csnd.CSOUNDMSG_FG_COLOR_MASK) == csnd.CSOUNDMSG_FG_RED: > w.insert(END, s, 'redTag') > elif (attr & csnd.CSOUNDMSG_FG_COLOR_MASK) == csnd.CSOUNDMSG_FG_YELLOW: > w.insert(END, s, 'yellowTag') > elif (attr & csnd.CSOUNDMSG_FG_COLOR_MASK) == csnd.CSOUNDMSG_FG_GREEN: > w.insert(END, s, 'greenTag') > elif (attr & csnd.CSOUNDMSG_FG_COLOR_MASK) == csnd.CSOUNDMSG_FG_BLUE: > w.insert(END, s, 'blueTag') > else: > w.insert(END, s, 'miscTag') Replace this line with: w.insert(END, s, 'normalTag') ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net