That means: either GTK or Xfce4 does not handle window maximization - correctly, or the GTK bindings for Haskell are buggy, or there is an - error in this program. If the window is (un)maximized manually, the size returned is always - the size of the unmaximized window. The first time, the window size - returned is the size prior to maximizing, and the last two times - it is the size after maximizing. mainGUI - On my Xfce4 desktop, the configure_event is called three times when a - top level window is maximized. printSize will then be called windowMaximize window widgetShowAll window - run the main GTK loop. Import Graphics.UI.Gtk import Control.Monad ( when ) import ( liftIO ) maximumWindowDimensions :: IO () maximumWindowDimensions = do - initialize the internal state of the GTK toolkit initGUI - create a window window <- windowNew - quit the application when the window is closed on window objectDestroy mainQuit - query the size of the window when its dimensions change on window configureEvent printSize - get the screen the window will be drawn upon screen <- windowGetScreen window - get the size of the screen x <- screenGetWidth screen y <- screenGetHeight screen - print the dimensions of the screen putStrLn ( "The screen is " ++ show x ++ " pixels wide and " ++ show y ++ " pixels tall for an undecorated fullscreen window." ) - maximize the window and show it. ![]() Requires BaCon version 4.0.1 or higher, using GTK3. SysGet, MonitorCount, MonitorCount SysGet, MonitorPrimary, MonitorPrimary MsgBox, Monitor Count : `t %MonitorCount% `n Primary Monitor : `t %MonitorPrimary% Loop, %MonitorCount% īecause Axe is currently () only available on the TI-83/84 black and white calculators, the screen dimensions are fixed at 96 by 64 pixels. This would typically be a full screen window (minus any areas occupied by desktop bars), unless the window manager has restrictions that prevents the creation of a full screen window, in which case the values represent the usable area of the desktop that occupies the maximum permissible window size (without scrolling). The values calculated should represent the usable desktop area of a window maximized to fit the the screen.įor multiple monitors, the values calculated should represent the size of the usable display area on the monitor which is related to the task (i.e.: the monitor which would display a window if such instructions were given).įor a tiling window manager, the values calculated should represent the maximum height and width of the display area of the maximum size a window can be created (without scrolling). The idea is to determine the physical display parameters for the maximum height and width of the usable display area in pixels (without scrolling). This is effectively the screen size (not the total desktop area, which could be bigger than the screen display area) in pixels minus any adjustments for window decorations and menubars. ![]() The task is to determine the maximum height and width of a window that can fit within the physical display area of the screen without scrolling. work before the window is fully initialized and when the window is minimized.ĪdjustWindowRectEx(&rect, window.GetStyle(), FALSE, window.You are encouraged to solve this task according to the task description, using any language you may know. required for a client rect with a width and height of 0. Return wndRect.Size() - clientRect.Size() borders are hidden, but the title bar is not. The total border size is found by subtracting the size of the client rect required for a client rect with a width and height of 0ĪdjustWindowRectEx(&rect, window.GetStyle(), FALSE, window.GetExStyle()) ĭepending on the application, it may be necessary to combine this approach with stukelly's if the current visible border size is necessary: CSize GetBorderSize(const CWnd& window) Determine the border size by asking windows to calculate the window rect Here is an example: CSize GetBorderSize(const CWnd& window) An alternate approach that will give you the border size in these conditions is to use the AdjustWindowRectEx function. ![]() The method suggested by stukelly will work unless the window is minimized or not fully initialzied.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |