Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 gtk.EntryCompletion 来实现自动完成功能。但是列表太长了,弹出窗口会碰到屏幕底部。而且我在pygtk的文档中找不到设置弹出窗口高度的方法。如何在 gtk.EntryCompletion 中设置弹出窗口的高度?
我不知道这是否适用于 gtk.EntryCompletion 小部件,但对于像单元格这样的小部件,您可以使用该cell.set_fixed_height_from_font(True)方法控制它们的高度。
cell.set_fixed_height_from_font(True)
详情请查看gtk.CellRendererTextAPI。
gtk.CellRendererText
也许您可以使用来解决问题,gtk.EntryCompletion.set_minimum_key_length以防止出现长长的建议列表。
gtk.EntryCompletion.set_minimum_key_length