[Glade-users] gtk/glade programming
- From: g_mitter web de ( Günther Mittermayer )
- Subject: [Glade-users] gtk/glade programming
- Date: Thu, 25 Sep 2003 14:00:05 +0200
Hi Seb,=20
not sure I understood exactly your problem, but check the comments:
void
on=5Fserial=5Fdata=5Freceive (gpointer user=5Fdata,
gint fd,
GdkInputCondition target=5Fio=5Fstates)
{
GtkWidget *console=5Ftextview;
=20
char buf[255];
gint res;
=20
/* Don't know how to call lookup=5Fwidget in this case: */
console=5Ftextview =3D lookup=5Fwidget (GTK=5FWIDGET (console=5Ftextview), "consol=
e=5Ftextview");
Your console=5Ftextview is declared in your function, of course this won't w=
ork.=20
Do you mean the window hasn't yet been created=3F if so, you should first cr=
eate it, then you'll have the reference you need. Something like that:
// assuming you've created a dialog called "console=5Ftextview" in Glade.
console=5Ftextview =3D create=5Fconsole=5Ftextview();=20
//shows the console
gtk=5Fwidget=5Fshow(console=5Ftextview);=20
Otherwise, if the window has already been created somewhere else, than you=
should hold a copy of the reference (passing it as a parameter, or .. wel=
l, declaring it global, maybe=3F)
=20
/* Plus output it to the console window: */
gtk=5Ftext=5Fbuffer=5Fset=5Ftext (gtk=5Ftext=5Fview=5Fget=5Fbuffer (GTK=5FTEXT=5FVIEW (conso=
le=5Ftextview)),
=5F("Buffer text"), -1);
/* How to replace "Buffer text" with "%s", buf =3F */
How about a simple buf instead of the whole =5F() thing=3F like that:
gtk=5Ftext=5Fbuffer=5Fset=5Ftext (gtk=5Ftext=5Fview=5Fget=5Fbuffer (GTK=5FTEXT=5FVIEW (console=
=5Ftextview)), buf, -1);
Hope it helps,
G=FCnther.
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F
Zwei Mal Platz 1 mit dem jeweils besten Testergebnis! WEB.DE FreeMail
und WEB.DE Club bei Stiftung Warentest! http://f.web.de/=3Fmc=3D021183
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]