On Nov 16, 2007 8:47 AM, Hakki Dogusan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is it possible to extend wxArtProvider in wxLua? wx's document shows
> following sample:
>
>    class MyProvider : public wxArtProvider
>    {
>    protected:
>      wxBitmap CreateBitmap(const wxArtID& id,
>                            const wxArtClient& client,
>                            const wxSize size)
>      { ... }
>    };
>    ...
>    wxArtProvider::Push(new MyProvider);
>

Unfortunately not, a class like wxLuaPrintout that allows overriding
virtual functions would have to be written. I'll try to remember to do
it.

There's a general issue about creating our own classes to allow
overriding virtual functions however, if we continue to create more
and more of them we'll end up with a lot of wxLuaXXX classes on top of
the original XXX classes and that seems awkward to me since you
shouldn't have to worry about such things in wxLua. It could be made
transparent by calling them just XXX in Lua, but I think this could be
a problem if you call a function that returns an XXX class, but wxLua
only deals with our subclassed wxLuaXXX classes.

For example: We write wxLuaTreeCtrl so we can override
OnCompareItems(...) in Lua and as above treat all wxTreeCtrls as
wxLuaTreeCtrls. Everything is great if all wxTreeCtrls are created in
wxLua since they'll all be wxLuaTreeCtrls. There's a problem if a user
uses wxGlade (or whatever) to create XML files for their GUI and then
they try to get their wxTreeCtrl, but wxLua pushes it as a
wxLuaTreeCtrl which it's not. The wxGenericDirCtrl creates it's own
wxTreeCtrl which you can get using wxGenericDirCtrl ::GetTreeCtrl(),
same problem as above.

I guess I have to look at wxPython to see how they handle this since I
know that they subclass quite a few things. Unless maybe someone else
knows?

Regards,
    John

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to