Python gtk windows size




















Kris Harper Kris Harper 5, 8 8 gold badges 46 46 silver badges 88 88 bronze badges. It should work with gtk. Maybe you should post your code snippets for saving and restoring window size. In the code you linked, you use the quit function for the destroy signal. Add a comment. Active Oldest Votes. Window window. Improve this answer. Ah okay. I'll try this when I get home. I can't find it in the pygtk docs. As I understand it i. Try running: while gtk. This looks like it might work.

Asks to stick self , which means that it will appear on all user desktops. But normally the window will end up stuck. Asks to toggle off the fullscreen state for self. But normally the window will end up restored to its normal state.

Asks to unmaximize self. But normally the window will end up unmaximized. The ::activate-default signal is a keybinding signal which gets emitted when the user activates the default widget of window. The ::activate-focus signal is a keybinding signal which gets emitted when the user activates the currently focused widget of window. True if the key binding was handled. The ::enable-debugging signal is a keybinding signal which gets emitted when the user enables or disables interactive debugging.

When toggle is True , interactive debugging is toggled on or off, when it is False , the debugger will be pointed at the widget under the pointer. The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the :application property to None. The widget to which this window is attached.

The window gravity of the window. Gravity for more details about window gravity. Window :resize-grip-visible to find out if the resize grip is currently shown. Whether the input focus is within this Gtk. The :icon-name property specifies the name of the themed icon to use as the window icon.

If True , the window is modal other windows are not usable while this one is up. If True , users can resize the window. True if the window should not be in the pager. True if the window should not be in the task bar. The transient parent of the window. Gtk 3. ApplicationWindow , Gtk. Assistant , Gtk. Dialog , Gtk. OffscreenWindow , Gtk. Plug , Gtk. Bin 1 , Gtk.

Container 35 , Gtk. Widget , GObject. Object 37 , Gtk. Buildable 10 Structs: Gtk. ContainerClass 5 , Gtk. WidgetClass 12 , GObject. Container 10 , Gtk. Widget 82 , GObject. Object 7 , Gtk. Container 3 , Gtk. Application for the window attached-to Gtk. Container 4 , Gtk. Widget 69 , GObject. Object 1 Name Short Description activate-default The ::activate-default signal is a keybinding signal which gets emitted when the user activates the default widget of window.

Bin r. Bin Abstract: No Structure: Gtk. WindowClass A Gtk. Window as Gtk. Buildable The Gtk. Window — The object which received the signal The ::activate-default signal is a keybinding signal which gets emitted when the user activates the default widget of window.

Window — The object which received the signal The ::activate-focus signal is a keybinding signal which gets emitted when the user activates the currently focused widget of window. Window — The object which received the signal toggle bool — toggle the debugger Returns: True if the key binding was handled Return type: bool The ::enable-debugging signal is a keybinding signal which gets emitted when the user enables or disables interactive debugging.

Window — The object which received the signal The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. Window — The object which received the signal widget Gtk. Widget or None — the newly focused widget or None for no focus This signal is emitted whenever the currently focused widget in this window changes.

New in version 2. Buildable ObjectClass 5. Widget True if the window should receive the input focus. Application for the window. True if the window should receive the input focus when mapped.

Specifies whether the window should have a resize grip deprecated. Hint to help the desktop environment understand what kind of window this is and how to treat it. Decorated button layout deprecated. Object 1. Pixbuf ]. Widget ]. WindowType — type of window. Pixbuf — the icon. True if setting the icon succeeded. Pixbuf ] — a list of GdkPixbuf. True if a widget got activated.

EventKey — a Gdk. True if a mnemonic or accelerator was found and activated. AccelGroup — a Gtk. Widget — the widget that gets activated by the mnemonic.

Screen — a Gdk. Screen to draw to monitor int — which monitor to go fullscreen on. True if window should receive the input focus. Application , or None. Application or None. Widget or None. True if the window has been set to have decorations.

True if the window has been set to have a close button. True if the window will be destroyed with its transient parent. True if window should receive the input focus when mapped. WindowGroup for a window or the default group. True if the window has a resize grip. True if the window has requested to have its titlebar hidden when maximized.

Pixbuf or None. True if mnemonics are supposed to be visible in this window. True if the window is set to be modal and establishes a grab when shown.

True if the user can resize the window. Rectangle which we should store the resize grip area. The returned is owned by the widget and must not be modified or freed. But normally the window willend up unmaximized. Asks to place window in the fullscreen state. But normally the window will end up fullscreen. Note that you shouldn't assumethe window is definitely full screen afterward. You can track the fullscreen state via the "window-state-event" signalon Gtk. Asks to toggle off the fullscreen state for window.

