I'm building a GUI using Tk/Tcl. during the use I create a new window which has some properties in it for the user to fill up. I want that my main window will be unusable during all time that the properties window is not closed, and only when it's closed to bring back the option to use the main window.
How do I do it?
I create the new window using toplevel .prop_menu
use grab. See also http://wiki.tcl.tk/grab and http://wiki.tcl.tk/3326
Related
In MATE desktop in Fedora 28, I have set a shortcut for switching windows using a popup window to Super-j. I've discovered AutoKey that allows you to re-map the keys for certain applications/windows. It has a script that tells you what the window class is. But with the popup window, the widnow disappears too fast and the script can't quite grab it as you need to click on the window. Is there a way to get the window class of this popup window? I want to re-bind left key to Super-h while the popup is active. Or is there another way to achieve this?
I see that you've already found another solution, but I thought I'd add an AutoKey solution, too:
import time
mouse.wait_for_click(1)
time.sleep(0.2)
winClass = window.get_active_class()
dialog.info_dialog("Window class", "Active window class:\n\n'%s'" % winClass)
I'm trying to create dialogs that 'lock' the parent window, but without touching the gtk_window_set_transient_for function.
I notice that Glade allows me to set Transient For and Attach To values, but if I connect those with my parent window (defined in the same glade file) and run the program, it is not transient.
Do I need to do anything else? Does this way even work?
So it does work. I didn't fully realize however that the a locking dialog also needs to be set to be modal.
So to solve my issue I had to also tick the Modal property.
Furthermore, it's also important that both the dialog and the window are loaded from the same builder instance.
When I create SHBrowseForFolderW dialog the default control is OK, what I need to do is make SysTreeView32 active so a user can right on use arrow keys to adjust the desired folder. I tried to use this code : http://comp.newsgroups.archived.at/os.ms-windows.programmer.win32/200505/05053122835.html which wokrs ok in finding the HWND of the dialog but using WM_NEXTDLGCTL has no effect on the window.
Maybe I should send TAB keystrokes to the window, or I don't know any other opions ? Are there swiches in creating the browse dialog what control will be highlighted when the window create ?
Ok, the thing is difference between PostMessage and SendMessage. I mistakenly used the later here. They are not the same!
I have situation like below.
I'm running some command and then I get a popup with Y/N answer. Is there a possibility to force answer Yes and automatically close the window through command line?
If you want to click a button in an external window, you'll need to hook the window with the button exposed. You can accomplish this by grabbing the window handle via FindWindow, finding the child button, and sending a BM_CLICK with an API call via SendMessage.
you mean a command window within VS ? I don't think there's anything generic, you could run all sorts of things, depends on what your command is - and how much control over it you have - maybe some example of what you're trying to do could help. 'picking' the window will work but depends again on what you're doing, how custom it is etc.
I am trying to make our application properly handle international input. Since we handle text input and font rendering ourselves, I wrote custom code to handle the respective WM_IME_* messages.
Now, this all works fine, with one exception: When our applications main window is open, the Language Bar will not let me pick any options. I can set the input language to Japanese or Korean, but the menus for choosing the input methods (like Hangul or Hiragana) are not shown. Then, when I open another window (any other window, be it one of our application windows, or a standard "save file" dialog), the options appear. Once there, they will stay, even if I close the other window. IME input will then work as expected in the main window. But, as explained, only if I open another window first.
Now, how does windows decide whether it should display the input method options or not? It appears that windows does not recognize our main window as Unicode capable for some reason. How can I fix that?
Thanks in advance for any suggestions,
jonas
Edit: One more strange thing i noticed is that for my main window (which will not let me change input methods), I will get a WM_INPUTLANGUAGECHANGEREQUEST message when i change the input language - which I pass on to DefaultWindowProcW. For the windows which let me change the input method, i don't get the request, i just get a WM_INPUTLANGUAGECHANGE message (which I don't get for the other window).
Ok, after a long search I've been able to find out what is breaking this. We are calling SetFocus on a child window in response to WM_FOCUS messages, so that a specific child window always gets focused when a window is brought to the front. Apparently, this confuses window's IME code, and makes it unaware that the window can handle IME input.
Some notes
Text Service is works per window, not system wide, so even its turn on in one window, another window will still need to turn it on, (unless user set it as default)
And Text Service is not working in any windows, to enable that, target computer need to enable following setting on