I have such a question, can I remove 'HeaderBar'? I want to use WebKit and make my own controllers.
Perhaps it can be done like that via CssProvider?
Screen
Solution - window.set_decorated(false);
What you are trying to 'remove' its not the 'HeaderBar', its the window decoration. Gtk.HeaderBar its a different thing. Window decoration is dependable of the window manager as stated in the documentation:
By default, windows are decorated with a title bar, resize controls,
etc.
Some window managers allow GTK+ to disable these decorations, creating
a borderless window. If you set the decorated property to false using
this function, GTK+ will do its best to convince the window manager
not to decorate the window. Depending on the system, this function may
not have any effect when called on a window that is already visible,
so you should call it before calling show.
On Windows, this function always works, since there’s no window
manager policy involved.
Although you got the right method to disable the window decoration (Gtk.Window set_decorated(bool)) these clarifications are needed.
Related
I am writing a simple application in python using PyGObject and glade. The application has a main window and a functional window (Generate logs, also a Window object) which opens up on clicking a menu item.
The Generate logs window is supposed to:
Show options to generate log for a particular date
Be minimizable and should close automatically when the task is complete (OR)
Be able to be closed manually if the user wishes so
The problem is, once I show up the Generate logs window, I am directly able to select the main window as well. Then, I can go to the menu and bring up as many Generate logs windows as I want.
I have tried several options (Is Focus, setting up main window as Transient parent etc) but nothing worked. How can I fix this?
First you say PyGTK, then you say PyGObject, this are 2 different things. I'm going to answer for PyGTK (my sources are from GTK+ 2 docs) since it's in the title and maybe people looking for that will end up here. But never fear, because for this question, the answer is practically (I think exactly) the same for both.
What I understand is that you want you "Generate log" window to be modal. That means other windows can't be used while your modal window is up, just like a Dialog window. Also you should set the main window to be the parent of your modal window, since this helps the OS Window Manager i.e. keep the dialog on top of the main window.
Yo can do both of this things directly from Glade (if you've created both windows in the same project, not always the case) selecting the Modal atribute to True and the Transient for Window attribute to your main window, in the General Properties section of your Generate log window.
Also you can do it programmatically using the set_modal() and the set_transient_for(parent_window) method of your child window.
Let's say your parent window is called main_window and the child window is generate_log_window, then you can do it like this:
generate_log_window.set_modal(gtk.TRUE)
generate_log_window.set_transient_for(main_window)
If you want it to show center top of your main window, do this
generate_log_window.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
To your second point, the ability to minimize can be set from Glade.
Sources:
GTK+ 2 GtkWindow reference set_modal
GTK+ 2 GtkWindow reference set_transient_for
PyGTK FAQ: How do I get my windows to show up where I want
PyGTK FAQ: How do I make a dialog block the whole application, so the user is forced to answer it?
create several windows (see your other post).
Upload them in init
Show them with "signals" in glade using "show" and "hide"
class GUIxxxx
#...
def action1(self, widget, data=None):
self.window1.show()
def action2(self, widget, data=None):
# do something here
self.window1.hide()
For example Version Control tool window. I never use it. I use version control support, but not this tool window itself. How can I remove it from tool window bar?
I've found a plugin to hide certain tool windows
https://plugins.jetbrains.com/plugin/?id=1489
If you don't need to actually hide the button, but just don't want it in the way while looking for the buttons you do use regularly, you can always drag it to some side of the screen that you don't often use. (I rarely use the bottom-right, so I could move some things there.) That way, you don't see them when picking a tab, but you can still get to it if you need to. (And every once in a while, I suspect you may really want to look at that Version Control view.)
I have a document based application. Every document can have multiple windows. Every window is automatically added to the "Window" menu. However, they are added in a more or less random and useless order. I would like the window titles to be organized according to the NSDocument they belong to, similar to how XCode or Photoshop do it.
How can I best do that? How can I prevent the default behaviour of AppKit to add all windows to this special menu, and where should I put the code that adds the menu items in the "correct" manner? I don't want to put handlers into every window controller!
It sure does seem like this is something Cocoa should do automatically. I don't know whether it does, but the first thing to check is whether the window controllers are properly connected to their documents. Does your document subclass's windowControllers property contain all the right objects?
If that's no good, then from NSWindow's reference it looks like the only way to prevent a window whose title has been set from being added to the Windows menu is -[NSWindow setExcludedFromWindowsMenu:]. It looks like you'll want to call that on all your windows, then set up an object (perhaps in the MainMenu nib) that takes care of all the windows' positions and grouping in the Windows menu (via NSApplication's methods). You may need to put in special disabled items and the like to get the grouping to look right. I would hope that windows could still be manually added even if you've previously asked them to be excluded.
how to make the windows app in vs 2008 unresizable?because when you launch the application and point and drag to its corners, the window grows.
Change the FormBorderStyle to a fixed one, depends what look you want. Here's a full list of options, you probably want Fixed3D or FixedSingle
You also probably want to set MaximizeBox to false.
Both of these can be found in the designer as options on the form, or set in code, whichever you prefer.
Take a look on the properties of the window control in the properties window. You'll probably figure out how to do this + how to control few more staff about the window..
Change the ResizeMode property of the window.
Is there a way to determine whether the active window (not of my process, but a different application) is resizable?
Edit: I would prefer to do this without applescript as it then depends on the application being scriptable.
Use Accessibility. Once you find the window you want to examine, test whether it has the kAXGrowAreaAttribute attribute (the value for which would be the grow area itself, a.k.a. the “size box” or [the Windows term] “resize handle”). A window that has one is resizable; a window that doesn't have one is not resizable.
The user will need to have access for assistive devices turned on, but making that happen is easier than scripting unscriptable applications.
Edit from the year 2011: Lion killed off size boxes, so now you'll need to test whether the window's size attribute can be changed.
Yes, you can check if the "frontmost window" of the target application is resizable! You can perform the scripting request via applescript, scripting bridge or a third party framework!
However, in any case, it's needed that the target application is scriptable and you can access to the "resizable" property (of the "frontmost window" object) via a scripting request!
Depends on how you're getting access to the window. There's a property in AppleScript on Window objects, resizable, that indicates this.