Advertisement
Guest User

ammonkey

a guest
Feb 18th, 2010
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. #Copyright (C) 2009 Matthew McGowan
  2. #
  3. # Authors:
  4. # Matthew McGowan
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18.  
  19.  
  20. import gtk
  21.  
  22. # my modules
  23. import pathbar
  24.  
  25.  
  26. class Concept:
  27.  
  28. def __init__(self):
  29. window = gtk.Window(type=gtk.WINDOW_TOPLEVEL)
  30. window.set_title("Path Bar Concept")
  31. window.set_default_size(600, -1)
  32. window.set_border_width(10)
  33. window.connect("destroy", gtk.main_quit, "WM destroy")
  34.  
  35. vbox = gtk.VBox(spacing=10)
  36. window.add(vbox)
  37.  
  38. pbar = pathbar.PathBar()
  39. pbar.append_part('Find Free Software')
  40.  
  41. hbox = gtk.HBox(spacing=4)
  42. extender = gtk.Button('Extend PathBar')
  43. entry = gtk.Entry()
  44. #shortener = gtk.Button('Shorten PathBar')
  45. hbox.pack_start(extender, False)
  46. hbox.pack_start(entry)
  47.  
  48. vbox.pack_start(pbar, False, False)
  49. vbox.pack_end(hbox, False, False)
  50.  
  51. extender.connect("clicked", self.extend_path, pbar, entry)
  52.  
  53. window.show_all()
  54. return
  55.  
  56. def extend_path(self, widget, pbar, entry):
  57. pbar.append_part(entry.get_text() or 'no label')
  58. return
  59.  
  60.  
  61. Concept()
  62. gtk.main()
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement