focus

Make a tkinter window appear over all other windows

白昼怎懂夜的黑 提交于 2019-12-30 05:23:36
问题 #!/usr/bin/env python # Display window with toDisplayText and timeOut of the window. from Tkinter import * def showNotification(notificationTimeout, textToDisplay): ## Create main window root = Tk() Button(root, text=textToDisplay, activebackground="white", bg="white", command=lambda: root.destroy()).pack(side=LEFT) root.update_idletasks() # Remove window decorations root.overrideredirect(1) timeOut = int(notificationTimeout*1000) # Convert to ms from s ## Run appliction root.after(timeOut

How to prevent hidden element to be shown when focused in Chrome?

你。 提交于 2019-12-30 04:46:06
问题 I have a strange problem today, in Chrome, when I focus on an element that is absolutely positioned out of its overflow hidden container, it gets visible in Chrome browser (Mac). I've made a fiddle to illustrate the problem : http://jsfiddle.net/GHgtc/ Html <div id="container"> <a id="inner-button" href="#">You can see me !</a> </div> Css #container{ display: block; background: blue; width: 200px; height: 30px; position: relative; overflow: hidden; } #inner-button{ display: block; background:

Can't manage to requestFocus a Spinner

早过忘川 提交于 2019-12-30 03:07:25
问题 I've got an annoying issue with a screen. The screen consists of a bunch of Spinners one under the other, and then underneath the spinner, an EditText. The problem is that when the screen starts, the EditText has focus, meaning that some Spinners are off the top of the screen. Try as I might, I cannot make the top Spinner start focused, either by using <requestFocus/> in the screen XML, or by using requestFocus() in code. I've attempted to do what requestFocus skipping next EditText suggests,

How to detect when an image is out of focus?

拜拜、爱过 提交于 2019-12-30 02:17:18
问题 At times our optical inspection system gets out of focus which results in nonsensical measurements. I've been tasked to develop an 'out of focus' detector which will be used to drive the Z axis of the camera system. The images available to me are bmp. I'm looking for approaches and algorithms to investigate. For instance, should I be isolating features and measuring conformance or could edge detection be used? This is the in focus image: And this is the out of focus image: 回答1: The key is

How do you set the focus of a TinyMCE textarea element?

无人久伴 提交于 2019-12-30 01:39:06
问题 I'm using TinyMCE for a textarea on a page but it doesn't play nice in the tabbing order of the other elements. I can use the following code to capture when I tab out of the first element: $('#title').live('keypress', function (e) { if(e.keyCode == 9) { alert('tabbed out'); } }); How can I set the focus to a TinyMCE editor? 回答1: Finally found an answer... use the command: tinymce.execCommand('mceFocus',false,'id_of_textarea'); For my purposes, 'id_of_texterea' was "description", ie <textarea

how react programmatically focus input

百般思念 提交于 2019-12-30 01:36:13
问题 I'm trying to implement a very simple use case, a UI feature, where: There is a label with some content in it If clicked, a text input replaces it with the content of label available User can edit the content When enter is pressed, the input hides and label is back with updated content I could get finally all correct (in fact with a MongoBD backend, redux, etc.), and the only thing I couldn't ever do (paying a complete day in googling and reading S.O.F similar posts) was this: When my text

How can I enforce a single instance of my application?

蹲街弑〆低调 提交于 2019-12-29 07:55:33
问题 How can I ensure a single instance of my application and to set the focus to it when attempting to open a second instance? I tried: public partial class Form1 : Form { [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(String lpClassName, String lpWindowName); [DllImport("USER32.DLL")] public static extern Boolean SetForegroundWindow(IntPtr hWnd); private void Form1_Load(object sender, EventArgs e) { bool isRunning = Process.GetProcesses() .Where(p =>

Hide input caret of TextField in JavaFX8

陌路散爱 提交于 2019-12-28 06:59:14
问题 I would like to hide the input caret of a TextField in JavaFX8. I already tried to set the text fill to white (my TextField has a white background), but then my user input also disappears. The problem is that the textfield still needs focus, so I also thought of some EventHandler which listens to user input, and focusses on the textfield when a key is pressed, but then I would miss the first key typed. Anyone that knows how to do this? Or is it not possible in JavaFX8? 回答1: Update for Java

css focus not working in safari and chrome

北城余情 提交于 2019-12-28 05:46:06
问题 I got one strange problem which I never got before. Please see this code: The css: #btn{ margin-left:150px; padding:10px; display:block; } #btn a{ padding:5px 20px; background:green; color:#FFF; text-decoration:none; outline:none; } #btn a:hover{ background:#933; } #btn a:focus, #btn a:active{ background:#CF0; color:#000; } Here the HTML <div id="btn"> <a href="#">Click here</a> </div> The focus and active css working well in firefox, but not in the chrome and safari. 回答1: Yeah seems like

I have to click the button twice for it to work

孤街浪徒 提交于 2019-12-28 05:32:25
问题 So I have a button in my app and an edittext. When I click the button and write something in the edittext, a textview changes. It all works as it should except for one thing. I have to click on the button twice to make it work (only the first time I open activity). The very first time after I open activity I press the button and nothing happens, after that it works as it should. I already did my research on this and as far as I know the thing that is causing trouble is focus, but I tried a