myromance123
October 22nd, 2012, 02:41 PM
Hi there.
I have been trying to set Gtk+ 3 to stop the user from resizing the window.
Initially I thought I had to use gtk_window_set_has_resize_grip(False) but that didn't do anything. The window is still resizable.
#!/usr/env/python
from gi.repository import Gtk
class BasicWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="No Resize")
self.set_has_resize_grip(False)
table = Gtk.Table(3, 1, True)
self.add(table)
label_info = Gtk.Label("This window cannot be resized")
table.attach(label_info, 0, 1, 1, 2)
win = BasicWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
I've been scouring the Gtk+ 3 documentation, but I can't seem to find out how to do this. I am using Python with Gtk+ 3 on Ubuntu 12.10 with IDLE 2.7. Is this possible? Am I doing something wrong?
Any help would greatly be appreciated!
I have been trying to set Gtk+ 3 to stop the user from resizing the window.
Initially I thought I had to use gtk_window_set_has_resize_grip(False) but that didn't do anything. The window is still resizable.
#!/usr/env/python
from gi.repository import Gtk
class BasicWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="No Resize")
self.set_has_resize_grip(False)
table = Gtk.Table(3, 1, True)
self.add(table)
label_info = Gtk.Label("This window cannot be resized")
table.attach(label_info, 0, 1, 1, 2)
win = BasicWindow()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
I've been scouring the Gtk+ 3 documentation, but I can't seem to find out how to do this. I am using Python with Gtk+ 3 on Ubuntu 12.10 with IDLE 2.7. Is this possible? Am I doing something wrong?
Any help would greatly be appreciated!