entry problem



Good afternoon!

I have some questions - they may not be considered as gtk problems. 
When I use entry in a dialog box for user to input something,I can
get the text out by calling gtk_entry_get_text(). And there is another
function can be called according to the reference gtk_editable_get_
chars(). The difference between these two functions is that one
should never be released using g_free(), but the other can. I am 
using the first one as follow:

gchar *buf;

buf = gtk_entry_get_text();

So, here comes my question:
1. whether or not it is required that I allocate some memory to "buf" 
using g_malloc().
2. If g_malloc() is required, then can I release "buf" using g_free();
3. I don't know where is my bug, my program results in "CORE DUMPED" 
from time to time.

thanks!
                                mailaxe


_____________________________________________
首都在线--先进中国人的网上家园 http://www.263.net
免费邮箱 邮件杂志 签名邮件 邮件加密 邮件追身呼
搜索引擎 个人站点 在线游戏 网上聊天 网上挂号
金融王国 在线杀毒 跳蚤市场 软件下载 休闲娱乐
诺方安全,助您e路平安



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