Example of using wx.HtmlCell's Find method?

The wxPython documentation says that the recommended way to get a pointer to a particular HtmlCell is to use the Find method but I don’t understand how to use it with a user-defined condition. Could someone give me an example, or tell me where I could find one?

Thanks,
Patrick Maher
http://patrick.maher1.net

Patrick Maher wrote:

The wxPython
documentation
says that the recommended way to get a
pointer to a particular HtmlCell is to use the Find method but I
don’t understand how to use it with a user-defined condition.
Could someone give me an example, or tell me where I could find
one?

I believe that the user-defined condition has to be implemented by

the cell itself. That is, this is not a general-purpose search.
Instead, this calls “find” in all of the cells until one of the
cells responds. The only cell type that responds right now is the
anchor cell.

So, in order to use this to find a particular cell, you would have

to modify that cell’s class to respond to “find” in the appropriate
way. That makes it not very useful. In general, you’ll need to
enumerate through the tags with GetFirstChild and GetNext.

···
-- Tim Roberts, Providenza & Boekelheide, Inc.

timr@probo.com

I am stuck a little with replacing the tree pane in AUI demo with a
CheckListCtrl

Evthg works fine but I do not know how to access/ return a dict/ a
variable to my AuiFrame clas from where I am calling CheckListCtrl.

What I do:
I added the CheckListCtr class following the demo to my application
My main application frame is an AuiFrame. there I am calling
CheckListCtrl. All works fine.
I bound an event OnCheckItem to when an item is checked whick triggers
some database stuff and creates a dictionary.
I now want to return this dict to my AuiFrame since I want to create a
new notebook tab d�from it (remember: I am using AUi demo as a basis).

How can I do that?

ThanX

class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin):
    def __init__(self, parent):
        wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
        CheckListCtrlMixin.__init__(self)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)

    def OnItemActivated(self, evt):
        self.ToggleItem(evt.m_itemIndex)
   
    def OnCheckItem(self, index, flag):
        if flag:
            # ... do some database stuff and get a dictionary as result
          
# based on AUI demo ....

class AuiFrame(wx.Frame):

    def __init__(self, parent, id=wx.ID_ANY, title="OKI OPO Tool", pos=
wx.DefaultPosition,
                 size=(800,600),
style=wx.DEFAULT_FRAME_STYLE|wx.SUNKEN_BORDER, log=None):

        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self._mgr = aui.AuiManager()

        # tell AuiManager to manage this frame
        self._mgr.SetManagedWindow(self)
        auiframeinstance = self

        # set frame icon
        #self.SetIcon(images.Mondrian.GetIcon())
        iconfile=art_image.icon.GetIcon()
        self.SetIcon(iconfile)
        # maximize the window
        self.Maximize(1)

### .............. etc ...

     def CreateProductsCheckListCtrl(self):

        list = CheckListCtrl(self)
        sizer = wx.BoxSizer()
        sizer.Add(list,0, wx.EXPAND)
        sizer.Add(btn,0,wx.EXPAND )
        self.SetSizer(sizer)

        list.InsertColumn(0, "Modell)
        #### ... etc

SORRY - I totally neglected the fact that I can access the AuiFrame
through the parent handler and call a function there etc (i.e.
AuiFrame.HandDict(self.parent, self, my_dict) )

ThanX

···

Am 20.09.11 22:57, schrieb Tobias Weber:

I am stuck a little with replacing the tree pane in AUI demo with a
CheckListCtrl

Evthg works fine but I do not know how to access/ return a dict/ a
variable to my AuiFrame clas from where I am calling CheckListCtrl.

What I do:
I added the CheckListCtr class following the demo to my application
My main application frame is an AuiFrame. there I am calling
CheckListCtrl. All works fine.
I bound an event OnCheckItem to when an item is checked whick triggers
some database stuff and creates a dictionary.
I now want to return this dict to my AuiFrame since I want to create a
new notebook tab d惠rom it (remember: I am using AUi demo as a basis).

How can I do that?

ThanX

class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin):
    def __init__(self, parent):
        wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT)
        CheckListCtrlMixin.__init__(self)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)

    def OnItemActivated(self, evt):
        self.ToggleItem(evt.m_itemIndex)
   
    def OnCheckItem(self, index, flag):
        if flag:
            # ... do some database stuff and get a dictionary as result
          
# based on AUI demo ....

class AuiFrame(wx.Frame):

    def __init__(self, parent, id=wx.ID_ANY, title="OKI OPO Tool", pos=
wx.DefaultPosition,
                 size=(800,600),
style=wx.DEFAULT_FRAME_STYLE|wx.SUNKEN_BORDER, log=None):

        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self._mgr = aui.AuiManager()

        # tell AuiManager to manage this frame
        self._mgr.SetManagedWindow(self)
        auiframeinstance = self

        # set frame icon
        #self.SetIcon(images.Mondrian.GetIcon())
        iconfile=art_image.icon.GetIcon()
        self.SetIcon(iconfile)
        # maximize the window
        self.Maximize(1)

### .............. etc ...

     def CreateProductsCheckListCtrl(self):

        list = CheckListCtrl(self)
        sizer = wx.BoxSizer()
        sizer.Add(list,0, wx.EXPAND)
        sizer.Add(btn,0,wx.EXPAND )
        self.SetSizer(sizer)

        list.InsertColumn(0, "Modell)
        #### ... etc