/* * Writes the source code needed to create this widget. * You have to output everything necessary to create the widget here, though * there are some convenience functions to help. */ static void gb_accel_label_write_source (GtkWidget * widget, GbWidgetWriteSourceData * data) { gboolean translatable, context; gchar *comments; if (data->create_widget) { const gchar *label_text = gtk_label_get_label (GTK_LABEL (widget)); glade_util_get_translation_properties (widget, Label, &translatable, &comments, &context); source_add_translator_comments (data, translatable, comments); source_add (data, " %s = gtk_accel_label_new (%s);\n", data->wname, source_make_string_full (label_text, data->use_gettext && translatable, context)); } gb_widget_write_standard_source (widget, data); if (gtk_label_get_use_underline (GTK_LABEL (widget))) source_add (data, " gtk_label_set_use_underline (GTK_LABEL (%s), TRUE);\n", data->wname); gb_label_write_standard_source (widget, data, Label, UseUnderline, UseMarkup, Justify, Wrap, Selectable, XAlign, YAlign, XPad, YPad, FocusTarget, Ellipsize, WidthChars, SingleLineMode, Angle); }
/* * Writes the source code needed to create this widget. * You have to output everything necessary to create the widget here, though * there are some convenience functions to help. */ static void gb_label_write_source (GtkWidget * widget, GbWidgetWriteSourceData * data) { if (data->create_widget) { const gchar *label_text = gtk_label_get_label (GTK_LABEL (widget)); if (gtk_label_get_use_underline (GTK_LABEL (widget))) source_add (data, " %s = gtk_label_new_with_mnemonic (%s);\n", data->wname, source_make_string (label_text, data->use_gettext)); else source_add (data, " %s = gtk_label_new (%s);\n", data->wname, source_make_string (label_text, data->use_gettext)); } gb_widget_write_standard_source (widget, data); gb_label_write_standard_source (widget, data, Label, UseUnderline, UseMarkup, Justify, Wrap, Selectable, XAlign, YAlign, XPad, YPad, FocusTarget); }