Pygtk: How to remove title bar from a window

Discussion in 'Python' started by Nick Atkins, Jan 13, 2005.

  1. Nick Atkins

    Nick Atkins Guest

    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.
    Nick Atkins, Jan 13, 2005
    #1
    1. Advertising

  2. 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
    Diez B. Roggisch, Jan 13, 2005
    #2
    1. Advertising

  3. Nick Atkins

    Nick Atkins Guest

    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.
    Nick Atkins, Jan 14, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George
    Replies:
    4
    Views:
    475
    George
    Feb 13, 2004
  2. Matt
    Replies:
    0
    Views:
    3,520
  3. John Hann
    Replies:
    0
    Views:
    6,029
    John Hann
    Aug 21, 2004
  4. Matt
    Replies:
    9
    Views:
    70,745
  5. Matt
    Replies:
    9
    Views:
    512
    kaeli
    Aug 23, 2004
Loading...

Share This Page