As a second question, since I am still struggling to learn proper use of sizers, can anyone explain to me why the commented out BoxSizer Add fails to cause the TextCtrl to expand to its proper size, if it is used in place of the previous Add?
Brian
The Grid widget is composed of several sub widgets (for the grid area
and the col/row labels), which occupy all the visible area of the grid.
If you want to be able to drop into the grid you should set the drop
target on one of the visible windows, not its parent.
grid.GetGridWindow().SetDropTarget(drptgt)
>
> As a second question, since I am still struggling to learn proper use
> of sizers, can anyone explain to me why the commented out BoxSizer
> Add fails to cause the TextCtrl to expand to its proper size, if it
> is used in place of the previous Add?
Depends on what you mean by "proper size." I'm guessing that you think
it means to be large enough to show all the text. But since the
wx.TextCtrl can have variable size needs that change at runtime as the
user types then it just uses a fixed width for its best size and that is
what the sizer will use for layout unless you tell it different. You
can override the best size by setting the min size.
lbl1.SetMinSize((200,-1))
--
Robin Dunn
Software Craftsman
http://wxPython.org
Apparently not as that sample works fine on Mac for me, I guess I was
misremembering something. Try to figure out what the difference is
between your sample and the one in the demo, so we can narrow down where
the problem is at.
Oops, what I was missing is that I ran one sample with wx 2.8 and the
other with 2.9. In 2.9 this issue has been solved, and setting the Grid
as the drop target on Mac will also work for drops done on the GridWindow.