Re: label with format string
- From: Havoc Pennington <hp redhat com>
- To: "Nix N. Nix" <nix achilles go-nix ca>
- Cc: Johannes Weißl <jargon hurg org>, gtk-app-devel-list gnome org
- Subject: Re: label with format string
- Date: 10 Sep 2003 23:37:27 -0400
On Tue, 2003-09-09 at 11:46, Nix N. Nix wrote:
Here's another version, using glib stuff alone:
/* I work with the 1.2.x version of g* */
void lblprintf (GtkWidget *lbl, char *pszFormat, ...)
{
const char *pszFmt = pszFormat ;
char *pszMsg = NULL ;
int ic = 0 ;
va_start (va, pszFormat) ;
pszMsg = malloc (ic = g_printf_string_upper_bound (pszFmt, va)) ;
g_vsnprintf (pszMsg, ic, pszFmt, va) ;
va_end (va) ;
g_strdup_vprintf would be a lot easier ;-)
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]