Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PyApp(gtk.Window):
- def __init__(self):
- # Added scaffolding to get it to actually run
- super(PyApp, self).__init__()
- self.set_title("Toolbar")
- self.set_size_request(250, 200)
- self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(6400, 6400, 6440))
- self.set_position(gtk.WIN_POS_CENTER)
- # Start of edited code
- vBox = gtk.VBox(False, 0)
- vBox.set_size_request(400,500)
- vBox.set_border_width(2)
- self.add(vBox)
- bar = gtk.Toolbar()
- bar.set_style(gtk.TOOLBAR_ICONS)
- closeButt = gtk.ToolButton(gtk.STOCK_CLOSE)
- # You can do your original non-stock button instead,
- # but must make it text instead of icons then.
- bar.insert(closeButt,0)
- vBox.pack_start(bar, False, False, 0)
- # End of edited code
- # More scaffolding to make it into a running program
- self.connect("destroy", gtk.main_quit)
- self.show_all()
- PyApp()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement