Home Download Buy Blog Forum Support

How to focus window?

How to focus window?

Postby Sam Peng on Mon Apr 02, 2012 4:36 am

if I have three windows
I edit window in one.
I want focus windows for twice

i try to use window.focusView api.but window can't focus.this window in underside of now editing window.how to do it?
Sam Peng
 
Posts: 6
Joined: Tue Mar 27, 2012 3:28 pm

Re: How to focus window?

Postby freewizard on Wed Sep 19, 2012 4:37 am

Encounter same question here, possible to have a sublime.focus_window(window) API?
using Sublime Text 3 dev in OS X 10.8
my ST packages: https://github.com/freewizard
freewizard
 
Posts: 36
Joined: Wed Feb 09, 2011 4:14 am

Re: How to focus window?

Postby sapphirehamster on Fri Sep 21, 2012 8:00 pm

It's a little difficult to understand exactly what you're asking. It might help to include which platform you are on. It may be a bug, because the following works for me on Windows, but not on OS X (10.7). I have two windows open, one on top of the other. When trying to set focus on the window underneath, on OS X the window does not raise to the foreground.

Code: Select all
some_view = other_window.views()[0]
other_window.focus_view(some_view)
sapphirehamster
 
Posts: 83
Joined: Sun Jul 01, 2012 11:19 pm

Re: How to focus window?

Postby freewizard on Mon Sep 24, 2012 2:42 am

Yes, windows version is much easier, also since in windows you have hwnd() for a window, it's much easier to manipulate it with Win32 APIs. However, in general, I believe activate a window as an API is much clearer than infer it by activate a view.

I've added a feature request
http://sublimetext.userecho.com/topic/1 ... dowwindow/
using Sublime Text 3 dev in OS X 10.8
my ST packages: https://github.com/freewizard
freewizard
 
Posts: 36
Joined: Wed Feb 09, 2011 4:14 am


Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests