100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > GTK参考手册Reference_Manual或叫API手册

GTK参考手册Reference_Manual或叫API手册

时间:2019-01-21 02:15:27

相关推荐

GTK参考手册Reference_Manual或叫API手册

文章目录

一、如何查阅网页版的API手册

二、下载网页版的API手册到本机,设置firefox浏览器实现离线浏览

三、安装firefox浏览器的翻译插件翻译网页中的英文

四、使用wget下载最新版本gtk-4.0的网页版API手册

五、使用wget下载最新版本gdk-4.0的网页版API手册

六、安装/w/网上的C++和C的参考手册,也提供中文版下载的

GTK参考手册Reference_Manual或叫API手册

也叫API手册,Application Programming Interface应用程序编程接口,简单理解就是讲述函数是如何使用

一、如何查阅网页版的API手册

在官网介绍的有三个网站是可以查旧函数的

GTK+ 2 gimp Reference Manual————GTK+ 2.12.9

/api/2.0/gtk/index.html

GTK+ 2 Reference Manual: GTK+ 2 Reference Manual————GTK+ 2.24.33

https://developer-/gtk2/stable/index.html

GTK+ 3 Reference Manual: GTK+ 3 Reference Manual————GTK+ 3.24.29

https://developer-/gtk3/stable/index.html

GTK+ 3 Reference Manual: GTK+ 3 Reference Manual————GTK+ 4.0.3

https://developer-/gtk4/stable/index.html

目前在市面上能淘宝购买到的书籍都是基于gtk+2.0的,书中出现的函数在上面三个网站是可以查到用法的,能够帮助自己理解如何使用达到什么效果,太旧了过时了,就不使用了,确实是这样,但是基本原理用法是不变的,只是使用了新的函数来实现一样的功能,而函数名称也是与旧函数名称相类似的,目前是gtk+4.0,理应是学gtk+4才对,但是市面的书籍是gtk+2.0,在网上查到的例子程序都是gtk+3.0,所以没有书籍是关于gtk+4.0,使用gtk+4.0的例子程序就只有官方API手册里和gtk4-demo

gtk_vbox_new和gtk_hbox_new被gtk_box_new代替了

GTK_SIGNAL_FUNC被G_CALLBACK代替了

gtk_table系列被gtk_grid代替了

gtk_list被gtk_tree_view代替了

gtk_tooltips被gtk_widget_set_tooltip代替了

GtkItemFactory被gtk_builder和glade代替了

gtk_pixmap被gtk_image和gtk_pixbuf代替了

……

在官网介绍的这两个网站就是最新前卫的,当你把函数名称输入搜索,如果没有出现任何内容,就要在上面三个网站搜索了

Gtk – 3.0

/gtk3/

Gtk – 4.0

/gtk4/

如何使用呢?举例查gtk_pixmap,使用关键字pixmap在两个新网站的搜索框输入pixmap搜索出的内容是很少的,那么就要使用三个旧网站搜索,三个旧网站是没有搜索输入框,是单个很长的页面,要使用组合键ctrl+f出现在此网页内查找的输入框,输入关键字pixmap,就会找到相关的几个条目,点击进入,再配合使用浏览器翻译插件将英文网页变成中文,看到弃用和代替的字样,就说明这个函数已经不使用了,被什么函数代替了,“GtkPixmap 自 GTK+ 2.0 起已被弃用,不应使用在新编写的代码中。请改用 GtkImage 。”

”警告 GtkItemFactory已弃用,不应在新编写的代码中使用。“

这篇文章《GTK帮助文档的使用》是专门讲解如何阅读和理解API手册的,有图文教程非常详细,一定必须要看。

/tennysonsky/article/details/42778635

二、下载网页版的API手册到本机,设置firefox浏览器实现离线浏览

打开https://developer-/gtk2/

下载离线文档gtk2-html-2.24.33.tar.gz

https://developer-/gtk2/gtk2-html-2.24.33.tar.gz

