Pygtk: How to remove title bar from a window

N

Nick Atkins

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.
 
D

Diez B. Roggisch

Nick said:
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.
 
N

Nick Atkins

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top