From cc9ac5b7eaeb93578e9e12059648400ec76b1a3f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 24 Sep 2010 13:41:29 -0400 Subject: [PATCH] Update docs of GtkAboutDialog and GtkLinkButton Remove references to global hooks from the docs. Also move remaining docs inline, and remove the templates. --- docs/reference/gtk/tmpl/.gitignore | 2 + docs/reference/gtk/tmpl/gtklinkbutton.sgml | 139 --------------------- gtk/gtkaboutdialog.c | 39 ++---- gtk/gtklinkbutton.c | 22 ++++ 4 files changed, 32 insertions(+), 170 deletions(-) delete mode 100644 docs/reference/gtk/tmpl/gtklinkbutton.sgml diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore index b2a8ccb9ca..4dd9c0c508 100644 --- a/docs/reference/gtk/tmpl/.gitignore +++ b/docs/reference/gtk/tmpl/.gitignore @@ -1,4 +1,5 @@ gtkactiongroup.sgml +gtkaboutdialog.sgml gtkbbox.sgml gtkbox.sgml gtkbuilder.sgml @@ -10,6 +11,7 @@ gtkhbox.sgml gtkiconview.sgml gtkimcontextsimple.sgml gtkimmulticontext.sgml +gtklinkbutton.sgml gtkmessagedialog.sgml gtkobject.sgml gtkorientable.sgml diff --git a/docs/reference/gtk/tmpl/gtklinkbutton.sgml b/docs/reference/gtk/tmpl/gtklinkbutton.sgml deleted file mode 100644 index 084efabff7..0000000000 --- a/docs/reference/gtk/tmpl/gtklinkbutton.sgml +++ /dev/null @@ -1,139 +0,0 @@ - -GtkLinkButton - - -Create buttons bound to a URL - - - -A #GtkLinkButton is a #GtkButton with a hyperlink, similar to the one -used by web browsers, which triggers an action when clicked. It is useful -to show quick links to resources. - - - -A link button is created by calling either gtk_link_button_new() or -gtk_link_button_new_with_label(). If using the former, the URI you pass -to the constructor is used as a label for the widget. - - - -The URI bound to a #GtkLinkButton can be set specifically using -gtk_link_button_set_uri(), and retrieved using gtk_link_button_get_uri(). - - - -#GtkLinkButton offers a global hook, which is called when the used clicks -on it: see gtk_link_button_set_uri_hook(). - - - -#GtkLinkButton was added in GTK+ 2.10. - - - - -#GtkButton - - - - - - - - - - -The #GtkLinkButton struct contains private data only, and should be -manipulated using the functions below. - - - - - - - - - - - - - - - - - - -@uri: -@Returns: - - - - - - - -@uri: -@label: -@Returns: - - - - - - - -@link_button: -@Returns: - - - - - - - -@link_button: -@uri: - - - - -The type of a function which is called when the #GtkLinkButton is -clicked. - - -@button: the #GtkLinkButton which was clicked -@link_: the URI to which the clicked #GtkLinkButton points -@user_data: user data that was passed when the function was registered - with gtk_link_button_set_uri_hook() - - - - - - - -@func: -@data: -@destroy: -@Returns: - - - - - - - -@link_button: -@Returns: - - - - - - - -@link_button: -@visited: - - diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 4901feafa4..63d3cbe77b 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -60,41 +60,21 @@ * SECTION:gtkaboutdialog * @Short_description: Display information about an application * @Title: GtkAboutDialog - * @See_also:#GTK_STOCK_ABOUT + * @See_also: #GTK_STOCK_ABOUT * - * The #GtkAboutDialog offers a simple way to display information about + * The GtkAboutDialog offers a simple way to display information about * a program like its logo, name, copyright, website and license. It is * also possible to give credits to the authors, documenters, translators * and artists who have worked on the program. An about dialog is typically * opened when the user selects the About option from * the Help menu. All parts of the dialog are optional. * - * About dialog often contain links and email addresses. #GtkAboutDialog - * supports this by offering global hooks, which are called when the user - * clicks on a link or email address, see gtk_about_dialog_set_email_hook() - * and gtk_about_dialog_set_url_hook(). Email addresses in the - * authors, documenters and artists properties are recognized by looking for - * <user@host>, URLs are - * recognized by looking for http://url, with - * url extending to the next space, tab or line break. + * About dialog often contain links and email addresses. GtkAboutDialog + * displays these as clickable links. By default, it calls gtk_show_uri() + * when a user clicks one. The behaviour can be overridden with the + * #GtkAboutDialog::activate-link signal. * - * - * Since 2.18 #GtkAboutDialog provides default website and email hooks that - * use gtk_show_uri(). - * - * - * If you want provide your own hooks overriding the default ones, it is - * important to do so before setting the website and email URL properties, - * like this: - * - * gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL); - * gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url); - * - * To disable the default hooks, you can pass %NULL as the hook func. Then, - * the #GtkAboutDialog widget will not display the website or the - * email addresses as clickable. - * - * To make constructing a #GtkAboutDialog as convenient as possible, you can + * To make constructing a GtkAboutDialog as convenient as possible, you can * use the function gtk_show_about_dialog() which constructs and shows a dialog * and keeps it around so that it can be shown again. * @@ -102,7 +82,7 @@ * on the dialog window (where %s is replaced by the name of the * application, but in order to ensure proper translation of the title, * applications should set the title property explicitly when constructing - * a #GtkAboutDialog, as shown in the following example: + * a GtkAboutDialog, as shown in the following example: * * gtk_show_about_dialog (NULL, * "program-name", "ExampleCode", @@ -110,9 +90,6 @@ * "title" _("About ExampleCode"), * NULL); * - * Note that prior to GTK+ 2.12, the #GtkAboutDialog:program-name property - * was called "name". This was changed to avoid the conflict with the - * #GtkWidget:name property. */ static GdkColor default_link_color = { 0, 0, 0, 0xeeee }; diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c index 85de592c0f..027c7ee524 100644 --- a/gtk/gtklinkbutton.c +++ b/gtk/gtklinkbutton.c @@ -22,6 +22,28 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. */ +/** + * SECTION:gtklinkbutton + * @Title: GtkLinkButton + * @Short_description: Create buttons bound to a URL + * @See_also: #GtkButton + * + * A GtkLinkButton is a #GtkButton with a hyperlink, similar to the one + * used by web browsers, which triggers an action when clicked. It is useful + * to show quick links to resources. + * + * A link button is created by calling either gtk_link_button_new() or + * gtk_link_button_new_with_label(). If using the former, the URI you pass + * to the constructor is used as a label for the widget. + * + * The URI bound to a GtkLinkButton can be set specifically using + * gtk_link_button_set_uri(), and retrieved using gtk_link_button_get_uri(). + * + * By default, GtkLinkButton calls gtk_show_uri() when the button is + * clicked. This behaviour can be overridden by connecting to the + * #GtkButton::clicked signal. + */ + #include "config.h" #include "gtklinkbutton.h"