Article View: es.comp.os.linux.programacion
Article #12235Re: Programacion en Gtk
From: Gorka Olaizola
Date: Sat, 18 Aug 2001 12:20
Date: Sat, 18 Aug 2001 12:20
46 lines
2571 bytes
2571 bytes
El d�a Fri, 03 Aug 2001 12:33:00 +0200, Eduard Garcia <eduardo.garcia2@upcnet.es> escribi�:
>
> Si el combo que buscas est� en la misma ventana que el bot�n, dentro de la
> funci�n que gestiona el click del bot�n:
>
> *GtkWidget combo1;
> combo1 = lookup_widget (GTK_WIDGET(button), "nombre_combo1");
>
La funci�n lookup_widget es una funci�n que implementa Glade.
Este es el c�digo:
---------------------------- Cortar --------------------------------------
GtkWidget*
lookup_widget (GtkWidget *widget,
const gchar *widget_name)
{
GtkWidget *parent, *found_widget;
for (;;)
{
if (GTK_IS_MENU (widget))
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
else
parent = widget->parent;
if (parent == NULL)
break;
widget = parent;
}
found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
widget_name);
if (!found_widget)
g_warning ("Widget not found: %s", widget_name);
return found_widget;
}
---------------------------- Cortar --------------------------------------
--
musg0 @ irc http://personales.jet.es/olsago/
(o_ _-(_)- _-( )- (o_ _-(_)- _-(_)- _-(_)- _-(_)-
//\ `(___) `(___) //\ `(___) `(___) `(___) `(___)
V_/ // \\ // \\ V_/ // \\ // \\ // \\ // \\
"�Recompolira tu kermel! �es f�cil!" -=[Debian GNU/Linux Sid]=-
Technical Details
Message-ID:
<slrn9nsncb.u44.gorka@helvete.basquemetal.yi.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mailReferences:
<g8m9k9.un.ln@127.0.0.1> <3B6A7DDC.F41122E8@upcnet.es>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,15aa6c659584bb40 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-08-18 05:25:24 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mail From: gorka@basquemetal.yi.org (Gorka Olaizola) Newsgroups: es.comp.os.linux.programacion Subject: Re: Programacion en Gtk Date: Sat, 18 Aug 2001 12:20:28 +0000 (UTC) Organization: ecol.* (http://www.escomposlinux.org) Lines: 46 Message-ID: <slrn9nsncb.u44.gorka@helvete.basquemetal.yi.org> References: <g8m9k9.un.ln@127.0.0.1> <3B6A7DDC.F41122E8@upcnet.es> Reply-To: gorka@escomposlinux.org NNTP-Posting-Host: 213.96.129.167 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.7.1 (Linux)