wnnmaw
wnnmaw

Reputation: 5534

Is there a way to allow the user to re size a text control in wxPython?

The question is pretty much in the title, not much to add here. I'm trying to allow the user to dynamically size multi-line text controls just as they can re-size the panel (I set the default, but they are free to change it). Can this be done?

Upvotes: 0

Views: 167

Answers (2)

RobinDunn
RobinDunn

Reputation: 6306

Take a look at wx.lib.resizewidget and the ResizeWidget sample in the demo.

Upvotes: 2

Mike Driscoll
Mike Driscoll

Reputation: 33111

The text control will expand along with the panel if it is added to a sizer with the wx.EXPAND flag and the proportion is set to be greater than 0 (see wxPython wx.TextCtrl dynamically resizing to fill panel width). There is no way to add a handle to the native widgets that will let the user resize just the widget itself.

You would need to create some kind of custom widget to do that. There is information about creating custom widgets on the wxPython wiki or you could look at the source of the widgets in wx.lib

Upvotes: 1

Related Questions