Gizmos TreeListCtrl

Hi all,
i've a problem with that widget. I need to catch a double-click on items
inside that tree but seems that i'm only able to catch dclicks into parent
folder. Here's my code (cleaned from unneeded things):

...
self.window_2 = gizmos.TreeListCtrl(self, -1,style = wx.TR_DEFAULT_STYLE |
wx.TR_FULL_ROW_HIGHLIGHT)
...
isz = (16, 16)
il = wx.ImageList(isz[0], isz[1])
self.fldridx = il.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER,
wx.ART_OTHER, isz))
self.fldropenidx = il.Add(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN,
wx.ART_OTHER, isz))
self.fileidx = il.Add(wx.ArtProvider_GetBitmap(wx.ART_REPORT_VIEW,
wx.ART_OTHER, isz))
...
self.window_2.SetImageList(il)
...
self.il = il
...
self.window_2.AddColumn(" ")
...
self.window_2.SetColumnWidth(4,150)
...
self.window_2.GetMainWindow().Bind(wx.EVT_LEFT_DCLICK,self.LISTA_OnClick)
...
self.LIST_Update()

def LIST_Update(self):
# ROOT
    self.classRoot = self.window_2.AddRoot(d["NAME"])
    self.window_2.SetPyData(self.classRoot,d)
    self.window_2.SetItemImage(self.classRoot, self.fldridx, which =
wx.TreeItemIcon_Normal)
    self.window_2.SetItemImage(self.classRoot, self.fldropenidx, which =
wx.TreeItemIcon_Expanded)
# SUBFOLDER
    if d["CLASS"] == "LAVORO":
      self.subClassRoot =
self.window_2.AppendItem(self.classRoot,date_start[2]+"-"+date_start[1]+"-"+date_start[0])
      self.window_2.SetPyData(self.subClassRoot,d)
      self.window_2.SetItemImage(self.subClassRoot, self.fldridx, which =
wx.TreeItemIcon_Normal)
      self.window_2.SetItemImage(self.subClassRoot, self.fldropenidx, which =
wx.TreeItemIcon_Expanded)
# ITEM
    if(d["CLASS"] == "EVENTO"):
      self.classItem =
self.window_2.AppendItem(self.subClassRoot,date_start[2]+"-"+date_start[1]+"-"+date_start[0])
      self.window_2.SetPyData(self.classItem,d)
self.window_2.SetItemText(self.classItem,date_start[3]+":"+date_start[4]+":"+date_start[5],1)
      self.window_2.SetItemImage(self.classItem, self.fileidx, which =
wx.TreeItemIcon_Normal)

def LISTA_OnClick(self,evt):
      pos = evt.GetPosition()
      pos = self.window_2.GetMainWindow().ClientToScreen(pos)
      pos = self.window_2.ScreenToClient(pos)
      item, flags, col = self.window_2.HitTest(pos)
      if item:
          d = self.window_2.GetPyData(item)
            if d["CLASS"] == "EVENTO":

Someone can help me please ?

Oz

···

--
----
O-Zone ! No (C) 2005
WEB @ http://www.zerozone.it
HOBBY @ http://peggy.altervista.org
Call me with FWD: 692329

try to bind directly the gizmos.TreeListCtrl instead of the Window.
ie :
self.window_2.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.__Activated )

def __Activated(self, event):
        """ called when a leaf is activated. ie : double click/enter/space. """
  item = event.GetItem()

  if self.tree.ItemHasChildren(item):
            # parent folder
      if self.tree.IsExpanded(item):
    self.tree.Collapse(item)
      else:
    self.tree.Expand(item)
  else :
      # child
            #your code here

···

On 26/08/05, Michele O-Zone Pinassi <zerozone.liste@gmail.com> wrote:

Hi all,
i've a problem with that widget. I need to catch a double-click on items
inside that tree but seems that i'm only able to catch dclicks into parent
folder. Here's my code (cleaned from unneeded things):

self.window_2 = gizmos.TreeListCtrl(self, -1,style = wx.TR_DEFAULT_STYLE |
wx.TR_FULL_ROW_HIGHLIGHT)
...
self.window_2.GetMainWindow().Bind(wx.EVT_LEFT_DCLICK,self.LISTA_OnClick)

Hi,

i was wondering if anyone on this list can help me with COM specific issues. I am trying (but utterly failing) to translate the code examples from the Google Desktop 2.0 SDK to Python, and would need help regarding the implementation of a COM Server, including a couple of interfaces.

If you feel like this is not a topic for this list, please respond to me in private.

Thanks and best regards,
Christophe Leske