0

I have a wx.Choice control in glade however I am not sure how I would be able to set the default size of the control to be equivalent to x number of characters.

Is there a way to set the initial size of the widget inside wxGlade, to be the length of an expected string (in pixels)?

wx.Choice.SetInitialSize(dc.GetTextExtent("expected string")[0])

Har
  • 3,727
  • 10
  • 41
  • 75

1 Answers1

0

In short, there is no such option, there might be added in the future, however currently wxGlade does not provide a convenient way to specify an initial size in terms of number of characters.

Adding the code of

wx.Choice.SetInitialSize(dc.GetTextExtent("expected string")[0])

In the code section within wxGlade is one way of doing this, the other is to add it in manually within the Python code.

Har
  • 3,727
  • 10
  • 41
  • 75