Home Download Buy Blog Forum Support

ST3: Detecting preview window in API

ST3: Detecting preview window in API

Postby glycerine on Sun Oct 13, 2013 7:19 pm

Hi,

How can I detect if a view is actually the "preview" view? In ST2 you could check if the view would be in the list of open files (the preview would not be in that list), but in ST3 I see the preview shows up as a regular open file.

I thought "window.transient_view_in_group(group)" would do the trick, but I'm not getting very far. Maybe I'm misunderstanding.
I'd much appreciate it if anyone could help me out with this or point me in the right direction.

Kind regards!
glycerine
 
Posts: 22
Joined: Thu Dec 15, 2011 11:16 pm

Re: ST3: Detecting preview window in API

Postby jbjornson on Fri Nov 08, 2013 12:40 pm

Bump.

I need this information in my plugin as well. Does anyone know how to check if a view is transient?
jbjornson
 
Posts: 336
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: ST3: Detecting preview window in API

Postby guillermooo on Fri Nov 08, 2013 12:49 pm

In st3 there's a concept of semi-transient views. I think they were introduced in the interest of user-friendliness. You're problably looking at one of those, although I don't know how they manifest themselves through the API...
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: ST3: Detecting preview window in API

Postby bizoo on Fri Nov 08, 2013 1:37 pm

I think you can either do:
Code: Select all
view == window.transient_view_in_group(window.active_group())

or
Code: Select all
view in window.views()

Not sure it always works.

However, a property or settings in the view object will be a nice addition.
bizoo
 
Posts: 859
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: ST3: Detecting preview window in API

Postby jbjornson on Fri Nov 08, 2013 3:54 pm

Thanks bizoo! Both commands seem to work in the context that I am using them but I decided to go with the "window.transient_view_in_group" option.
jbjornson
 
Posts: 336
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron