Subject: Re: [nmr_sparky] Re: Sparky peak ornament and label selection
From: Han Feng
Date: Jun 11, 2006

Previous: 164 Next: 167


Hi All,
I just tried to install Sparky in my Macintosh.
It seems I got trouble. When I click the Sparky 3.112,
I have icon like Target with cross at the center, it
always shows you have to open the X11 window first,
then issue Sparky. But I did, it simply doesnt work.
Could you please tell me whats wrong and how to fix
it.

Thank you very much.

Hanqiao

NCI/NIH


--- Thomas Goddard goddard@... wrote:


From: J. Bradley Dickerson
john.dickerson@...
To: Thomas Goddard goddard@...
Date: Fri, 09 Jun 2006 09:58:11 -0500

HI Tom,

I think that I may have answered this question for
me a few years ago
but I cant find your email reply.

I would like to be able to select the peak label
along with the peak
ornament so that when I change the color of a
group of peaks in a
spectra the label color also changes.


Thanks for your time,
Bradley


Hi Bradley,

Yes I wrote some Python code to put in your
sparky_init.py file to
address this in March 2003. Unfortunately it has
not been included in
the standard Sparky distribution. Here is the code
to add shortcut lS
that selects all labels corresponding to selected
peaks. Make sure not to
change the indentation as that is important in
Python.

Tom

-------
Code for command lS follows:

#

-----------------------------------------------------------------------------
# Put this in ~/Sparky/Python/sparky_init.py.
# This file is read and the initialize_session()
function is called
# when Sparky starts.
#
def initialize_session(session):

def select_labels(s=session):
select_labels_of_selected_peaks(s)

session.add_command(lS, Select labels of
selected peaks (lS),
select_labels)

#

-----------------------------------------------------------------------------
# Select the labels of the currently selected peaks.
#
def select_labels_of_selected_peaks(session) :

peaks = session.selected_peaks()
#
# If you want to unselect everything except the
labels you could uncomment
# the following line.
#
# session.unselect_all_ornaments()
for p in peaks:
if p.label != None:
p.label.selected = 1



------------------------ Yahoo! Groups Sponsor
--------------------~--
Get to your groups with one click. Know instantly
when new email arrives

http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/cEYolB/TM

--------------------------------------------------------------------~-



Yahoo! Groups Links


nmr_sparky-unsubscribe@yahoogroups.com







__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com