From The Battle for Wesnoth Wiki

The sandbox is for editing and formatting experiments. If you are already logged in, click on the "Edit" link above to experiment yourself!

Widget definition

This page describes the definition of all widgets in the toolkit. Every widget has some parts in common, first of all; every definition has the following fields.


A label displays a text, the text can be wrapped but no scrollbars are provided.

Although the label itself has no event interaction it still has two states. The reason is that labels are often used as visual indication of the state of the widget it labels.

Note: The above is outdated, if "link_aware" is enabled then there is interaction.

The following states exist:

  • state_enabled, the label is enabled.
  • state_disabled, the label is disabled.

key type default description
link_aware f_bool false Whether the label is link aware. This means it is rendered with links highlighted, and responds to click events on those links.
link_color string #ffff00 The color to render links with. This string will be used verbatim in pango markup for each link.

Widget instance

Inside a grid (which is inside all container widgets) a widget is instantiated. With this instantiation some more variables of a widget can be tuned. This page will describe what can be tuned.


A label displays a text, the text can be wrapped but no scrollbars are provided.

List with the label specific variables:

key type default description
wrap bool false Is wrapping enabled for the label.
characters_per_line unsigned 0 Sets the maximum number of characters per line. The amount is an approximate since the width of a character differs. E.g. iii is smaller than MMM. When the value is non-zero it also implies can_wrap is true. When having long strings wrapping them can increase readability, often 66 characters per line is considered the optimum for a one column text. text_alignment & h_align & "left" & How is the text aligned in the label.


The [awesometag] is used to do awesome things.

  • awesomekey: A place to put an awesome value

Awesome example:


Comment by Dreadnough: They have a great core with versatile Spearman and fast Cavalry. Depending on the situation they can add highly specialised units such as Heavy Infantry, Mages, Meremen and Horseman. Finally their fencers can slip through enemy ranks and enable breakthroughs or disrupt the enemy's movement. As a lawful faction, they depend very much on the time of day, which results in dynamic unit movement.

Comment by ForestDragon: Rebels. Well, female elves are certainly quite attractive. For example, the marksman line.

Comment by Elven: Northerners have simple strategy. Kill weak units, poison and kill strong units. You can have a lot of units, make some a level 2 units and never retreat, never surrender!

Comment by patience_reloaded: Undead due to their reliability when used correctly: Ghosts are very hard for most normal units (especially melee ones) to kill quick, most of the faction is poison-resistant, and due to having fixed traits, you know exactly what you get when you recruit them.

Comment by Hsaelt: Knalgans i like because they can take punishment and deliver punishment. Good HP, good damage outputs on units like gryphons and those guys with firearms. No real weaknesses in res good defence on hills mountains and those are commonplace

Comment by Knightmare: (Plays Drakes) Fire and Blood.

Comment by Computer_player: I love dunefolk because they bring something different to the table and out of the factions closest to being mainlined, they are the one with the most work done. I really like the dynamic of the Dunefolk (Khalifate long ago) faction, however I am waiting to play Dunefolk proper with the next stable version.

Comment by egallager: Check out the ReferenceWML page. Egallager (talk) 03:34, 8 May 2023 (UTC)

This page was last edited on 26 April 2024, at 13:36.