If you&#39;re just talking about something like this (ascii art) drawing:<br><br>--------------------------------------------------------------------------------------------<br>1:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * * * * * * * *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br>
<br>0:&nbsp; * * * *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * * * * * * * *&nbsp;&nbsp; * * * * * * * <br>---------------------------------------------------------------------------------------------<br><br>Then I think you have a relatively simple alternative for a UI:<br>
<br>Create a scrollable UI in the toolkit of your choice. It scrolls left to right. Make a series of radiobutton selections with all of the UI components matching the background color. That way you only get the actual clickable dots. Then your users can click on the dot to move it to the opposite position (by overriding the on-click handler).<br>
<br>A rough tkinter solution without scrolling, the selection buttons removed, or the switching logic follows this reply. You can make the following nicer by rewriting the click command, and you can probably find a way to make tkinter hide the empty circles or use a different toolkit to implement the same idea. You should be able to put an X axis in to show time or whatever dimension your data is over.<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp; --Michael<br><br>from Tkinter import *<br><br>def createDataPoint(master,var):<br>&nbsp; rb1 =Radiobutton(master,borderwidth=0,foreground=&#39;red&#39;,background=&#39;white&#39;,variable=var,value=1)<br>&nbsp; rb1.grid()<br>
&nbsp; rb2=Radiobutton(master,borderwidth=0,foreground=&#39;red&#39;,background=&#39;white&#39;,variable=var,value=0)<br>&nbsp; rb2.grid()<br><br>class Application(Frame):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __init__(self, master=None,data=[1]):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Frame.__init__(self, master)&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.grid()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.data = data<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.createWidgets()<br><br>&nbsp;&nbsp;&nbsp; def show(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = []<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for each in self.ivlist:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l.append(each.get())<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print(l)<br><br>&nbsp;&nbsp;&nbsp; def createWidgets(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.showButton = Button ( self, text=&quot;Show&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command=self.show )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.showButton.grid(row=0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.ivlist = []&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i in range(len(self.data)):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iv = IntVar(value=self.data[i])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.ivlist.append(iv)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f = Frame(self)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f.grid(column=i+1,row=1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; createDataPoint(f,iv)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br><br><br>if &quot;__main__&quot;==__name__:<br>&nbsp; data = [1,0,1,0,1,1,1,1,0,1]<br>&nbsp; app = Application(data=data)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; app.master.title(&quot;Flippin DOTS&quot;) <br>
&nbsp; app.mainloop()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br><br><br><br><br><br><div class="gmail_quote">On Thu, Mar 27, 2008 at 6:54 PM, David Perlman &lt;<a href="mailto:dperlman@wisc.edu">dperlman@wisc.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am thinking about writing a program which will involve, among other<br>
things, displaying a plot of a series of numbers. &nbsp;The idea is that<br>
you could click on the points and move them to change the numbers.<br>
Reverse-plotting, I suppose. &nbsp;It need not be complex; the numbers<br>
will all be zero or one, and it&#39;s only necessary to flip the bits, so<br>
click-and-drag is seriously overkill. &nbsp;Really it would be better to<br>
just double-click on a point to switch it from one value to the other.<br>
<br>
Can anyone point me in the right direction? &nbsp;I have written some<br>
programs in python before, including TKinter, but this new project is<br>
beyond the point that I know where to even start looking. &nbsp;:)<br>
<br>
In case you care, the application is in functional brain imaging; the<br>
brain scans generate a certain number of time points (say 500) and<br>
then the motion of the subject is also calculated. &nbsp;Standard practice<br>
is to generate a &quot;censor&quot; file composed of zeros and ones, where zero<br>
indicates that that time point had excessive motion and must be<br>
disregarded. &nbsp;I want to display a graph of the motion over time, and<br>
allow quick and easy interactive editing of the censor time series in<br>
visual parallel to the motion graph. &nbsp;This would save a lot of time;<br>
at present everyone does this in Excel, which being a horrible<br>
Windows program can&#39;t be integrated into the predominantly UNIX-based<br>
processing pipeline. &nbsp;And in any case, it requires manually typing<br>
all the zeros, looking back and forth between the graph of motion and<br>
the list of numbers.<br>
<br>
I have already written a program to algorithmically generate the<br>
censor time series from the motion data, but it is absolutely<br>
essential to be able to manually double-check and if necessary make<br>
minor edits. &nbsp;I&#39;d like to be able to keep that functionality in<br>
Python rather than sending everyone back to Excel... &nbsp;if possible!<br>
<br>
Thanks very much for any help.<br>
<br>
--<br>
-dave----------------------------------------------------------------<br>
&quot;Pseudo-colored pictures of a person&#39;s brain lighting up are<br>
undoubtedly more persuasive than a pattern of squiggles produced by a<br>
polygraph. &nbsp;That could be a big problem if the goal is to get to the<br>
truth.&quot; &nbsp;-Dr. Steven Hyman, Harvard<br>
<br>
<br>
<br>
_______________________________________________<br>
Tutor maillist &nbsp;- &nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Michael Langford<br>Phone: 404-386-0495<br>Consulting: <a href="http://www.RowdyLabs.com">http://www.RowdyLabs.com</a>