Minor change to Widget Inspection Tool- requesting feedback/critique

I've made a slight change to the Widget Inspection Tool, to display
the actual text label (for those widgets which have this attribute),
instead of the
name of the widget.

Currently, a RadioBox will show up in the Widget Tree like this
RadioBox("radio box")

I've made a change so that widgets will be displayed with the actual
label used in the app.
This is helpful when you many many widgets of the same type, and don't
want to have to click on all widgets to find the one you're really
interested in.

The change I've made is in lib\inspection.py, in

before change

    def GetTextForWidget(self, widget):
        """
        Returns the string to be used in the tree for a widget
        """
            return "%s (\"%s\")" % (widget.__class__.__name__, widget.GetName())

after change

    def GetTextForWidget(self, widget):
        """
        Returns the string to be used in the tree for a widget
        """
        try:
            widgetStr = "%s (\"%s\")" % (widget.__class__.__name__,
widget.LabelText)
        except AttributeError:
            widgetStr = "%s (\"%s\")" % (widget.__class__.__name__,
widget.GetName())

        return widgetStr

I know my way of finding the label text is not very idiomatic.

So I'd like to ask for some feedback on a better way to find widgets
that have a LabelText attribute.

In order to make this an optional feature, a check box, button, or
Checkable menu item could be implemented.

I would not change the default behavior to this new style but add this
as an option in the menu. Specifying a name is a good habit to get
into if you want to test your GUI with certain automation tools.

--Mark

···

On Mon, Mar 31, 2008 at 3:45 PM, Tony Cappellini <cappy2112@gmail.com> wrote:

I've made a slight change to the Widget Inspection Tool, to display
the actual text label (for those widgets which have this attribute),
instead of the
name of the widget.

Currently, a RadioBox will show up in the Widget Tree like this
RadioBox("radio box")

I've made a change so that widgets will be displayed with the actual
label used in the app.
This is helpful when you many many widgets of the same type, and don't
want to have to click on all widgets to find the one you're really
interested in.

The change I've made is in lib\inspection.py, in

before change

    def GetTextForWidget(self, widget):
        """
        Returns the string to be used in the tree for a widget
        """
            return "%s (\"%s\")" % (widget.__class__.__name__, widget.GetName())

after change

    def GetTextForWidget(self, widget):
        """
        Returns the string to be used in the tree for a widget
        """
        try:
            widgetStr = "%s (\"%s\")" % (widget.__class__.__name__,
widget.LabelText)
        except AttributeError:
            widgetStr = "%s (\"%s\")" % (widget.__class__.__name__,
widget.GetName())

        return widgetStr

I know my way of finding the label text is not very idiomatic.

So I'd like to ask for some feedback on a better way to find widgets
that have a LabelText attribute.

In order to make this an optional feature, a check box, button, or
Checkable menu item could be implemented.
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users