I'm trying to create a resize limit for my NSWindow. I don't want the window to scale smaller than 732x or 496y pixels. What would be the best way to go about doing this?
In Xcode click the .xib file and then select your window. In the utilities tray click the size inspector and check the box next to Minimum Size Constraints and set the size
In code you would do it like this:
window.contentMinSize = NSMakeSize(320.0, 568.0);
Related
When I maximize my window, I want to restrict a vertical layout (and the entire row below it also) so that it has a specific size (lets say a width of 200). How can I achieve this? Below is what I get now. The buttons are stretched too far. I want them to keep a width of 200.
To stop the buttons stretching, use the following steps in Qt Designer:
click on scrollArea in the Object Inspector
click on Break Layout on the toolbar
click on scrollArea in the Object Inspector
click on Lay Out in a Grid on the toolbar
click on scrollAreaWidgetContents in the Object Inspector
scroll down to the bottom of the Property Editor
change layoutColumnStretch to 0,1
These steps should remove an empty column from the scroll-area grid-layout, and make the second column stretch to take up the available space when the window is resized.
You just need to restrict the maximum width of all widgets (in this case the buttons) within the layouts of this grid column to the expected size, else they'll just keep expanding. You may also have to fiddle the horizontal size policy; I seem to remember that buttons were a bit tricky in this regard (or was that the height?), but can't test it right now.
The layout size contraint you tried only applies to the layout's direct parent widget, if it has one, which isn't the case for the vertical layouts here.
is there a way to resize the current window to maximal size in Awesome wm? Something like maximizing, but without locking the maximum-ness. Currently, when I want to maximize a floating window I cycle through the layouts, the non-floating layouts resize the window to the desired size and then I return back to the floating layout.
How to do it better?
Thanks!
You could add a clientkey with a function like function(c) c:geometry(c.screen.geometry) end.
In Awesome 4.0+ (currently the Git master version), there is:
awful.placement.maximize
I have problem with layout. I put image for QPushButton background but when I add my button to each layout, it avoid to show full image.
Use size Policy and minimum Height-width. for example you want to expand the button. first select the button and after that choose size Policy to change the size. select Expanding for each property(vertical|horizontal Policy) you want to change. Also you can set the vertical|horizontal stretch. if you want to set limit for it's size you can set minimum and maximum size for your button.
Just look at your object properties, Also look at here. :)
When working with TideSDK windows, you get to control their position within the screen. However, I can't find any way to retrieve the screen's size nor a way to center the window.
Is there a way to accomplish that?
You can access the user's screen size with window.screen.width and window.screen.height. You can use those to center a window:
var app_window = Ti.UI.currentWindow;
app_window.setX((window.screen.width-app_window.getWidth())/2);
app_window.setY((window.screen.height-app_window.getHeight())/2);
Note that the window object here is not an instance of Ti.UI.UserWindow but the usual browser window object.
Would it be possible to show an image in full screen mode using silverlight. I'm looking out for some thing like the full screen option of the flash video players.
You can set
Application.Current.Host.Content.IsFullScreen = true;
this has to be done from a mouse button event or a click, you can't force the user into full screen without some interaction on their part.
Then you'll need to scale the image. If it's in an element that scales automatically, like a Grid cell and the Grid resizes automatically (like if it's the root element on the page and the page doesn't have a width or height specified) then you're good, but otherwise you'll need to handle the Application.Current.Host.Content.FullScreenChanged event and either resize or apply a scale transform to the image or its container to make it fill the screen, and do the same when you go back to non full screen mode.
Set System.Windows.Interop.BrowserHost.IsFullScreen = true.