* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @Title: GtkCellLayout
*
* #GtkCellLayout is an interface to be implemented by all objects which
- * want to provide a #GtkTreeViewColumn-like API for packing cells, setting
+ * want to provide a #GtkTreeViewColumn<!-- -->-like API for packing cells, setting
* attributes and data funcs.
*
* One of the notable features provided by implementations of GtkCellLayout
* <title>GtkCellLayouts as GtkBuildable</title>
* <para>
* Implementations of GtkCellLayout which also implement the GtkBuildable
- * interface (#GtkCellView, #GtkIconView, #GtkComboBox, #GtkComboBoxEntry,
+ * interface (#GtkCellView, #GtkIconView, #GtkComboBox,
* #GtkEntryCompletion, #GtkTreeViewColumn) accept GtkCellRenderer objects
* as <child> elements in UI definitions. They support a custom
* <attributes> element for their children, which can contain
* gtk_cell_layout_set_attributes:
* @cell_layout: a #GtkCellLayout
* @cell: a #GtkCellRenderer
- * @Varargs: a %NULL-terminated list of attributes
+ * @...: a %NULL-terminated list of attributes
*
* Sets the attributes in list as the attributes of @cell_layout.
*
const gchar *value)
{
GParamSpec *pspec;
- GValue gvalue = { 0, };
+ GValue gvalue = G_VALUE_INIT;
GError *error = NULL;
pspec = gtk_cell_area_class_find_cell_property (GTK_CELL_AREA_GET_CLASS (area), name);
CellPackingSubParserData *parser_data = (CellPackingSubParserData*)user_data;
GtkCellArea *area;
- /* Append the translated strings */
- if (parser_data->string->len)
- {
- area = gtk_cell_layout_get_area (parser_data->cell_layout);
+ area = gtk_cell_layout_get_area (parser_data->cell_layout);
- if (area)
+ if (area)
+ {
+ /* translate the string */
+ if (parser_data->string->len && parser_data->translatable)
{
- if (parser_data->translatable)
- {
- gchar *translated;
- const gchar* domain;
-
- domain = gtk_builder_get_translation_domain (parser_data->builder);
-
- translated = _gtk_builder_parser_translate (domain,
- parser_data->context,
- parser_data->string->str);
- g_string_set_size (parser_data->string, 0);
- g_string_append (parser_data->string, translated);
- }
-
- gtk_cell_layout_buildable_set_cell_property (area,
- parser_data->builder,
- parser_data->renderer,
- parser_data->cell_prop_name,
- parser_data->string->str);
+ gchar *translated;
+ const gchar* domain;
+
+ domain = gtk_builder_get_translation_domain (parser_data->builder);
+
+ translated = _gtk_builder_parser_translate (domain,
+ parser_data->context,
+ parser_data->string->str);
+ g_string_set_size (parser_data->string, 0);
+ g_string_append (parser_data->string, translated);
}
- else
- g_warning ("%s does not have an internal GtkCellArea class and cannot apply child cell properties",
- g_type_name (G_OBJECT_TYPE (parser_data->cell_layout)));
+
+ if (parser_data->cell_prop_name)
+ gtk_cell_layout_buildable_set_cell_property (area,
+ parser_data->builder,
+ parser_data->renderer,
+ parser_data->cell_prop_name,
+ parser_data->string->str);
}
+ else
+ g_warning ("%s does not have an internal GtkCellArea class and cannot apply child cell properties",
+ g_type_name (G_OBJECT_TYPE (parser_data->cell_layout)));
g_string_set_size (parser_data->string, 0);
g_free (parser_data->cell_prop_name);