gtk自定义旋转按钮 [英] gtk custom spin button

查看:138
本文介绍了gtk自定义旋转按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 是否有更简单的方法将日期输入到GTK中?

    / li>

  2. 如果不是,我如何创建SpinButton外观相似,但是其输出是代表日期而不是整数的文本?理想情况下,我会重新使用箭头,点击,与调整的整合等。我真的只需要输出看起来不同,因为我甚至可以将日期表示为整数。

  3. ol>

    解决方案

    日历有点大,但您可以找到将其放入弹出窗口的代码。就个人而言,我使用常规文本输入并解析日期。



    对于SpinButton,它基于一个文本输入,所以您可能只能修改其显示摆弄继承的信号并返回False。另请参阅update-policy和数字属性。


    I want to make a gtk SpinButton, but for inputting dates.

    1. Is there an easier way to input dates into GTK?
    2. If not, how can I create a SpinButton look-alike, but whose output is text representing dates instead of integers? Ideally I'd re-use the arrows, the clicks, the integration with the adjustment, etc. I really just need the output to look different, as I can even represent dates as integers.

    解决方案

    The calendar is a bit large, but you can find code putting it in a popup. Personally I use a regular text entry and parse the date.

    As for SpinButton, it is based on a text entry, so you might be able to modify its display only by fiddling with inherited signals and returning False. See also the update-policy and numeric properties.

    这篇关于gtk自定义旋转按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