[Glade-users] gtk/glade programming

Hi Seb,=20

not sure I understood exactly your problem, but check the comments:

on=5Fserial=5Fdata=5Freceive (gpointer user=5Fdata,
gint fd,
GdkInputCondition target=5Fio=5Fstates)
GtkWidget *console=5Ftextview;
char buf[255];
gint res;
/* Don't know how to call lookup=5Fwidget in this case: */
console=5Ftextview =3D lookup=5Fwidget (GTK=5FWIDGET (console=5Ftextview), "consol=

Your console=5Ftextview is declared in your function, of course this won't w=
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

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)

/* Plus output it to the console window: */
gtk=5Ftext=5Fbuffer=5Fset=5Ftext (gtk=5Ftext=5Fview=5Fget=5Fbuffer (GTK=5FTEXT=5FVIEW (conso=
=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,
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]