Where can i find a documentation that shows the methods of all the
wxpython widgets??
recently I was looking for a method to change the choices of a
wx.choice, and the wxWigets doc page was the first result on google, but
the method was "Set()" and it gave me an error..
After a minute googling I found this post [1] and clear my doubt (in
python the method is "SetItems()")
I know that google and patience can clear my doubts, but if theres any
documentation about the widgets methods it will be better
PS: the guy that anwser in the post of the link, says that the HTML
documentation of wxpython shows that, but I didnt find it :S. If the doc
is this one [2] it actually didnt show the methods of wx.choice
[1] http://www.manning-sandbox.com/thread.jspa?threadID=23650&tstart=45
[2] http://www.wxpython.org/docs/api/wx.Choice-class.html
--------------------------------------------------
From: "Fidel Sanchez-Bueno" <fidel...@gmail.com>
Sent: Friday, August 13, 2010 8:28 AM
To: <wxPytho...@googlegroups.com>
Subject: [wxPython-users] wxpython documentation
> Hello..
>
> Where can i find a documentation that shows the methods of all the
> wxpython widgets??
>
>
> recently I was looking for a method to change the choices of a wx.choice,
> and the wxWigets doc page was the first result on google, but the method
> was "Set()" and it gave me an error..
>
> After a minute googling I found this post [1] and clear my doubt (in
> python the method is "SetItems()")
>
> I know that google and patience can clear my doubts, but if theres any
> documentation about the widgets methods it will be better
>
> PS: the guy that anwser in the post of the link, says that the HTML
> documentation of wxpython shows that, but I didnt find it :S. If the doc
> is this one [2] it actually didnt show the methods of wx.choice
There are 2 possible ways for you to access the information:
(1) The wxWidgets documentation that you can download as a part of the Docs
and Demos package at
http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-docs-demos-2.8.11.0.exe -
just remember three things when using it - a) wx.Choice will be found as
wxChoice, b) Always look at the end of the method description for any python
specific notes & c) if what you need is not documented there then look at
the class(es) that the widget is derived from and the 'See also' section.
(2) Open a python shell and use the dir and help commands for the object,
e.g. if you type:
import wx
C=wx.Choice
dir(C)
you get:
['AcceleratorTable', 'AcceptsFocus', 'AcceptsFocusFromKeyboard', 'AddChild',
'Ad
dPendingEvent', 'AdjustForLayoutDirection', 'Alignment', 'Append',
'AppendItems'
, 'AssociateHandle', 'AutoLayout', 'BackgroundColour', 'BackgroundStyle',
'BestS
ize', 'BestVirtualSize', 'Bind', 'Border', 'CacheBestSize',
'CanSetTransparent',
'CaptureMouse', 'Caret', 'Center', 'CenterOnParent', 'Centre',
'CentreOnParent'
, 'CharHeight', 'CharWidth', 'Children', 'ClassName', 'Clear',
'ClearBackground'
, 'ClientAreaOrigin', 'ClientRect', 'ClientSize', 'ClientToScreen',
'ClientToScr
eenXY', 'ClientToWindowSize', 'Close', 'Command', 'Connect', 'Constraints',
'Con
tainingSizer', 'ConvertDialogPointToPixels', 'ConvertDialogSizeToPixels',
'Conve
rtPixelPointToDialog', 'ConvertPixelSizeToDialog', 'Count', 'Create',
'CurrentSe
lection', 'Cursor', 'DLG_PNT', 'DLG_SZE', 'DefaultAttributes', 'Delete',
'Destro
y', 'DestroyChildren', 'Disable', 'Disconnect', 'DissociateHandle',
'DragAcceptF
iles', 'DropTarget', 'EffectiveMinSize', 'Enable', 'Enabled',
'EventHandler', 'E
vtHandlerEnabled', 'ExtraStyle', 'FindFocus', 'FindString',
'FindWindowById', 'F
indWindowByLabel', 'FindWindowByName', 'Fit', 'FitInside', 'Font',
'ForegroundCo
lour', 'Freeze', 'GetAcceleratorTable', 'GetAdjustedBestSize',
'GetAlignment', '
GetAutoLayout', 'GetBackgroundColour', 'GetBackgroundStyle',
'GetBestFittingSize
', 'GetBestSize', 'GetBestSizeTuple', 'GetBestVirtualSize', 'GetBorder',
'GetCap
ture', 'GetCaret', 'GetCharHeight', 'GetCharWidth', 'GetChildren',
'GetClassDefa
ultAttributes', 'GetClassName', 'GetClientAreaOrigin', 'GetClientData',
'GetClie
ntRect', 'GetClientSize', 'GetClientSizeTuple', 'GetConstraints',
'GetContaining
Sizer', 'GetCount', 'GetCurrentSelection', 'GetCursor',
'GetDefaultAttributes',
'GetDropTarget', 'GetEffectiveMinSize', 'GetEventHandler',
'GetEvtHandlerEnabled
', 'GetExtraStyle', 'GetFont', 'GetForegroundColour', 'GetFullTextExtent',
'GetG
randParent', 'GetGtkWidget', 'GetHandle', 'GetHelpText',
'GetHelpTextAtPoint', '
GetId', 'GetItems', 'GetLabel', 'GetLabelText', 'GetLayoutDirection',
'GetMaxHei
ght', 'GetMaxSize', 'GetMaxWidth', 'GetMinHeight', 'GetMinSize',
'GetMinWidth',
'GetName', 'GetNextHandler', 'GetParent', 'GetPosition', 'GetPositionTuple',
'Ge
tPreviousHandler', 'GetRect', 'GetScreenPosition', 'GetScreenPositionTuple',
'Ge
tScreenRect', 'GetScrollPos', 'GetScrollRange', 'GetScrollThumb',
'GetSelection'
, 'GetSize', 'GetSizeTuple', 'GetSizer', 'GetString', 'GetStringSelection',
'Get
Strings', 'GetTextExtent', 'GetThemeEnabled', 'GetToolTip',
'GetTopLevelParent',
'GetUpdateClientRect', 'GetUpdateRegion', 'GetValidator', 'GetVirtualSize',
'Ge
tVirtualSizeTuple', 'GetWindowBorderSize', 'GetWindowStyle',
'GetWindowStyleFlag
', 'GetWindowVariant', 'GrandParent', 'GtkWidget', 'Handle', 'HasCapture',
'HasF
lag', 'HasMultiplePages', 'HasScrollbar', 'HasTransparentBackground',
'HelpText'
, 'Hide', 'HitTest', 'HitTestXY', 'Id', 'InheritAttributes',
'InheritsBackground
Colour', 'InitDialog', 'Insert', 'InvalidateBestSize', 'IsBeingDeleted',
'IsDoub
leBuffered', 'IsEmpty', 'IsEnabled', 'IsExposed', 'IsExposedPoint',
'IsExposedRe
ct', 'IsFrozen', 'IsRetained', 'IsSameAs', 'IsShown', 'IsShownOnScreen',
'IsTopL
evel', 'Items', 'Label', 'LabelText', 'Layout', 'LayoutDirection',
'LineDown', '
LineUp', 'Lower', 'MakeModal', 'MaxHeight', 'MaxSize', 'MaxWidth',
'MinHeight',
'MinSize', 'MinWidth', 'Move', 'MoveAfterInTabOrder',
'MoveBeforeInTabOrder', 'M
oveXY', 'Name', 'Navigate', 'NewControlId', 'NextControlId', 'NextHandler',
'OnP
aint', 'PageDown', 'PageUp', 'Parent', 'PopEventHandler', 'PopupMenu',
'PopupMen
uXY', 'Position', 'PostCreate', 'PrepareDC', 'PrevControlId',
'PreviousHandler',
'ProcessEvent', 'ProcessPendingEvents', 'PushEventHandler', 'Raise',
'Rect', 'R
efresh', 'RefreshRect', 'RegisterHotKey', 'ReleaseMouse', 'RemoveChild',
'Remove
EventHandler', 'Reparent', 'ScreenPosition', 'ScreenRect', 'ScreenToClient',
'Sc
reenToClientXY', 'ScrollLines', 'ScrollPages', 'ScrollWindow', 'Select',
'Select
ion', 'SendSizeEvent', 'SetAcceleratorTable', 'SetAutoLayout',
'SetBackgroundCol
our', 'SetBackgroundStyle', 'SetBestFittingSize', 'SetCaret',
'SetClientData', '
SetClientRect', 'SetClientSize', 'SetClientSizeWH', 'SetConstraints',
'SetContai
ningSizer', 'SetCursor', 'SetDimensions', 'SetDoubleBuffered',
'SetDropTarget',
'SetEventHandler', 'SetEvtHandlerEnabled', 'SetExtraStyle', 'SetFocus',
'SetFocu
sFromKbd', 'SetFont', 'SetForegroundColour', 'SetHelpText',
'SetHelpTextForId',
'SetId', 'SetInitialSize', 'SetItems', 'SetLabel', 'SetLayoutDirection',
'SetMax
Size', 'SetMinSize', 'SetName', 'SetNextHandler', 'SetOwnBackgroundColour',
'Set
OwnFont', 'SetOwnForegroundColour', 'SetPosition', 'SetPreviousHandler',
'SetRec
t', 'SetScrollPos', 'SetScrollbar', 'SetSelection', 'SetSize',
'SetSizeHints', '
SetSizeHintsSz', 'SetSizeWH', 'SetSizer', 'SetSizerAndFit', 'SetString',
'SetStr
ingSelection', 'SetThemeEnabled', 'SetToolTip', 'SetToolTipString',
'SetTranspar
ent', 'SetValidator', 'SetVirtualSize', 'SetVirtualSizeHints',
'SetVirtualSizeHi
ntsSz', 'SetVirtualSizeWH', 'SetWindowStyle', 'SetWindowStyleFlag',
'SetWindowVa
riant', 'ShouldInheritColours', 'Show', 'Shown', 'Size', 'Sizer',
'StringSelecti
on', 'Strings', 'Thaw', 'ThemeEnabled', 'ToggleWindowStyle', 'ToolTip',
'TopLeve
l', 'TopLevelParent', 'TransferDataFromWindow', 'TransferDataToWindow',
'Unbind'
, 'UnregisterHotKey', 'Update', 'UpdateClientRect', 'UpdateRegion',
'UpdateWindo
wUI', 'UseBgCol', 'Validate', 'Validator', 'VirtualSize', 'WarpPointer',
'Window
Style', 'WindowStyleFlag', 'WindowToClientSize', 'WindowVariant',
'__class__', '
__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__',
'__hash__
', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__
', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'__weakref__', '_
setOORInfo', 'thisown']
Then if you type:
help(C.SetItems)
You get:
Help on method SetItems in module wx._core:
SetItems(self, items) unbound wx._controls.Choice method
Clear and set the strings in the control from a list
Hope that helps.
Steve
>
> [1] http://www.manning-sandbox.com/thread.jspa?threadID=23650&tstart=45
> [2] http://www.wxpython.org/docs/api/wx.Choice-class.html
>
> --
> To unsubscribe, send email to wxPython-user...@googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en
>
The docs at www.wxpython.org/docs/api shows only then widget specific
methods, but you must know that a widget class inherits all methods and
properties from his ancestors.
SetItems() is inherited from wx.ItemContainer class. On top of [2] is
showed all the ancestors or wx.Choice.
> [2] http://www.wxpython.org/docs/api/wx.Choice-class.html
>
Regards.
--
Oswaldo Hern�ndez
now am more clear about the documentation!...
There's also Andrea's:
Unless I misunderstand you, aren't they in the wxWidgets docs (and
therefore Andrea's)?
For wx.DEFAULT_FRAME_STYLE, if you go to the wxWidgets docs, here:
http://docs.wxwidgets.org/2.6/wx_wxframe.html
And look under Window styles, it's there.
In Andrea's, here:
http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.Frame.html
Also under Window styles. I've found those parts of the docs crucial
to knowing what I'm doing when tweaking things.
> and there sure are a lot of them. Just what style
> flags define wx.DEFAULT_FRAME_STYLE ??? (The answer to this one is too
> easy. Most wx constants are not defined in any docs.)
From that page:
"Defined as wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER |
wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN."
Che
- base the wxPython docs on the wxWidgets 2.9 docs
- some initial manual work is needed to generate out of the wxWidgets
docs and the wxPython docs (wx.lib etc) the new docs
I don't want to stir things, but would be interested to know where this
all stands.
Could people like myself help in whatever manual work is involved?
Werner
P.S.
Hopefully the wxPython docs will be Sphinx based, which can easily
produce the .cmh, a .pdf and .html versions of the docs.
On 15 August 2010 11:50, werner wrote:
> On 14/08/2010 02:06, C M wrote:
> ...
>>
>> There's also Andrea's:
>> http://xoomer.virgilio.it/infinity77/wxPython/APIMain.html
>>
> At the end of 2008 this started a discussion about the wxPython
> documentation, my reading of the conclusion to that thread was.
>
> - base the wxPython docs on the wxWidgets 2.9 docs
> - some initial manual work is needed to generate out of the wxWidgets docs
> and the wxPython docs (wx.lib etc) the new docs
>
> I don't want to stir things, but would be interested to know where this all
> stands.
Your reading is correct: at that time, there was quite a debate about
the docs I produced with Sphinx. The docs generated by Sphinx are
without doubts nicer than the Doxygen-based ones, but a fair point
raised by Kevin, Robin and others was that, with the current way the
docs are handled in SWIG/wxWidgets, too much manual work would be
needed.
However, in order to switch from this state to an easier-to-handle
situation, only one thing would be needed: instruct SWIG to output the
wxPython-friendly help strings inside every method docstring. I.e.,
instead of having:
def __init__(self, *args, **kwargs):
"""
__init__(self, EventType commandType=wxEVT_NULL, int winid=0,
int pos=0,
int orient=0) -> ScrollEvent
"""
_core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args,
**kwargs))
You would have:
def __init__(self, *args, **kwargs):
"""
Class constructor.
:param `commandType`: eventtype
:param `winid`: int
:param `pos`: int
:param `orient`: int
:return: `wx.ScrollEvent`.
"""
Or something along these lines. Obviously, in this case the parameter
descriptions are not very helpful (they only mention "int"), but if
the description is present in the wxWidgets docs, it would be nice to
have a way to extract them and put them inside the method docstring.
In short, if we can output as much as possible help strings and
documentation strings inside method/class/module docstrings, then the
whole process of generating the documentation with Sphinx can be
automated like a breeze, up to the generation of html, pdf and chm
files.
> Could people like myself help in whatever manual work is involved?
Of course you can: your knowledge of wxPython and of the various
intricacies of the library are extremely useful in analyzing the
slight differences between the wxWidgets docs (C++) and the wxPython
ones, in spotting errors in the automatically generated docs, and in
general provide ideas (and code) on how to best handle the conversion
between C++ docs and Python ones.
However, until Robin has given his final word, I don't think it's wise
to start something just yet... I remember I was bitten quite hard by
people's reactions on the wxPython docs I generated back in 2008...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==