[ROOT] Python + ROOT: getting a window ID

From: Brett Viren (bv@bnl.gov)
Date: Wed Oct 06 2004 - 17:34:05 MEST


I want to try to embed a TGWindow in a pygtk application.  To do this
I first need the window ID.  I'm able to get this from CINT via:

root [0] TCanvas c("c","canvas",500,400)
root [1] i = c.GetCanvasImp()
root [2] w = (TGWindow*)i
root [3] w->GetParent()->GetId()
(const unsigned long)46137404

I confirmed with "xwininfo" that this is the correct ID number.

Naively I tried the following in Python:

>>> from ROOT import *
>>> c = TCanvas("c","canvas",500,400)
>>> i = c.GetCanvasImp()
>>> i
<__main__.TCanvasImp object at 0x41d1ca4c>
>>> w = TGWindow(i)
>>> w
<__main__.TGWindow object at 0x41d1cecc>
>>> w.GetParent.GetId()
unsupported return type (unsigned long), returning void
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: return type in method not handled

So, assuming that unsigned long is the window id, it seems that it
almost works.

Any ideas?


PS: ROOT v4-00-08e, Python 2.3.2, GCC 3.3.3, Debian x86.

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET