【发布时间】:2012-04-28 15:35:24
【问题描述】:
我想将• 插入到 GtkTextView 小部件中。在 Python + pyGTK 中,这一行就足够了:
self.__textBuffer.insert_at_cursor(u'\u2022')
因为我正在将我的应用程序重写为 C,所以我需要翻译这行代码。
我想这样做:
gtk_text_buffer_insert_at_cursor(textBuffer, "\x20\x22", 2);
但它不起作用,只插入了2个字符"*。
如何将 u'\u2022' 从 Python 翻译成 C?
【问题讨论】:
-
为什么不直接做 gtk_text_buffer_insert_at_cursor(textBuffer, "•", strlen("•"))?