Hey Guys
I need a help
I am using thumbnail ctrl object in a splitter window. Now, I want to create a menu on right clicking on any thumbnail
as there is no direct event handler for that, I am trying to use ‘OnMouseUp’ method but not getting succeeded
any ideas how to go about it
thanks
this is the sample code:
from wx import *
import wx.lib.agw.thumbnailctrl as TC
class ASSETLIBUI(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(800,600))
self.explorerPanel = wx.SplitterWindow(self, style = wx.SP_3D | wx.SP_LIVE_UPDATE)
self.thumbPanel = wx.SplitterWindow(self.explorerPanel,style = wx.SP_3D | wx.SP_LIVE_UPDATE)
self.explorer = wx.GenericDirCtrl(self.explorerPanel,dir = 'D:/MyTools/AssetLib/Meshes',style = wx.DIRCTRL_DIR_ONLY)
self.thumbWindow = TC.ThumbnailCtrl(self.thumbPanel,imagehandler = TC.NativeImageHandler)
self.fileWindow = wx.ListCtrl(self.thumbPanel, style=wx.LC_LIST | wx.SP_LIVE_UPDATE)
self.dirSelUpdate = self.explorer.GetTreeCtrl()
self.thumbPanel.SplitHorizontally(self.thumbWindow, self.fileWindow)
self.explorerPanel.SplitVertically(self.explorer,self.thumbPanel)
self.explorerPanel.MinimumPaneSize = 240
self.thumbPanel.MinimumPaneSize = 400
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.onDirSelChanged, id = self.dirSelUpdate.GetId())
self.Centre()
self.Show(True)
def onDirSelChanged(self, event):
curDir = self.explorer.GetPath()
self.thumbWindow.ShowDir(curDir)
def onRightClick(self, evt):
print 'right Clicked'
if __name__ == '__main__':
app = wx.App()
ASSETLIBUI(None, -1, 'Asset Lib')
app.MainLoop()