Re: button label problem
- From: vyadav cdotd ernet in
- To: Olexiy Avramchenko <ath beast stu cn ua>
- Cc: gtk-list gnome org
- Subject: Re: button label problem
- Date: Tue, 13 Aug 2002 16:41:05 +0500 (GMT+0500)
hi..
i did like it..but i got undefined reference of "gtk_button_set_label"
then what should i do....
thanx...
On Tue, 13 Aug 2002, Olexiy Avramchenko wrote:
> 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]