cursor-position

How to display coordinates and use ginput

删除回忆录丶 提交于 2019-12-01 03:23:09
问题 I cannot seem to get my image to display the coordinates of my mouse cursor, and also use ginput to store points at the same time. I currently am trying the following: MriHotrod = imread('Image.bmp'); Fig = figure('Name','BobDole'),... imshow(Image, 'InitialMagnification', 250) axis on impixelinfo Image_1 = ginput(4) close BobDole The ginput still works, but the impixelinfo stays constant Pixel Info = (X, Y) Pixel Value I am aware of some methods of getting around this, but they involve

Set cursor position in a Text widget

时光毁灭记忆、已成空白 提交于 2019-11-30 13:28:41
Is it possible to set the cursor position in a Tkinter Text widget? I'm not finding anything terribly useful yet. The best I've been able to do is emit a <Button-1> and <ButtonRelease-1> event at a certain x-y coordinate, but that is a pixel amount, not a letter amount. jsbueno If "text", "line", and "column" are your text object, the desired text line and desired column variables are, respectively: text.mark_set("insert", "%d.%d" % (line + 1, column + 1)) If you would not like to care about the line number... well, you have to. Complete documentation at: http://effbot.org/tkinterbook/text.htm

Setting cursor at the end of any text of a textbox [duplicate]

我只是一个虾纸丫 提交于 2019-11-29 21:17:14
This question already has an answer here: Set the caret/cursor position to the end of the string value WPF textbox 5 answers I have a text box with a displayed string already in it. To bring the cursor to the textbox I am already doing txtbox.Focus(); But how do I get the cursor at the end of the string in the textbox ? Panu Oksala For Windows Forms you can control cursor position (and selection) with txtbox.SelectionStart and txtbox.SelectionLength properties. If you want to set caret to end try this: txtbox.SelectionStart = txtbox.Text.Length; txtbox.SelectionLength = 0; For WPF see this

Set cursor position in a Text widget

风格不统一 提交于 2019-11-29 19:46:32
问题 Is it possible to set the cursor position in a Tkinter Text widget? I'm not finding anything terribly useful yet. The best I've been able to do is emit a <Button-1> and <ButtonRelease-1> event at a certain x-y coordinate, but that is a pixel amount, not a letter amount. 回答1: If "text", "line", and "column" are your text object, the desired text line and desired column variables are, respectively: text.mark_set("insert", "%d.%d" % (line + 1, column + 1)) If you would not like to care about the

How to get mouse position over a certain control

微笑、不失礼 提交于 2019-11-29 10:35:44
Windows Form I'm using the DragOver event on a layoutpanel and the DragEventArgs returns the X/Y coordinates of the mouse in relation to the screen. I know there is a function to translate this in to the position of the mouse over the control, but I'm having difficulty locating it. Try Control.PointToClient and Control.PointToScreen . 来源: https://stackoverflow.com/questions/465545/how-to-get-mouse-position-over-a-certain-control

How can I lock the cursor to the inside of a window on Mac OS X?

久未见 提交于 2019-11-29 06:46:44
I'm trying to put together a game for Mac OS X which involves a lot of fast action and flinging around of the mouse cursor. If the user wants to play in windowed mode, I'd quite like to lock the cursor to the inside of the window to avoid accidentally changing programs in the heat of battle (obviously this will cancel itself if the user changes programs or hits escape for the pause menu.) On Windows, this can be accomplished easily with ClipCursor() . I can't find an equivalent on Mac OS X. Is there one? Have a look at CGWarpMouseCursorPosition, CGAssociateMouseAndMouseCursorPosition and

Adding ANSI color escape sequences to a bash prompt results in bad cursor position when recalling/editing commands

谁都会走 提交于 2019-11-29 03:44:06
If I set my command prompt like: export PS1='\033[0;33m[\u@\h \w]\$ \033[00m' The color of the prompt will be yellow and everything after the '$' character will be the default terminal color. This is what I expect. However, If I recall a command line and attempt to edit it, moving the cursor -- either UpArrow/Ctrl-A (set -o emacs) or ESC K (set -o vi) if the command line I'm trying to edit is long enough, the cursor is not positioned at the beginning of the command. Typing either Ctrl-A (set -o emacs) or ^ (set -o vi) will not move the cursor to what I'm seeing as the beginning of the recalled

How to move screen without moving cursor in Vim?

扶醉桌前 提交于 2019-11-28 14:54:01
I recently discovered Ctrl + E and Ctrl + Y shortcuts for Vim that respectively move the screen up and down with a one line step, without moving the cursor . Do you know any command that leaves the cursor where it is but moves the screen so that the line which has the cursor becomes the first line? (having a command for the last line would be a nice bonus). I can achieve this by manually pressing Ctrl + E (or Ctrl + Y ) the proper number of times, but having a command that somehow does this directly would be nice. Any ideas? Kevin Vaughan z z - move current line to the middle of the screen (

Inserting text in TinyMCE Editor where the cursor is

不羁的心 提交于 2019-11-28 04:29:55
I've been trying to insert text into the TinyMCE Editor at the focused paragraph element ( <p> ) exactly where the cursor is but got no luck!! var elem = tinyMCE.activeEditor.dom.get('tinymce'); var child = elem.firstChild; while (child) { if (child.focused) { $(child).insertAtCaret("some text"); } child = child.nextSibling; } If anyone has any idea on how to solve this I'll be very thankful. Magus You should use the command mceInsertContent . See the TinyMCE documentation . tinymce.activeEditor.execCommand('mceInsertContent', false, "some text"); The above answer is good, but it is worth

Eclipse-plugin how to get current text editor cursor position

岁酱吖の 提交于 2019-11-28 01:26:52
I try to show popup dialog at text cursor position of an editor. How can I get text cursor position in pixels of the active editor (Point) and a show popup dialog at this point? I'm not exactly sure what do you mean under "show popup dialog at this point", but do something like this: IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if (editor instanceof ITextEditor) { ISelectionProvider selectionProvider = ((ITextEditor)editor).getSelectionProvider(); ISelection selection = selectionProvider.getSelection(); if (selection instanceof