grid via mouse click - AlfonsMittelmeyer/python-gui-messaging GitHub Wiki

grid via mouse click

This applies for widgets, which don't have a layout

You have created some widgets and want to do a grid layout.

enter image description here

So you should have rows and colums, where to grid them. The existence of rows and columns isn't a problem, but the size of rows and columns is 0, if you don't determin another size. Size 0 would not allow to position widgets in grid cells by mouse click.

The GuiDesigner let you specify sizes for rows and columns. This you may do by using the grid layout user interface.

enter image description here

If you have this:

enter image description here

And enter this:

enter image description here

You get this:

enter image description here

Not a bad idea to begin. This view shows the grid cells.

Widgets, with don't have a layout, can simply positioned in a grid cell, be selecting the widget:

enter image description here

And then click with the mouse in a grid cell, for example, row 1 and column 0:

enter image description here

It's easy to do, for example:

enter image description here

Interesting is, that the LabelFrame is visible. Normally container widgets have only a size of one pixel, if not something else is configured or if not the grid parameter 'sticky' is set to 'nesw'.

It makes sense, that a container widget is visible. So for container widgets the GuiDesigner sets 'sticky' to 'nesw', when they are positioned via mouse click.

enter image description here

The GuiDesigner offers positioning via mouse click only for widgets without a layout. Otherwise easily a widget could change unintentional its place by unintentional clickings.