469,310 Members | 2,542 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,310 developers. It's quick & easy.

Pygtk: How to remove title bar from a window

Hi all,

I am writing an application using pyGTK that has several pop-up dialogs
that show and hide in succession. I would like to prevent the user
from closing the dialog and if possible I'd like to use a "title
bar-less" window with a normal border so the X is not even available to
click. Is this possible? I have tried using
window.set_decorated(FALSE) but this also removes the border making the
window look quite strange.

Thanks,

Nick.

Jul 18 '05 #1
2 5899
Nick Atkins wrote:
Hi all,

I am writing an application using pyGTK that has several pop-up dialogs
that show and hide in succession. I would like to prevent the user
from closing the dialog and if possible I'd like to use a "title
bar-less" window with a normal border so the X is not even available to
click. Is this possible? I have tried using
window.set_decorated(FALSE) but this also removes the border making the
window look quite strange.


Draw your own border then. And don't rely on the user not beeing able to
close the window - xkill is at hand, and even if the average user doesn't
know about it - it _will_ be used.
--
Regards,

Diez B. Roggisch
Jul 18 '05 #2
Thanks for the reply Diez.

I'm not sure I can draw a border on its own with pyGTK but admittedly I
am not yet an expert. I have the following minimal test program which
opens a window and I cannot get it to draw a window with no title bar,
just a border:

#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk

if __name__ == "__main__":
# create a popup
w = gtk.Window()
w.set_size_request(100, 100)
w.set_decorated(False)
w.set_has_frame(False)
w.set_border_width(10)
w.show()
gtk.main()

I tried removing the set_decorated and set_has_frame lines and changing
them to True but I either get a complete title-bar window or nothing at
all.

Any ideas? Thanks.

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Samuele Giovanni Tonon | last post: by
reply views Thread by Michele Simionato | last post: by
reply views Thread by Johan | last post: by
6 posts views Thread by sapo | last post: by
2 posts views Thread by Tim N. van der Leeuw | last post: by
1 post views Thread by manatlan | last post: by
reply views Thread by Michael Palmer | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.