Get an Gtk Label from an gtk_event_box_new
- From: "Xharbour suporte" <luiz xharbour com br>
- To: gtk-app-devel-list gnome org
- Subject: Get an Gtk Label from an gtk_event_box_new
- Date: Wed, 23 Apr 2008 18:26:00 -0300
Hi
How to get an Label control added to an gtk_event_box_new control
here the code i use
char * title = "1234";
hCtrl = gtk_event_box_new();
cTitle = g_locale_to_utf8( cTitle,-1,NULL,NULL,NULL );
hLabel = gtk_label_new( cTitle );
g_free( cTitle );
gtk_container_add( GTK_CONTAINER(hCtrl), hLabel );
later on my call back i need to get the label that is inside the event box to set an color
i´ve tryed
void mycallBack(GtkWidget * p,gpointer userdata)
{
GtkWidget * label;
GtkWidget hCtrl = (GtkWidget*) userdata;
GdkColor color;
label = gtk_bin_get_child (GTK_BIN(hCtrl))
gdk_color_parse("red", &color);
gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &color);
return 0;
}
Atenciosamente
Luiz Rafael Culik Guimaraes
Suporte Xharbour
www.xharbour.com.br
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]