Re: Different Colors i an entry widget?





Günther Rapp ha scritto lo scorso 18/05/04 13.49:
Hi to all

as I understand is the style structure uniq to the widget.
Each widget can have its own struct ok.

Now I want to change the color in a entry widget only for a few characters like this
this black text this is red text this is again black text.

How can I manage this :
is ist possible to change the style struct only for a few characters
assigning text to the widget with   gtk_editable_insert_text
than changing the style and then again   gtk_editable_insert_text
with the new color or font.
Does anybody have a working code example for this?

I don't know if it is possible (or useful) for a GtkEntry, but this worked for me for a GtkLabel, using pango markup attributes:

        GtkWidget * label;

        label = gtk_label_new ("");
gtk_label_set_markup (GTK_LABEL (label), "<span foreground="blue">Blue text</span>, <b>black bold</b>");
        gtk_widget_show (label);

Thanks günther


------------------------------------------------------------------------

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]