An example of it being used with a flow is noticeable in the mod-gui wrapper.
Code: Select all
local button_flow = mod_flow.mod_gui_button_flow
if not button_flow then
button_flow = mod_flow.add{type = "flow", name = "mod_gui_button_flow", direction = "horizontal", style = "slot_table_spacing_flow_style"}
end
Code: Select all
table_spacing_flow_style =
{
type = "flow_style",
horizontal_spacing = 5,
vertical_spacing = 5
},
slot_table_spacing_flow_style =
{
type = "flow_style",
horizontal_spacing = 2,
vertical_spacing = 2
},
In my own code, if I decide to change the style of the flow to increase the horizontal spacing, I can do that by using another defined style (see above).
Code: Select all
local container = mod_gui.get_button_flow(player)
container.style = 'table_spacing_flow_style'
container.style.left_padding = 4
container.style.top_padding = 4
However, I cannot modify the style.horizontal_spacing value directly for a flow:
Code: Select all
local container = mod_gui.get_button_flow(player)
container.style.horizontal_spacing = 5
Code: Select all
Error while running event
:127: Expected Table style type but was Flow.
:84: in function 'my_function'
...