Making wxSimpleHelpProvider more useful

Just for what it's worth, editing line 109 of wxPython/src/help.i (wxWindows
2.4.0.7) to read

    bool ShowHelp(wxWindow *window);

And then compiling wxPython (making sure to run SWIG), gets you
HelpProviders where ShowHelp can be called.

This solves a lot of my problems. Making ShowHelp overrides work would make
me highly happy,

S.

···

-----Original Message-----
From: Sean Slattery [mailto:Sean.Slattery@aprsmartlogik.com]
Sent: Monday, May 12, 2003 12:11 PM
To: 'wxPython-users@lists.wxwindows.org'
Subject: [wxPython-users] Making wxSimpleHelpProvider more useful

wxSimpleHelpProvider seems to have the following two
unfortunate properties

1) ShowHelp takes a wxWindowBase* which wxPython doesn't seem
to know how to
generate from a wxWindow
2) ShowHelp can't be overridden (wxPython silently ignores
any override
definition)

I was pondering making a wxPySimpleHelpProvider in the style
of lots of
other classes, and using {DEC,IMP}_PYCALLBACK* macros to get
the override
behaviour. My current problem is that wxHelpProvider doesn't
inherit from
wxObject, which causes the following macro:

IMPLEMENT_DYNAMIC_CLASS(wxPySimpleHelpProvider, wxSimpleHelpProvider);

to fail on compliation with

src\msw\help.cpp(99) : error C2440: 'return' : cannot convert
from 'class
wxPySimpleHelpProvider *' to 'class wxObject *'
        Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
error: command '"C:\Program Files\Microsoft Visual
Studio\VC98\BIN\cl.exe"'
failed with exit status 2

Does the fact that wxHelpProvider is not a wxObject fatally sink this
approach?

Right now I'm thinking of just making ShowHelp take a
wxWindow* and casting
- think that might work and would get me past problem 1)
above, which is the
most serious for my application.

Any comments appreciated,

S.

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Sean Slattery wrote:

Just for what it's worth, editing line 109 of wxPython/src/help.i (wxWindows
2.4.0.7) to read

    bool ShowHelp(wxWindow *window);

And then compiling wxPython (making sure to run SWIG), gets you
HelpProviders where ShowHelp can be called.

Oops, sorry for missing those.

This solves a lot of my problems. Making ShowHelp overrides work would make
me highly happy,

behaviour. My current problem is that wxHelpProvider doesn't inherit from
wxObject, which causes the following macro:

IMPLEMENT_DYNAMIC_CLASS(wxPySimpleHelpProvider, wxSimpleHelpProvider);

Since it is not a wxObject then you don't need the dynamic class stuff, it is for the wxRTTI. wxPython only needs the wxRTTI in order to create instances of the right type for function return values, so it won't hurt anything in this case.

So if you want to continue to try and get it working (sounds like you are close) then I'll take a patch. If you can also provide some use of it in the demo I'll appreciate it.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!