Re: how to underline the text of a button [solved]
- From: Gezim Hoxha <gezimetc shaw ca>
- To: GTK+ app devel <gtk-app-devel-list gnome org>
- Subject: Re: how to underline the text of a button [solved]
- Date: Sun, 26 Feb 2006 23:03:24 -0700
On Mon, 2006-27-02 at 00:50 +0200, Paul Pogonyshev wrote:
Gezim Hoxha wrote:
I have a button like this:
GtkButton *pulse_button
pulse_button = g_object_new (GTK_TYPE_BUTTON,
"label", "_Pulse",
"use-underline", TRUE,
NULL);
And I want to know why isn't the word "Pulse" underlined in the button
text?
It shouldn't. When you create a button like this, letter `P' will be
underlined and the user will be able to activate the button from the
keyboard with Alt+P (and with mouse too, of course.)
Heh, I realized this after I emailed the list.
If you really need underlined text in a button, try
GtkWidget *pulse_button = gtk_button_new ();
GtkWidget *pulse_label = gtk_label_new ();
gtk_label_set_markup (GTK_LABEL (pulse_label), "<u>Pulse</u>")
gtk_container_add (GTK_CONTAINER (pulse_button), pulse_label);
Thanks for this. Line two of the code doesn't work though because there
needs to be an argument when gtk_label_new is called, this worked
however:
GtkWidget *pulse_label = gtk_label_new ("Temp Text");
Thanks,
-Gezim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]