I'm trying to use a custom tag handler along with a wx.HtmlListBox
in a way that I can put some wx.BitmapButtons right on the item
in the list box... heck, why not?
The code does not work if I un-comment the (near the bottom) #self.GetParser().GetContainer().InsertCell(
# wx.html.HtmlWidgetCell(button, 0))
class MyTagHandler(wx.html.HtmlWinTagHandler):
def __init__(self):
wx.html.HtmlWinTagHandler.__init__(self)
def GetSupportedTags(self):
return "MARBLE"
···
#
def HandleTag(self, tag):
bmp = wx.EmptyBitmap(16,16)
container = self.GetParser().GetContainer()
parent = self.GetParser().GetWindowInterface().GetHTMLWindow()
if parent:
button = wx.BitmapButton(parent, -1, bmp, size=(18, 18),
style = wx.NO_BORDER)
# add it to the HtmlWindow #self.GetParser().GetContainer().InsertCell(
# wx.html.HtmlWidgetCell(button, 0))
button.Show(True)
return True
#
#
wx.html.HtmlWinParser_AddTagHandler(MyTagHandler)
The HTML list box itself is inserting the appropriate HTML for each
item in the list...
When I do uncomment the InsertCell call... the Application quits as soon as it
starts. I think it's crashing.
I do know that the TagHandler is being called when the htmlListBox
__init__ does a self.SetItemCount(len(self.marbles))
Any ideas? Is this even remotely possible?
Thanks,
Jim
I'm trying to use a custom tag handler along with a wx.HtmlListBox
in a way that I can put some wx.BitmapButtons right on the item
in the list box... heck, why not?
Here's the simplest example that shows the problem:
commenting out the import wx.lib.wxpTag, or any of the
html snippets that returns a <wxp tag makes it work again.
import wx
import wx.html
import wx.lib.wxpTag
class LogList(wx.HtmlListBox):
def __init__(self, *args, **kwargs):
wx.HtmlListBox.__init__(self, *args, **kwargs)
I'm trying to use a custom tag handler along with a wx.HtmlListBox
in a way that I can put some wx.BitmapButtons right on the item
in the list box... heck, why not?
Here's the simplest example that shows the problem:
commenting out the import wx.lib.wxpTag, or any of the
html snippets that returns a <wxp tag makes it work again.