Re: buttons!!!
- From: Olexiy Avramchenko <olexiy irtech cn ua>
- To: ionut grigorescu <ionutasc yahoo com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: buttons!!!
- Date: Mon, 05 Apr 2004 10:08:23 +0300
GtkButton is container. Its derived from GtkBin class. When you create
button with gtk_button_new_with_label() the child of the button will be
GtkLabel with your text.
void print_buttons_label(GtkButton *button)
{
GtkWidget *child;
/* checking that parameter is of GtkButton type */
g_return_if_fail(GTK_IS_BUTTON(button));
/* getting the child of the button */
child = gtk_bin_get_child(GTK_BIN(button));
/* checking that child is of GtkLabel type */
g_return_if_fail(GTK_IS_LABEL(child));
/* printing out label's text */
g_print("%s\n", gtk_label_get_text(GTK_LABEL(child)));
}
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]