Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: allow arbitrary windows as label to StaticBox #2563

Open
emersonrp opened this issue Jun 16, 2024 · 1 comment
Open

Feature Request: allow arbitrary windows as label to StaticBox #2563

emersonrp opened this issue Jun 16, 2024 · 1 comment

Comments

@emersonrp
Copy link

wxWidgets' C++ implementation has an overloaded constructor that allows building a StaticBox with a wxWindow object substituted for the default text label. This allows for adding, for instance, a checkbox that might be used to enable/disable the controls within the StaticBox. It would be extremely shiny if wxPython exposed / supported this functionality.

https://docs.wxwidgets.org/latest/classwx_static_box.html#aedd6c9352e976dcc55e8112143cca6f7

@DietmarSchwertberger
Copy link
Contributor

The relevant section seems to be in etg\statbox.py:

    # TODO: The window-label ctor is only available on MSW and GTK so disable
    # for now. Maybe replace it with a factory function that returns None on
    # OSX??
    c.find('wxStaticBox').findOverload('wxWindow *label').ignore()

    # "unfix" the 2nd ctor and Create method so the required parameter lists
    # are different enough for them to be overloaded.
    #for name in ['wxStaticBox', 'Create']:
    #    m = c.find(name).findOverload('wxWindow *label')
    #    m.find('id').default = ''

And in e.g. ext\wxWidgets\include\wx\msw\statbox.h

// Indicate that we have the ctor overload taking wxWindow as label.
#define wxHAS_WINDOW_LABEL_IN_STATIC_BOX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants