代码之家  ›  专栏  ›  技术社区  ›  gavr

vala textbuffer backspace()信号段

  •  0
  • gavr  · 技术社区  · 7 年前

    为了练习在瓦拉身上写字,我决定做一个虚拟键盘。一切正常,除了退格键(如果按的话是sigseg)。

    https://developer.gnome.org/pygtk/stable/class-gtktextbuffer.html#method-gtktextbuffer--end-user-action 我在vala中没有找到使用此函数的任何示例。 source

    1 回复  |  直到 7 年前
        1
  •  0
  •   gavr    7 年前

    我不知道为什么,但如果你换了它就行了

    Sas.end.backward_chars (Sas.input.buffer.cursor_position);
    

    具有

    Sas.input.buffer.get_iter_at_offset(out Sas.end,Sas.input.buffer.cursor_position);
    

    Sigseg在线:

    Sas.input.buffer.backspace(Sas.end,true,true);
    

    P.S.输入-文本视图,结束-文本编辑器。