List Info

Thread: text selection




text selection
country flaguser name
Germany
2007-06-26 11:27:31
Hello,
I am new to the pango api. I want to use pango to draw
text(-boxes) with 
cairo (GUI for gaming). The textboxes are displayed to the
screen and 
the user should be able to select text from the text box
with the mouse 
and put the text curser to any location of the text.
The mouse coordinates are available as pixels. Does the
pango library 
provide an interface to do text selections for me? (i.e. a
function with 
the mouse coordinates as arguments which returns something
like: "Mouse 
is at text position X", and then I can access my text
string/char array 
at position X (text[X]) to get the char)

Kind regards
Ulrich
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-listgnome.org

http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: text selection
country flaguser name
United States
2007-06-27 12:30:50
On Tue, 2007-06-26 at 18:27 +0200, Ulrich Mierendorff
wrote:
> Hello,
> I am new to the pango api. I want to use pango to draw
text(-boxes) with 
> cairo (GUI for gaming). The textboxes are displayed to
the screen and 
> the user should be able to select text from the text
box with the mouse 
> and put the text curser to any location of the text.
> The mouse coordinates are available as pixels. Does the
pango library 
> provide an interface to do text selections for me?
(i.e. a function with 
> the mouse coordinates as arguments which returns
something like: "Mouse 
> is at text position X", and then I can access my
text string/char array 
> at position X (text[X]) to get the char)

Pango does that.  See pango_layout_xy_to_index() and
friends:

http://developer.
gnome.org/doc/API/2.0/pango/pango-Layout-Objects.html#pango-
layout-xy-to-index


> Kind regards
> Ulrich

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase
a little
 Temporary Safety, deserve neither Liberty nor
Safety."
        -- Benjamin Franklin, 1759



_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-listgnome.org

http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: text selection
country flaguser name
Germany
2007-06-27 12:39:16
Thanks a lot! This is exactly what I need.

Behdad Esfahbod schrieb:
>
> Pango does that.  See pango_layout_xy_to_index() and
friends:
>
> http://developer.
gnome.org/doc/API/2.0/pango/pango-Layout-Objects.html#pango-
layout-xy-to-index
>
>
>   
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-listgnome.org

http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )