Re: Urgent help on GValue
- From: Olexiy Avramchenko <ath beast stu cn ua>
- To: Matteo Frigerio <drhammerit yahoo it>
- Cc: gtk-list gnome org
- Subject: Re: Urgent help on GValue
- Date: Fri, 04 Oct 2002 15:39:22 +0300
Matteo Frigerio wrote:
Hello, probally for many people this is a stupid
question but i can't understand the way to get the
cursor position in a selectable label (under gtk-2.0).
I use the g_object_get_property(G_OBJECT(mylabel),
"cursor_pos", &mygvalue);
in the focus-in event but don't work. I think
that don't work because i have bad init the GValue.
Really i don't understand how to init a new GValue.
The code that i use is this:
GValue mygvalue;
GType mytype;
memset(&mygvalue,0,sizeof(GValue));
G_TYPE_MAKE_FUNDAMENTAL(mytype);
g_value_init(&mygvalue,&mytype);
but i think this is not good.
Some one can help me ? How code i have to use ?
GValue initalization:
{
GValue value={0};
g_value_init(&value, G_TYPE_INT); /* cursor_position is of gint
type */
}
You can use g_object_get() function to avoid value handling:
{
gint pos;
g_object_get(G_OBJECT(label), "cursor_position",&pos, NULL);
}
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]