wxWindow::SetHelpTextForId()

Vaclav Slavik vslavik at fastmail.fm
Sun Mar 2 07:57:06 PST 2008


Hi,

are there any objections to deprecating wxWindow::SetHelpTextForId()? 
It's not documented (fortunately), not used anywhere in wx and is 
somewhat weird (I certainly got confused by it when trying to fix 
unrelated bug in wxHelpProvider+SetHelpText).

It's purpose apparently is to add help text for a standard ID rather 
than particular control, which is perfectly reasonable thing to do. 
But it's not static method, it sets help text for all windows with 
the same ID that the window you call it on:

  cancelButton->SetHelpTextForID("cancel the dialog");

Although you can deduce what it does from the name, the syntax is 
misleading, it indicates it's an operation on cancelButton, while 
it's in fact not [only]. And it requires you to have an instance of 
window with desired ID first.

Better API would at the very least use static wxWindow method. But in 
fact it's already possible to do it in a way that is both perfectly 
clear and doesn't need any helper objects:

  wxHelpProvider::Get()->AddHelp(wxID_CANCEL, "cancel the dialog");

So is it OK to deprecate SetHelpTextForID with explanation that the 
above should be used instead?

thanks,
Vaclav

-- 
PGP key: 0x465264C9, available from http://pgp.mit.edu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20080302/d2f4871f/attachment.pgp


More information about the wx-dev mailing list