# Howto “glue” input fields?

Is there a way to "glue" input fields together in Python, like in the Properties > Render > Resolution?

It's not a layout box, it's not a IntVector...

I was surprised to see in how many ways a FloatVector can be displayed (e.g. numbers, RGB, RGBA, ...). Perhaps I missed an option somewhere?

## 1 Answer

This is an excerpt from properties_render.py. You can right click the property and choose Edit Source.

The properties are drawn using UILayout.column(). Specifically, it is the align=True, a property of the column, which causes the properties to appear to be 'glued' together.

def draw(self, context):
layout = self.layout

scene = context.scene
rd = scene.render

row = layout.row(align=True)
row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label)
row.operator("render.preset_add", text="", icon='ZOOMIN')
row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True

split = layout.split()

col = split.column()
sub = col.column(align=True)
sub.label(text="Resolution:")
sub.prop(rd, "resolution_x", text="X")
sub.prop(rd, "resolution_y", text="Y")
sub.prop(rd, "resolution_percentage", text="")

• Nifty feature... I didn't know about it. – karamike Nov 30 '14 at 16:36