打开https://developer-/gtk3/

下载离线文档gtk3-html-3.24.29.tar.gz

https://developer-/gtk3/gtk3-html-3.24.29.tar.gz

打开https://developer-/gtk4/

下载离线文档gtk4-html-3.90.0.tar.gz

https://developer-/gtk4/gtk4-html-3.90.0.tar.gz

ruhong@localhost:~> cd download

ruhong@localhost:~/download> tar -zxvf gtk3-html-3.24.29.tar.gz -C /home/ruhong/

gtk3-html-3.24.29//ch32s07.html

gtk3-html-3.24.29//GtkMenuShell.html

gtk3-html-3.24.29//GtkFontChooserDialog.html

ruhong@localhost:~/download> cd /home/ruhong

ruhong@localhost:~> ls gtk3-html-3.24.29

Applications——互联网——Firefox——文件——打开文件——主目录——gtk3-html-3.24.29——index.html——打开

书签——为此页添加书签——文件夹选择书签工具栏——完成

右上角三根横线——定制——左下角工具栏——勾选书签工具栏——右下角完成

书签——管理所有书签——单击左边的书签工具栏——单击GTK+ 3 Reference Manual: GTK+ 3 Reference Manual拖到顶部第四个位置——在firefox主界面的书签工具栏就出现GTK+ 3 Reference方便单击出现离线浏览查阅函数使用方法

单击书签工具栏中间的GTK+ 3 Reference——单击右上角的翻译网页图标——单击翻译,不要勾选总是翻译英语——出现中文——这个功能要求你的电脑联网

打开index.html主页拉到网页底部——单击Index of all symbols——按字母顺序查找函数

三、安装firefox浏览器的翻译插件翻译网页中的英文

用firefox浏览器打开网址/zh-CN/firefox/——在查找附加组件框中输入关键字“翻译”

翻译网页 作者: Filipe Ps

/zh-CN/firefox/addon/traduzir-paginas-web/?utm_source=&utm_medium=referral&utm_content=search

用firefox浏览器打开网址https://developer-/gtk3/stable/index.html——单击右上角的翻译网页图标——单击翻译,不要勾选总是翻译英语——出现中文,而没有英文对照——再单击右上角的翻译网页图标——单击显示原文——就恢复全英文原网页

在中国是禁止访问谷歌网站自然不能使用翻译功能,还是要使用百度翻译或者腾讯翻译插件最好

四、使用wget下载最新版本4.0的网页版API手册

ruhong@localhost:~> mkdir _gtk4/

在自己的家目录创建文件夹_gtk4

ruhong@localhost:~> cd _gtk4/

进入文件夹_gtk4

ruhong@localhost:~/_gtk4>

ruhong@localhost:~/_gtk4> wget -c -r -np -p -k -L -nd -nH -E --restrict-file-names=windows /gtk4/

使用wget下载最新版本4.0的网页版API手册包括图片,用时为一个小时,完成后文件大小为56MB

–-06-27 00:23:17-- /gtk4/type_func.TreePath.new_from_indicesv.html

再次使用存在的到 :443 的连接。

已发出 HTTP 请求,正在等待回应… 404 Not Found

-06-27 00:23:17 错误 404:Not Found。

…………

下载完毕 ---06-27 00:23:18–

总用时:59m 55s

下载了:6234 个文件,6m 50s (139 KB/s) 中的 56M

正在转换 method.Widget.is_focus.html 中的链接… 178-0

正在转换 method.TextBuffer.get_end_iter.html 中的链接… 87-0

正在转换 vfunc.Widget.focus.html 中的链接… 41-0

正在转换 boBox.has-frame.html 中的链接… 25-0

正在转换 method.NativeDialog.get_visible.html 中的链接… 25-0

正在转换 method.Scrollable.get_hadjustment.html 中的链接… 25-0

正在转换 func.test_accessible_assertion_message_role.html 中的链接… 15-0

…………

正在转换 property.Text.buffer.html 中的链接… 35-0

正在转换 boBox.set_row_separator_func.html 中的链接… 40-0

正在转换 method.Accessible.get_platform_state.html 中的链接… 34-0

正在转换 method.CssSection.get_parent.html 中的链接… 24-0

正在转换 method.Video.set_media_stream.html 中的链接… 28-0

正在转换 style.css 中的链接… 4-0

正在转换 solarized-light.css 中的链接… 不需进行任何操作。

正在转换 fonts.css 中的链接… 29-2

正在转换 solarized-dark.css 中的链接… 不需进行任何操作。

已转换了 6070 个文件中的链接,用时 4.2 秒。

双击_gtk4文件夹中的index.html就会自动使用firefox浏览器打开网页

或者已经知道index.html的绝对路径为/home/suozhang/_gtk4/index.html并将这个绝对路径复制到firefox浏览器的地址也能打开网页——保存到网页书签

单击Classes左边的加号展开所有函数列表,按字母顺序查找,或者组合键Ctrl+F在左下角输入关键字查找函数

五、使用wget下载最新版本gdk-4.0的网页版API手册

ruhong@localhost:~/_gdk4> wget -c -r -np -p -k -L -nd -nH -E --restrict-file-names=windows /gdk4/

使用wget下载最新版本gdk-4.0的网页版API手册包括图片,用时为25分钟,完成后文件大小为14MB

…………

–-08-03 20:32:18-- /gdk4/method.Device.get_tool.html

重用已有的的到 []:443 的连接

已发出 HTTP 请求,正在等待回应… 404 Not Found

-08-03 20:32:19 错误 404:Not Found。

下载完毕 ---08-03 20:32:19–

总用时:25m 28s

下载了:3090 个文件,5m 6s (47.6 KB/s) 中的 14M

正在转换 const.KEY_Armenian_cha.html 中的链接… 12-0

正在转换 const.KEY_braille_dots_125678.html 中的链接… 12-0

正在转换 const.KEY_Hangul_KiyeogSios.html 中的链接… 12-0

正在转换 const.KEY_Greek_omegaaccent.html 中的链接… 12-0

…………

六、安装/w/网上的C++和C的参考手册,也提供中文版下载的

/w/%E9%A6%96%E9%A1%B5

/w/Cppreference:Archives

localhost:~ # zypper search cppreference

Loading repository data…

Reading installed packages…

S | Name | Summary | Type

–±-------------------------±--------------------------------------------±-------

| cppreference-doc | Cppreference documentation for offline re-> | package

| cppreference-doc-devhelp | Cppreference documentation for offline re-> | package

| cppreference-doc-qhelp | Cppreference documentation for offline re-> | package

localhost:~ # zypper install cppreference-doc

localhost:~ # rpm -ql cppreference-doc

/usr/share/cppreference/doc/html/en/Main_Page.html

/usr/share/cppreference/doc/html/en/c

……

/usr/share/cppreference/doc/html/en/index.html

……

复制/usr/share/cppreference/doc/html/en/index.html到firefox浏览器地址栏中就可以了

安装API手册文档浏览器devhelp

localhost:~ # zypper install devhelp devhelp-devel

localhost:~ # zypper install vim-plugin-devhelp gedit-plugin-devhelp

localhost:~ # zypper install cppreference-doc-devhelp

localhost:~ # rpm -ql cppreference-doc-devhelp

/usr/share/devhelp/books/cppreference-doc-en-c

/usr/share/devhelp/books/cppreference-doc-en-c/cppreference-doc-en-c.devhelp2

/usr/share/devhelp/books/cppreference-doc-en-cpp

/usr/share/devhelp/books/cppreference-doc-en-cpp/cppreference-doc-en-cpp.devhelp2

应用程序——编程——Devhelp——C Standard Library reference或者C++ Standard Library reference

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。