Re: Can TPad::AddExec call a method in PyROOT?

From: OKUMURA, Akira <oxon_at_mac.com>
Date: Tue, 13 Dec 2011 18:37:57 +0900


Hello Wim,

Thanks a lot. It is working.

One more question. How can I kill the '(Bool_t)1' output by $ROOTSYS/pyroot/DynamicSlice.py ?

Regards,

--
OKUMURA, Akira oxon_at_mac.com, okumura_at_stelab.nagoya-u.ac.jp
Solar-Terrestrial Environment Laboratory, Nagoya University
Furo-cho, Chikusa-ku, Nagoya 464-8601, Japan
TEL: +81 52-789-4320 FAX: +81 52-789-4313
Skype : okumura.akira

On 2011/12/13, at 9:01, WLavrijsen_at_lbl.gov wrote:


> Akira,
>
>> I wrote a Python class which has a TCanvas as a member, and a method which >> is intended to do some calculations according to the mouse cursor position, >> as in $ROOTSYS/tutorials/pyroot/DynamicSlice.py
>
> the tutorial makes use of finding the callable from the global space, and then
> calling it. Python methods can be bound, and then passed around as objects.
>
>> -------------- >> class MyClass(object): >> def __init__(self): >> self.can = ROOT.TCanvas() >> self.can.AddExec('dynamic', ???) # how to call self.doSomething ?
>
> Something like:
>
> import __main__
> __main__.doSomething = self.doSomething
> self.can.AddExec( 'dynamic', 'TPython::Exec( "doSomething()" )' )
>
> Not particularly pretty, but should work.
>
> Best regards,
> Wim
> --
> WLavrijsen_at_lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
>
Received on Tue Dec 13 2011 - 10:38:18 CET

This archive was generated by hypermail 2.2.0 : Tue Dec 13 2011 - 23:50:01 CET