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:27 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Texts with links in a gtktreeview
PostPosted: Wed Jul 25, 2012 10:27 am 
Offline

Joined: Wed Jul 25, 2012 10:20 am
Posts: 2
Hi,

I 've been searching for many hours on the net to find how to put texts with links in a gtkreeview but I didn't find an answer.
Basically what I want to do is when you click on a text in the gtktreeview, a pdf file opens.

If someone can hand me an example that would be great !


Top
 Profile  
 
 Post subject: Re: Texts with links in a gtktreeview
PostPosted: Wed Jul 25, 2012 4:00 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hello and welcome to the GTK+ forums!

Do you need to detect clicks on certain parts of text or is simple row/cell detection enough for you?

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: Texts with links in a gtktreeview
PostPosted: Thu Jul 26, 2012 8:18 am 
Offline

Joined: Wed Jul 25, 2012 10:20 am
Posts: 2
Hello,
I just need to click on a cell to open a pdf file


Top
 Profile  
 
 Post subject: Re: Texts with links in a gtktreeview
PostPosted: Fri Jul 27, 2012 12:48 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hi.

The exact solution to this problem depends on the layout of your tree view. If yo list single pdf file per row, you can simply monitor GtkTreeSelection::changed signal and do the right stuff from there. If you list multiple pdfs per row, you'll need to detect eaxct loaction of your click, convert coordinates to the one relative to the display GdkWindow using one of the functions listed here and then proceed from there.

Cheers,
Tadej


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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