我如何从 gtk+ scale 中获取整数形式的值?

How do i get an integer form of the value from gtk+ scale?

如何从 gtk+ 中的刻度获取当前值的整数形式?我正在使用 c,我遇到的大部分文档都在谈论 python。我没有发现 gtk 文档特别有用。我正在尝试制作一个简单的体积秤。我一直在寻找与此类似的问题,但没有找到有帮助的问题。

(抱歉回复晚了。)

C 文档是 here. Note that GtkScale is derived from GtkRange (the class hierarchy is on each class page), so you will need to also look at that class's documentation to find the method you want: gtk_range_get_value()。像 gtk_range_get_value(GTK_RANGE(myScale)) 这样调用以避免编译器警告。