Sha256: ce9e512d8192a0260d19903272335a6222cb80bb9e70b17d12b6b686da53380e
Contents?: true
Size: 1.18 KB
Versions: 20
Compression:
Stored size: 1.18 KB
Contents
--- :wxTextEntry.GetInsertionPoint: :detail: :pre: :programlisting: - :pattern: !ruby/regexp /.*/ :replace: | ```ruby def get_current_char(txt_ctrl) pos = txt_ctrl.get_insertion_point return '' if pos == txt_ctrl.get_last_position txt_ctrl.get_range(pos, pos + 1) end ``` :wxTextCompleterSimple: :detail: :pre: :programlisting: - :pattern: !ruby/regexp /.*/ :replace: | ```ruby class MyTextCompleter < Wx::TextCompleterSimple def get_completions(prefix) firstWord = prefix.split(' ').shift if firstWord == 'white' ['white pawn', 'white rook'] elsif firstWord == 'black' ['black king', 'black queen'] else ['white', 'black'] end end end ... text_ctrl = ... text_ctrl.auto_complete(MyTextCompleter.new) ```
Version data entries
20 entries across 20 versions & 1 rubygems