Quote:
Originally Posted by Harishankar
I am looking for a simple text display widget in GTK2 that will easily display the numbers in a calculator application that I'm creating.
I tried using GtkLabel. Too simple. I cannot set text and background colour for this widget.
I tried using GtkTextView. Here I could set the text and background colour, but too complex. I don't need a full editor where I cannot easily set/retrieve the text values.
I tried using GtkEntry. Here it is easy to use, but I cannot set the alignment to right (which is a prerequisite for displaying a calculator view.
Is there any other widget which I can use which I can:
1. Set the text and retrieve it with one simple function call.
2. Set the background and text colour?
3. Will have an option to text align right?
Thanks.
|
Hello,
I will set the color in a GtkEntry, but under SuSE 9.3 with KDE does not work.
My sourcecode:
entry = gtk_entry_new();
gtk_box_pack_start_defaults( GTK_BOX(vbox), GTK_WIDGET(entry));
gtk_entry_set_text( GTK_ENTRY(entry), "Zweites Editfeld" );
gdk_color_parse("red", &color);
gtk_widget_modify_text(entry, GTK_STATE_NORMAL, &color);
gtk_widget_show_all(GTK_WIDGET(fenster));
Who can help me? Thanks