开发者

C++/Tk: How to create slider and receive its value updates?

So I look at C++/Tk for as a GUI library. I see "lots" of examples - 6. I like its style but I do not see how to create a slider/trackbar. I want such a trackbar that on its value change to have my function called and tb value sent to it. How to do such thi开发者_Go百科ng with C++/Tk?


You want a scale widget (which should be enough that you can find it in the docs) and you need an extra callback function which takes no arguments, reads the current value from the scale, and dispatches to your real function. That extra callback function will be configured into the scale via -command, much as the existing examples for buttons in the docs show. Or you could roll the code to read the value from the scale into your main callback function; your call there…

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