Re: GtkTextBuffer + integers?



Hi again :P

I not understand your reply for my message, the
soluction for your problem that i imagine is:

GtkTextBuffer *tbuffer;
gint value=10071;
gchar temp[50]; /* size is just a idea */

tbuffer = gtk_text_buffer_new(NULL);

sprintf(temp, "%d", value);
gtk_text_buffer_set_text(tbuffer, temp, -1);


I hope be useful,
Adriano Bonat

 --- Ben LeMasurier <uidzer0 hotmail com> escreveu: 
> Thanks for the reply - that's what I thought but is
> their a way to call 
> sprintf to output to the gtk_text_buffer because i
> need this to show up in 
> the text view not the terminal window. i hope this
> is clear... does that 
> makes sense? let me know if not.
> 
> thanks,
> 
> Ben
> 
> >From: Adriano Bonat <adrianobonat yahoo com br>
> >To: gtk-list gnome org
> >Subject: Re: GtkTextBuffer + integers?
> >Date: Sun, 6 Apr 2003 17:12:44 -0300 (ART)
> >
> >Hi all, hi Ben!
> >
> >Of course that this will not function, therefore
> the
> >function gtk_text_buffer_set_text needs gchar and
> not
> >a integer, then what you must do, is to transform
> its
> >integer to one string, you can use sprintf().
> >
> >Best regards,
> >Adriano Bonat
> >
> >  --- Ben LeMasurier <uidzer0 hotmail com> wrote:
> > > I am trying to output an integer to a
> gtktextbuffer,
> > > the widget only seems
> > > to take a gchar as data and when i try to cast
> the
> > > integer to a char it
> >
> >
>
>_______________________________________________________________________
> >Yahoo! Mail
> >O melhor e-mail gratuito da internet: 6MB de
> espaço, antivírus, acesso 
> >POP3, filtro contra spam.
> >http://br.mail.yahoo.com/
> >_______________________________________________
> >gtk-list mailing list
> >gtk-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gtk-list
> 
> 
>
_________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months
> FREE*  
> http://join.msn.com/?page=features/virus
>  

_______________________________________________________________________
Yahoo! Mail
O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam. 
http://br.mail.yahoo.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]