void set_max_width_chars(int n_chars);

Sets the desired maximum width in characters to n_chars chars.

Example 89. Setting the Max Width of a GtkLabel in Characters

// Create a window to hold the label.
$window = new GtkWindow();

// Set up the window to close cleanly.
$window->connect_simple('destroy', array('Gtk', 'main_quit'));

// Create a label.
$label = new GtkLabel('Exampel Label');

// Set the max width in characters.

// Add the label to the window.

// Show the window and start the main loop.
This code will produce the window shown below. Notice how only the first ten characters or the label are shown.

See also: get_max_width_chars()