But normally the window will end up restored to its normalstate. Asks to keep window above, so that it stays on top. Butnormally the window will end kept above. Note that, according to theExtended Window Manager Hints Specification,the above state is mainly meant for user preferences and should notbe used by applications e. Asks to keep window below, so that it stays in bottom. Butnormally the window will be kept below.

Starts resizing a window. This function is used if an applicationhas window resizing controls. When GDK can support it, the resizewill be done using the standard mechanism for thewindow manager or windowingsystem.

Otherwise, GDK will try to emulate window resizing,potentially not all that well, depending on the windowing system. Starts moving a window. This function is used if an application haswindow movement grips. When GDK can support it, the window movementwill be done using the standard mechanism for thewindow manager or windowingsystem.

Otherwise, GDK will try to emulate window movement,potentially not all that well, depending on the windowing system. By default, windows are decorated with a title bar, resizecontrols, etc. By default, windows have a close button in the window frame. By setting the type hint for the window, you allow the windowmanager to decorate and handle the window in a way which issuitable to the function of the window in your application. This function should be called before the window becomes visible.

Windows may set a hint asking the desktop environment not to displaythe window in the task bar. This function sets this hint. Windows may set a hint asking the desktop environment not to displaythe window in the pager. A "pager" is any desktop navigation tool such as a workspaceswitcher that displays a thumbnail representation of the windowson the screen. Windows may set a hint asking the desktop environment to drawthe users attention to the window.

Windows may set a hint asking the desktop environment not to receivethe input focus. Windows may set a hint asking the desktop environment not to receivethe input focus when the window is mapped.

This function sets thishint. Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on theunderlying GdkWindow. Normally, startup identifier is managed automatically and you should only use this function in special caseslike transferring focus from other processes.

You should use thisfunction before calling Gtk. Window:present or any equivalentfunction generating a window map event. In combination with the window title, the window role allows awindow manager to identify "thesame" window when an application is restarted.

Returns whether the window has been set to have decorationssuch as a title bar via Gtk. Returns whether the window has been set to have a close buttonvia Gtk. Gets the value set by Gtk. Returns the fallback icon name for windows that has been setwith Gtk. Itis only valid until the next call to Gtk. Gets the default size of the window. Returns whether the window will be destroyed with its transient parent. Returns whether the window has requested to have its titlebar hiddenwhen maximized.

Retrieves the list of icons set by Gtk. Returns the mnemonic modifier for this window. This function returns the position you need to pass to Gtk. Window:move to keep window in its current position. This means that the meaning of the returned value varies withwindow gravity. Window:move for more details.

This means that Gtk. Window:move sets the position of thissame top-left corner. Moreover, nearly all window managers are historically broken withrespect to their handling of window gravity.

So moving a window toits current position as returned by Gtk. Window managers areslowly getting better over time. Obtains the current size of window. The size obtained by Gtk. As a result, if youcall Gtk. Window:resize then immediately call Gtk. Note 1: Nearly any use of this function creates a race condition,because the size of the window may change between the time that youget the size and the time that you perform some action assumingthat size is the current size.

Note 2: The returned size does not include thesize of the window manager decorations aka the window frame orborder. Note 3: If you are getting a window size in order to positionthe window onscreen, there may be a better way. Also, if you set the transient parent ofdialogs with Gtk. It'smuch preferred to let the window manager handle thesethings rather than doing it yourself, because all apps willbehave consistently and according to user prefs if the windowmanager handles it.

Returns: the widget where the window is attached,or None if the window is not attached to any widget. Returns the group for window or the default group, if window is None or if window does not have an explicitwindow group.

Asks the window manager to move window to the given position. Window managers are free to ignorethis; most window managers ignore requests for initial windowpositions instead using a user-defined placement algorithm andhonor requests after the window has already been shown. Note: the position is the position of the gravity-determinedreference point for the window. The gravity determines two things:first, the location of the reference point in root windowcoordinates; and second, which point on the window is positioned atthe reference point.

Thetop-left corner of the window decorations aka window frame orborder will be placed at x , y. So, to place a window in the bottom right corneryou would first set gravity to south east, then write: Gtk. In the following example, we are going to use geometry method to set a fixed window size of x to the Tk window.

January 13, January 13, amine. January 12, January 12, amine.



0コメント

  • 1000 / 1000