Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Maemo: Developers

gtk_editable_get_selection_bounds

 

 

Maemo developers RSS feed   Index | Next | Previous | View Threaded


p_romero at gmx

Nov 22, 2009, 9:49 AM

Post #1 of 2 (297 views)
Permalink
gtk_editable_get_selection_bounds

Hello,

i use a gtk entry widget in a vbox of a dialog to display a file
location.
Instead to make a copy of the the whole filepath via a butten i would
like to send just the selected text to the default clipboard.
But gtk_editable_get_selection_bounds gives back just the curser
position for start and end. :-(
When i press ctrl-c it works but i hate it to use the keyboard.

Is this a bug or do i something wrong ?
A workaround hint woud be as welcome as well ? :-)

The only known possible bug i found is under the id 255 ... but it is
fixed.


http://test.maemo.org/testzilla/show_bug.cgi?format=multiple&id=255


gint start;
gint end;
GtkWidget *editable;

editable = gtk_entry_new();

if (
gtk_editable_get_selection_bounds(GTK_EDITABLE *editable,&start,&end)
){
//NEVER TRUE
}else{
//EVER FALSE :-(
}

I need it for a mdictionary extention
to easy get the playback location to record the audio file.

Peter Romero
p_romero [at] gmx



_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


hald at icandy

Nov 22, 2009, 10:35 AM

Post #2 of 2 (272 views)
Permalink
Re: gtk_editable_get_selection_bounds [In reply to]

Hi Peter,

I'm not sure I understand your problem correctly, but
gtk_editable_get_selection_bounds() is meant to only return the start
and end positions. If you need the selected text you could call
gtk_editable_get_chars() using the previously obtained positions.

Or maybe gtk_editable_copy_clipboard() is what you want to use? All of
them are explained here:
http://library.gnome.org/devel/gtk/unstable/GtkEditable.html

If I misunderstood you, please tell me.

Cheers!
Conny


On Sun, 2009-11-22 at 18:49 +0100, Peter Romero wrote:
> Hello,
>
> i use a gtk entry widget in a vbox of a dialog to display a file
> location.
> Instead to make a copy of the the whole filepath via a butten i would
> like to send just the selected text to the default clipboard.
> But gtk_editable_get_selection_bounds gives back just the curser
> position for start and end. :-(
> When i press ctrl-c it works but i hate it to use the keyboard.
>
> Is this a bug or do i something wrong ?
> A workaround hint woud be as welcome as well ? :-)
>
> The only known possible bug i found is under the id 255 ... but it is
> fixed.
>
>
> http://test.maemo.org/testzilla/show_bug.cgi?format=multiple&id=255
>
>
> gint start;
> gint end;
> GtkWidget *editable;
>
> editable = gtk_entry_new();
>
> if (
> gtk_editable_get_selection_bounds(GTK_EDITABLE *editable,&start,&end)
> ){
> //NEVER TRUE
> }else{
> //EVER FALSE :-(
> }
>
> I need it for a mdictionary extention
> to easy get the playback location to record the audio file.
>
> Peter Romero
> p_romero [at] gmx
>
>
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers [at] maemo
> https://lists.maemo.org/mailman/listinfo/maemo-developers

_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers

Maemo developers RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.