I have this code to add table inside VBox which is not working
topwid=gtk.VBox(gtk.FALSE, 0)
table = gtk.Table(3, 3, True)
topwid.pack_start(table)
how to do this?
Source code(GUI part):
def build_gui(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.gotoTray)
self.window.connect("destroy", self.destroy)
self.window.set_border_width(24)
self.window.set_size_request(400, 200)
self.window.set_title("xyz client")
self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.window.set_resizable(False)
topwid=gtk.VBox(gtk.FALSE, 0)
table = gtk.Table(3, 3, True)
topwid.pack_start(table)
label = gtk.Label("Username")
table.attach(label,0,1,0,1)
label.show()
self.username=gtk.Entry(max=10)
table.attach(self.username,1,3,0,1)
self.username.show()
label1 = gtk.Label("Password")
table.attach(label1,0,1,1,2)
label1.show()
self.password=gtk.Entry(max=10)
table.attach(self.password,1,3,1,2)
self.password.set_visibility(False)
self.password.show()
self.button=gtk.Button("Login")
self.button.connect("clicked",self.click_button)
table.attach(self.button,1,3,2,3)
self.button.show()
#
table.show()
mb = gtk.MenuBar()
filemenu = gtk.Menu()
filem = gtk.MenuItem("File")
filem.set_submenu(filemenu)
exit = gtk.MenuItem("Exit")
exit.connect("activate", gtk.main_quit)
filemenu.append(exit)
mb.append(filem)
vbox = gtk.VBox(False, 2)
vbox.pack_start(mb, False, False, 0)
topwid.pack_start(vbox)
topwid.show()
self.statusicon = gtk.status_icon_new_from_stock(gtk.STOCK_NETWORK)
self.statusicon.connect('activate', self.status_clicked )
self.statusicon.set_name("Cyberoam")
self.window.show_all()
gtk.main()