GNOME Bugzilla – Bug 71430
Resurrect the tutorial
Last modified: 2011-02-04 16:12:10 UTC
As a first step towards updating the tutorial and examples, here is a first patch to make the examples compile (most of them even kind of work). I have only changed the included sources in docs/tutorial/gtk-tut.sgml and fixed the extraction machinery in examples/extract.{sh,awk}, so in order to make use of this patch, do not use the example sources from cvs, extract them from the tutorial. Here is an outline of what needs to be done IMO to get the tutorial ready for 2.0.0: a) make the examples compile with -Dxxx_DISABLE_DEPRECATED b) replace the examples for deprecated widgets with new examples for their nondeprecated counterparts (mainly textview and treeview). c) go over the complete text and update it, including screenshots of all examples. Also make sure that the text stays in sync with the example changes done for a) and b). d) integrate into the build process, remove the examples sources from cvs.
Created attachment 6712 [details] [review] the patch
Looks like a good plan, feel free to go ahead and start making these changes. I did notice that thee 'GdkDevice' part of your patch has a few things that need fixing: + if (event->button == 1 && pixmap != NULL) { + gdouble pressure; + gdk_device_get_axis (event->device, event->axes, GDK_AXIS_PRESSURE, &pressure); + draw_brush (widget, event->device->source, event->x, event->y, pressure); + } This should be: This should be gdk_event_get_axis (event, GDK_AXIS_PRESSURE, &pressure); And similarly for: - pressure = event->pressure; + pressure = 0;
I have committed the patch with your corrections.
*** Bug 70605 has been marked as a duplicate of this bug. ***
I had a look at the current state of the tutorial and I noticed that the changes to make the code deprecation-clean might be good enough for the compiler. They are however not good enough for a tutorial that is supposed to teach users good style. For example: g_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); this was probably converted to the new API using sed. Of course it should be g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL); since otherwise it will confuse people as hell. Please let me know if you need help here.
Obviously, the casting macros should also be adjusted to give a consistent look. Help of course very welcome - the tutorial is a 370-page trum, which is impossible to get through alone. To coordinate things: my next steps would be to look at reducing the progressbar example to something that works with the undeprecated parts of the progressbar api, then move the examples for deprecated or broken widgets to a new "Deprecated Widgets" chapter - or would you think that it would be better to remove them completely ?
I agree that the deprecated stuff should be moved. It would also be nice to give some hints on what should be used instead. Removing them is not a good idea IMHO. I'll look into changing the g_signal occurences now.
I'd think we should remove the deprecated stuff entirely ... a tutorial isn't supposed to be comprehensive; it's supposed to teach people how to program with GTK+.
BTW, I would personally love to see the tutorial integrated into the reference manual (and have links to relevant reference sections throughout). Tutorial could be between the "GTK+ Overview" and "GTK+ Core Reference" sections. Having all the docs in one place with xrefs among all the pieces is really useful.
That is probably a good idea, should help to cut down on the doc duplication and make it easier to have all docs uptodate. But I won't have time to do that for 2.0. Maybe for 2.2. Btw, the deprectated stuff is mostly out of the tutorial as of last night. Unfortunately, the two showpieces of 2.0, the new textview and treeview, are currently not covered at all in tutorial. If anybody wants to help...
Moving docs bugs from 2.0.1 => 2.0.2
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Move remaining 2.2.0 bugs to 2.2.1.
Move remaining bugs off 2.2.2 target milestone.
Move remaining bugs off the 2.2.3 milestone
The issues discussed in this report are mostly resolved. Except: 1. New screenshots 2. No one has contributed textview/treeview sections.
Going to close this one; I don't think it is tracking anything useful any more.