1

Does anyone know how to open new with specific size? brackets object does not contain any function to do that - there's only 2 brackets.app and brackets.fs object. Also if you try to open new window with

window.open("http://stackoverflow.com","some title","width=500,height=500");

it won't set the window size.

Any ideas/suggestions?

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
Tiit Remmel
  • 230
  • 1
  • 5
  • 16
  • What is the programming language? – ST3 Oct 01 '13 at 11:24
  • i use the JavaScript. I took [this](http://clintberry.com/2013/native-desktop-javascript/) site as a sample. seems that i need to create some function in C++/Objectiv-C to have window creating option – Tiit Remmel Oct 01 '13 at 11:36

3 Answers3

0

That is how you open a new window, and set the size. I would assume you are coming across something else in your code, that is causing an error that you are not seeing.

Try binding it to a event call, like during a click event. Posting the code this applies to will help.

Casey ScriptFu Pharr
  • 1,672
  • 1
  • 16
  • 36
0

It looks like a bug in brackets-shell that the size you specify is getting ignored. (It could also be bug in CEF, the underlying Chromium wrapper that brackets-shell uses, but this implies it normally works in vanilla CEF – I'm guessing it's broken by the brackets-shell code that remembers your last window size across launches).

However, it's not a good idea to open an arbitrary website inside the Brackets shell itself. For one thing, you won't get back/forward buttons, or an address bar, or any of the other standard browser functionality. If you want to open an external website, use NativeApp.openURLInDefaultBrowser() instead (though just like clicking a link in any other app, you won't get to pick the window size). Or if you're building some UI that's more like a Brackets feature (not a remote URL), then it'd be much easier to use in-window popups instead – see the Dialogs API.

peterflynn
  • 4,667
  • 2
  • 27
  • 40
0

I'm guessing it's broken by the brackets-shell code that remembers your last window size across launches

Can anyone point to this code so I can take a look at it? Just get me close...

ed4becky
  • 1,488
  • 1
  • 17
  • 54