简体   繁体   English

gtkmm用于桌面应用程序

[英]gtkmm for desktop application

Is it a good idea to use gtkmm gui toolkit for some desktop client application ? 对某些桌面客户端应用程序使用gtkmm gui工具包是一个好主意吗?

Is this toolkit stable and is there enough documentation online ? 这个工具包是否稳定,是否有足够的在线文档?

I used gtkmm to write professional applications and yes you can use it for real world software development. 我使用gtkmm编写专业应用程序,是的,你可以用它来进行真实的软件开发。

But I also used C/GTK+ and C++/Qt and my opinion is that using Gtkmm you have the feeling that the original toolkit was meant to be used in C and the porting to C++ is ok but in many cases you feel that C++ features could have been used better. 但我也使用过C / GTK +和C ++ / Qt,我的意见是使用Gtkmm你觉得原来的工具包本来是用在C语言中并且移植到C ++是好的但是在很多情况下你觉得C ++的功能可以已被更好地使用。

For Comparison: 比较:

If you have to choose between Gtk and Gtkmm go for Gtkmm even though you might find yourself stuck in some not well documented or supported function. 如果您必须在Gtk和Gtkmm之间进行选择,请选择Gtkmm,即使您可能发现自己陷入了一些记录不充分或受支持的功能。 Eventually you always manage to find a solution (you can check the source code) and c++ is way better then c. 最终你总是设法找到一个解决方案(你可以查看源代码),c ++比c更好。

If you have to choose between Gtkmm and Qt, go for Qt. 如果您必须在Gtkmm和Qt之间进行选择,请选择Qt。 There is a HUGE gap between the two. 两者之间存在巨大差距。 Not only in the toolkit itself but in the documentation and all the other classes that you need when writing an application. 不仅在工具包本身,而且在文档和编写应用程序时所需的所有其他类中。

I started two month ago with gtkmm. 我两个月前用gtkmm开始。 I actually port a tcl/tk application and it feels very hard for my to get the things run. 我实际上移植了一个tcl / tk应用程序,让我感觉很困难。 The only useful documentation I found is the https://developer.gnome.org/gtkmm-tutorial/3.4/ 我找到的唯一有用的文档是https://developer.gnome.org/gtkmm-tutorial/3.4/

But many things described in the manual are not working! 但是手册中描述的很多东西都不起作用! I actually run into trouble while overriding signal handlers which should work but didn't. 我实际上在覆盖信号处理程序时会遇到麻烦,而信号处理程序应该可以工作但却没有。 Maybe you will take a look in gtkmm-list@gnome.org to find out what kind of problems yo will maybe run in :-) 也许你会看一下gtkmm-list@gnome.org,看看你可能会遇到什么样的问题:-)

The docs derived from the doxygen input seems useless for me, because the functions are mostly not described and the parameter names or often not very clear to me. 从doxygen输入派生的文档对我来说似乎没用,因为函数大部分都没有描述,参数名称或者我常常不太清楚。

In comparison to tcl/tk the interface looks inconsistent. 与tcl / tk相比,接口看起来不一致。 Sometimes a parameter must be provided by a text, sometimes by a pointer and sometimes by the native value itself. 有时参数必须由文本提供,有时必须由指针提供,有时由本机值本身提供。 Especially the menus are very "mysterious" with the string based configuration. 特别是基于字符串的配置菜单非常“神秘”。 The need of having parameters as text is very unhandy! 将参数作为文本的需要是非常不方便的! You have to convert the parameter with ostrstream into a text and parse the parameters sometimes yourself from text to real values. 您必须将带有ostrstream的参数转换为文本,并有时将参数从文本解析为实际值。

I decided to give gtk+ a chance is the existence of the c++ interface. 我决定给gtk +一个机会就是存在c ++接口。 I thought it would be helpful to get the errors in compile time and not while running the app like with tcl/tk. 我认为在编译时获取错误会有所帮助,而不是像运行tcl / tk一样运行应用程序。 But this is not the always true with gtkmm. 但这并不总是与gtkmm一致。 With gtkmm you are also able to run into run time errors because all string parameters will be parsed during run time! 使用gtkmm,您还可以遇到运行时错误,因为所有字符串参数都将在运行时解析! This makes the things error prone! 这使事情容易出错!

Maybe I will start again and give Qt a chance. 也许我会重新开始并给Qt一个机会。 But a first view on it shows, that this seems not really better :-) 但是它的第一个观点显示,这似乎并不是更好:-)

Writing a gui application still is a really annoying job! 编写一个gui应用程序仍然是一个非常烦人的工作!

gtkmm is a official supported binding of GTK (gtk.org/language-bindings.php). gtkmm是官方支持的GTK绑定(gtk.org/language-bindings.php)。

"inkscape" and "ardour" are notable applications written in gtkmm “inkscape”和“ardor”是用gtkmm编写的着名应用程序

The bindings that are official GNOME Bindings follow the GNOME release schedule which guarantees API stability and time-based releases. 官方GNOME绑定的绑定遵循GNOME发布计划,该计划保证API稳定性和基于时间的发布。

If you want to write your Application in C, go with GTK+ (and the GLib). 如果您想用C编写应用程序,请使用GTK +(和GLib)。

You can find a link to the documentation at http://www.gtkmm.org/ ( https://developer.gnome.org/gtkmm-tutorial/ ). 你可以找到一个链接到文件http://www.gtkmm.org/https://developer.gnome.org/gtkmm-tutorial/ )。

With Glade (and ie. PyGTK) you could rapid prototype your application. 使用Glade (即PyGTK),您可以快速构建应用程序原型。 Building a GUI with Glade is easy and the resulting UI is a xml file, that is not bound to a programming language. 使用Glade构建GUI非常简单,生成的UI是一个xml文件,不受编程语言的约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM