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 Oct 21, 2014 1:33 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: GTK+ and Glade tutorials
PostPosted: Mon Mar 31, 2014 10:21 pm 
Offline
Familiar Face

Joined: Mon Mar 31, 2014 9:59 pm
Posts: 16
I have worked through this tutorial:

http://python-gtk-3-tutorial.readthedocs.org/en/latest/#

and now started to make a basic layout of an application in Glade. Does anybody know any more tutorials that explain

* opening and closing of dialogs
* opening and saving a file
* placing a matplotlib widget in one of the widget-cells
* which dialogs should be done in glade and which should be done in the python-code

_________________
I am learning to develop GTK+ (GTK 3.10) programs written in Python 3.4.0, designed with Glade 3.16.1, with plots using Matplotlib 1.4. I program and test using Ubuntu 14.04 (64bit) and Gedit. (http://gtk3-matplotlib-cookbook.readthedocs.org)


Top
 Profile  
 
 Post subject: Re: GTK+ and Glade tutorials
PostPosted: Tue Apr 01, 2014 9:19 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
Hello,

- More tutorials on opening and closing dialogs/windows can be found at https://developer.gnome.org/gnome-devel-demos/stable/py.html.en. This also has many other widgets and some demo applications.

- With regards to opening and saving a file. GTK+ provides a widget for selecting files called a File Choose Dialog. There is a demo/tutorial at https://developer.gnome.org/gnome-devel-demos/stable/filechooserdialog.py.html.en. How you actually save/load the data depends on the file format. GTK/GLib/GDK-Pixbuf provide some ways to load/save data such as a basic XML parser, image load/saving. There are too many file formats to list here and GTK+/GLib/GDK-PixBuf can only have a few built in. More documentation on the Python GObject can be found at http://lazka.github.io/pgi-docs/. There is almost certainly going to be something there that can load/save your file.

- I have never used matplotlib so can not give exact help here. I would expect it to work like any other widget where you place the widget inside a container such as a GtkGrid. Just remember to use the correct version for the GTK+/Python you are using.

- The point where you decide to use Glade or Python code depends on your design decisions. For example small Alert style dialogs and about dialogs I would do in code as the code to load them using GtkBuilder would be bigger than the code to generate them manually. For windows containing many widgets then I would definitely use Glade.

_________________
E.


Top
 Profile  
 
 Post subject: Re: GTK+ and Glade tutorials
PostPosted: Tue Apr 01, 2014 9:05 pm 
Offline
Familiar Face

Joined: Mon Mar 31, 2014 9:59 pm
Posts: 16
Thank you for your detailed advice. I will look at those tutorials and try to figure some of these things out. I just started programming so there is much to learn. I will post as soon as I find more concrete solutions to my problems.

_________________
I am learning to develop GTK+ (GTK 3.10) programs written in Python 3.4.0, designed with Glade 3.16.1, with plots using Matplotlib 1.4. I program and test using Ubuntu 14.04 (64bit) and Gedit. (http://gtk3-matplotlib-cookbook.readthedocs.org)


Top
 Profile  
 
 Post subject: Re: GTK+ and Glade tutorials
PostPosted: Wed Jul 02, 2014 2:57 pm 
Offline
Familiar Face

Joined: Mon Mar 31, 2014 9:59 pm
Posts: 16
I made some progress with Matplotlib. I am documenting my progress as I figure things out. If you want to read along head to: https://github.com/spiessbuerger/GTK3-M ... b-Cookbook or http://gtk3-matplotlib-cookbook.readthedocs.org

_________________
I am learning to develop GTK+ (GTK 3.10) programs written in Python 3.4.0, designed with Glade 3.16.1, with plots using Matplotlib 1.4. I program and test using Ubuntu 14.04 (64bit) and Gedit. (http://gtk3-matplotlib-cookbook.readthedocs.org)


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 4 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