Re: button label problem
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: vyadav cdotd ernet in
- Cc: gtk-list gnome org
- Subject: Re: button label problem
- Date: Tue, 13 Aug 2002 13:55:58 +0300
vyadav cdotd ernet in wrote:
hi all .
how can we change the label of button after clicking it ...
i mean..i have set one label for the buttton..and i want to change it
when i click on the button...
plz help...
thanx...
just do smth like this:
---
void button_clicked(GtkButton *button, gpointer data)
{
static gint button_click_count=0;
gchar label[32];
sprintf(label, "label N%d", button_click_count++);
gtk_button_set_label(button, label);
}
void button_setup()
{
GtkWidget *button;
...
button = gtk_button_new_with_label("label N0");
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(button_clicked), NULL);
gtk_widget_show(button);
...
}
---
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]