Opened 7 years ago

Last modified 7 years ago

#4263 closed defect

Update wx.Button docs

Reported by: ftobia Owned by: robind
Priority: normal Milestone:
Component: wxPython Version:
Keywords: Cc: ftobia, robind
Blocked By: Blocking:
Patch: no

Description

In the wxPython docs for wx.Button, there is a list of stock IDs and corresponding labels. All ID/label pairs are correct except for wx.ID_REPLACE, which corresponds to a different label on every platform ('Replace').

I wrote a unit test for the labels based upon the docs. Until the documentation matches the behavior, I think the unit tests should fail.

Also, a spelling error is fixed ('coresponding' -> 'corresponding').

I wasn't able to determine if the ampersand still belongs in the same place.

Attachments (2)

button_docs.patch download (789 bytes) - added by ftobia 7 years ago.
wx.Button docs patch file
StockButtons-gtk.png download (64.7 KB) - added by robind 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by ftobia

wx.Button docs patch file

comment:1 Changed 7 years ago by robind

I don't agree that this is a bug. The intent of the stock buttons is to use whatever labels are standard for the platform. In some cases they are even supplied by the platform and not wx, and in all cases they will be localized in non-english locales and so won't match the docs anyway. I'll make that more clear in the docs.

comment:2 Changed 7 years ago by ftobia

The bug is with the documentation, and not with the implementation. Since the stock label for wx.ID_REPLACE appears to be standardized across all platforms (at least all platforms that have been tested to date), then the docs should reflect this, rather than something erroneous. As it stands, the list on http://www.wxpython.org/docs/api/wx.Button-class.html is out of date. It's better to have no documentation than incorrect documentation. I think the docs should be updated, or the list should be deleted.

Unit testing across non-english locales is another issue entirely.

Last, there is still a typo ("coresponding" -> "corresponding").

Changed 7 years ago by robind

comment:3 Changed 7 years ago by robind

Ok, I'm begining to see your point, however just to throw a wrench in the works take a look at the attached screen shot and you'll see that the label visible to the user may not be the same as what is documented or what is fetched with GetLabel. That is the design of the stock items, so you don't need to worry about the label at all from the programmer's point of view, the platform just does the Right Thing.

I've already fixed that typo and a few others, but it's not yet checked in. I've also added a few missing stock IDs as you can see in the screen-shot.
File Added: StockButtons-gtk.png

Note: See TracTickets for help on using tickets.