From: Nadja Lederer (nadja_lederer_at_gmx.at)
Date: Thu Nov 27 2008 - 10:09:53 CST

Hi Jan,

I tried both of your suggestions and though copying the multiplot-script and "sourcing" it after vmd-startup worked more easily, I didn't really want to manipulate the multiplot-script. So I rather tried out your example of overriding the print_datapoint method and it works fine! Thank you very much!!

cheers,
nadja

-------- Original-Nachricht --------
> Datum: Wed, 26 Nov 2008 14:46:46 -0600
> Von: Jan Saam <saam_at_ks.uiuc.edu>
> An: Nadja Lederer <nadja_lederer_at_gmx.at>
> CC: vmd-l_at_ks.uiuc.edu
> Betreff: Re: vmd-l: multiplot: control reaction for click on datapoints?

> Hi Nadja,
>
> I suppose you cannot edit the script because you don't have sysadmin
> right for the VMD installation on the machine you are using.
> TCL uses whatever procedure of a given name name was loaded last. It
> will be somewhat difficult to just override the print_datapoint function
> because it exists in a certain namespace that was autogenerated for the
> instance of multiplot that you are using. for the next plot it is going
> to be a different one. That's why you can have several independent
> instances of multiplot running (hence the name multiplot) and that's why
> it returns you a plothandle so that you can manipulate different plots
> individually.
> You can inquire the namespace for a given instance by
> $plothandle namespace
> You could then create a function in that same namespace overriding the
> existing one:
> [$plothandle namespace]::print_datapoint {x y} {
> # whatever you want to be done here.
> }
>
> Maybe an easier solution would be to just make a copy of the whole
> multiplot.tcl script and source it _after _ the VMD startup:
> source nadjas_multiplot.tcl
> Then all the procedure in multiplot should be overridden by yours.
> You can hack that script to your liking.
>
> I hope that helps,
> Jan
>
> Nadja Lederer wrote:
> > Hey Jan,
> >
> > I tried to change the procedure directly in this multiplot plugin, but
> the problem is that I can't perform or save any changes to this script which
> is situated somewhere within the vmd-folders. Do you think I could maybe
> include this print_datapoint method somewhere within my own tcl-script, so
> that the program doesn't use the method from this multiplot-plugin, but
> rather go into my "overriden print_datapoint"-method?? (I'm not too far
> experienced with tcl by now, unfortunately)
> >
> > cheers,
> > nadja
> >
> >
> > -------- Original-Nachricht --------
> >
> >> Datum: Wed, 26 Nov 2008 12:35:35 -0600
> >> Von: Jan Saam <saam_at_ks.uiuc.edu>
> >> An: Nadja Lederer <nadja_lederer_at_gmx.at>
> >> CC: vmd-l_at_ks.uiuc.edu
> >> Betreff: Re: vmd-l: multiplot: control reaction for click on
> datapoints?
> >>
> >
> >
> >> Nadja,
> >>
> >> there's a procedure called print_datapoint in multiplot.tcl. It is
> >> called whenever the mouse is over a data point. This callback is set up
> >> at the end of procedure plot_data (the line starting with "$c bind
> >> point").
> >> You can either set this callback up with your own function to call or
> >> you modify print_datapoint.
> >>
> >> Cheers,
> >> Jan
> >>
> >> Nadja Lederer wrote:
> >>
> >>> Hey Jan,
> >>>
> >>> I would be really nice if you could help me with that. I want to give
> it
> >>>
> >> a try. I was looking through the multiplot tcl script today but I
> didn't
> >> really know where to start or modify. Can I just override one of those
> >> methods used in that script?
> >>
> >>> Regards,
> >>> Nadja
> >>>
> >>>
> >>> -------- Original-Nachricht --------
> >>>
> >>>
> >>>> Datum: Wed, 26 Nov 2008 10:12:20 -0600
> >>>> Von: saam <saam_at_ks.uiuc.edu>
> >>>> An: "Nadja Lederer" <nadja_lederer_at_gmx.at>
> >>>> CC: vmd-l_at_ks.uiuc.edu
> >>>> Betreff: Re: vmd-l: multiplot: control reaction for click on
> >>>>
> >> datapoints?
> >>
> >>>>
> >>>>
> >>>
> >>>
> >>>> Hi Nadja,
> >>>>
> >>>> in principle it is possible, but you would have to do some hacking of
> >>>> the multiplot TCL-script. If you are comfortable enough with TCL and
> >>>> if you want to do it, let me know. I could then point yo to the right
> >>>> function to modify.
> >>>>
> >>>> Jan
> >>>>
> >>>> On Wed, Nov 26, 2008 at 2:34 AM, Nadja Lederer <nadja_lederer_at_gmx.at>
> >>>> wrote:
> >>>>
> >>>>
> >>>>> hello.
> >>>>>
> >>>>> I'm using multiplot to draw a two-dimensional plot and have
> datapoints
> >>>>>
> >>>>>
> >>>> configured. So, whenever I go over one of those points coordinates
> are
> >>>> printed on the console. Is there any way I can control this reaction,
> >>>>
> >> such as
> >>
> >>>> invoke another procedure when a click on one of those datapoints is
> >>>> performed?
> >>>>
> >>>>
> >>>>> regards,
> >>>>> nadja
> >>>>> --
> >>>>> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> >>>>>
> >>>>>
> >>>> allen: http://www.gmx.net/de/go/multimessenger
> >>>>
> >>>>
> >>>
> >>>
> >> --
> >>
> >> ****************************************
> >> Jan Saam
> >> Theoretical and Computational Biophysics Group
> >> 3061 Beckman Institute
> >> University of Illinois
> >> 405 N. Mathews Ave
> >> Urbana, IL 61801
> >>
> >> Phone: (217) 244-1928
> >> Fax: (217) 244-6078
> >> saam_at_ks.uiuc.edu
> >>
> >>
> >
> >
>
>
> --
>
> ****************************************
> Jan Saam
> Theoretical and Computational Biophysics Group
> 3061 Beckman Institute
> University of Illinois
> 405 N. Mathews Ave
> Urbana, IL 61801
>
> Phone: (217) 244-1928
> Fax: (217) 244-6078
> saam_at_ks.uiuc.edu
>

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger