GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 23, 2014 8:24 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Where to find source code of GTK?
PostPosted: Fri Nov 04, 2011 6:02 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
Hello all,

I am a new user of GTK, and I would be happy if you could find time to answer my question.
I want to find the code of GTK functions that interests me, for example "gtk_main_iteration_do".
The best I could find is the next links: http://git.gnome.org/browse/, but I canĀ“t find what I need here...:-(

Thank you all,
Felix.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Fri Nov 04, 2011 6:24 pm 
Offline
GTK+ Guru

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 286
Location: Fortress of solitude
gtk.org, maybe

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Fri Nov 04, 2011 6:25 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 747
Location: UK
Hi,

Not sure this is really going to help you, but here are the links to the source code.

Link to the various GTK+ branches.
http://git.gnome.org/browse/gtk+/

Link to the GTK+ 3 branch.
http://git.gnome.org/browse/gtk+/tree/gtk?h=gtk-3-0

Link to the source code to gtkmain.c in the 3.0 branch. This contains the source to gtk_main_iteration_do(). To be honest that bit of code is short and not very exciting.
http://git.gnome.org/browse/gtk+/tree/gtk/gtkmain.c?h=gtk-3-0

E.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Wed Nov 09, 2011 4:59 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
Hello All,

Thank you all for the answers.
I have another question, regarding this issue:
I am writing a real time code (video streaming from a camera), and the function that delays it is "gtk_main_iteration_do".

Is there a function in GTK that does the same job, but it is faster?

Thank you all in advance,
Felix.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Wed Nov 09, 2011 5:12 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
errol wrote:
Hi,

Not sure this is really going to help you, but here are the links to the source code.

Link to the various GTK+ branches.
http://git.gnome.org/browse/gtk+/

Link to the GTK+ 3 branch.
http://git.gnome.org/browse/gtk+/tree/gtk?h=gtk-3-0

Link to the source code to gtkmain.c in the 3.0 branch. This contains the source to gtk_main_iteration_do(). To be honest that bit of code is short and not very exciting.
http://git.gnome.org/browse/gtk+/tree/gtk/gtkmain.c?h=gtk-3-0

E.


Hello Errol,

Thanks a lot for your answer.
Can you please explain briefly (or not briefly :) ), how do I find a code of a GTK function, that interests me, in those links.
I mean, what is the logical structure of it? How do I know in which file I can find what?

Thanks in advance,
Felix.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Fri Nov 11, 2011 8:00 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 747
Location: UK
I would personally not look at the source code for GTK+ if you want to learn how to use it. It is more likely to confuse you than help. You will be better off reading the documentation and working through the tutorials. There are many links here on this message board.

http://www.gtkforums.com/viewtopic.php?f=3&t=988

Note some of those links may be very old and work with very old versions of GTK.

E.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Tue Nov 15, 2011 4:06 pm 
Offline
Familiar Face

Joined: Mon Oct 17, 2011 10:18 am
Posts: 26
errol wrote:
I would personally not look at the source code for GTK+ if you want to learn how to use it. It is more likely to confuse you than help. You will be better off reading the documentation and working through the tutorials. There are many links here on this message board.

http://www.gtkforums.com/viewtopic.php?f=3&t=988

Note some of those links may be very old and work with very old versions of GTK.

E.


Thanks a lot for your answers.
I really appreciate the fact, that you have found time to answer me.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Tue Dec 20, 2011 7:20 am 
Offline
GTK+ Guru

Joined: Fri Mar 25, 2011 5:16 pm
Posts: 177
Location: USA
If you haven't already install libgtk-3-doc, ( Documentation for the GTK+ graphical user interface library ) Then install Glade. In Glade after you add a widget you can right click on it in the hierarchy view or on any of it's properties and it will take you to the documentation for that property.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Fri Mar 02, 2012 7:37 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 747
Location: UK
Welcome to the forum,

The original poster wanted just one particular part of the source code to try and understand how the GTK main loop works. I pointed out that this may not be the best way to do this and to read the documentation would be better. Where you pointed the down load is a 12Mb tar ball download plus you will still need Glib as that is where all the work is really done and that is another 5.7Mb tar ball download.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Where to find source code of GTK?
PostPosted: Sat Mar 03, 2012 12:37 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Dear Felix,
no there is no way of speeding up gtk_main_iteration_do excepting ways in which it is dependent on the scale and efficient design of your GUI.
Your best control over streamlining your program is in terms of how often gtk_main_iteration_do is being called and if it is really necessary to do so. If it is to check for user input then there is rarely need for it to be called faster than human reflex. If its to update a window to display the streaming video then gtk is probably not the best medium to do this through.


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

All times are UTC


Who is online

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