GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Oct 22, 2014 3:23 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GString output
PostPosted: Mon Oct 29, 2007 5:59 pm 
Offline
Familiar Face

Joined: Mon Aug 27, 2007 10:43 pm
Posts: 14
Ok my question is how do you output a GString object, I suppose you could always just say x.str, but i'm sure there's a more suitable function for it in the vast GTK library, one that would be more portable too. Anyways, just wondering how it SHOULD be done. Thanks for your time and effort,
--Alex


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 29, 2007 6:54 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
That is the "proper" way of doing things. The point of GString is just to automatically manage a bunch of common string operations. However, you should not alter the "str" member of a GString directly ...

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 8:08 pm 
Offline
Familiar Face

Joined: Mon Aug 27, 2007 10:43 pm
Posts: 14
Thanks for the reply, so you don't think there's a GSTRING output function or argument macro that output's the contents of the str member? Basically I just wondered how most people access the contents of GSTRING to output a useful string to display, since you cant printf("%s", GSTRING). Thanks for your time and effort.
--Alex


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 8:36 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
There's really no reason to have a function like that. It would just be a simple wrapper of g_printf. Of course, you could easily write your own macro implementation of a GString version of printf() if you wanted.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 10:01 pm 
Offline
Familiar Face

Joined: Mon Aug 27, 2007 10:43 pm
Posts: 14
OK thank you, I just thought they would have already done it since they have other silly functions that ''ease in cross-platform cross-compatibility''. Also so that there is a standard way to do it that is uniformly followed. Thanks for your help though,
--Alex


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group