GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Source-Code-from-Tutorials/PythonGTK/Examples/08_headerBar.py at master · MEDBED/Source-Code-from-Tutorials

Expand file tree

/

08_headerBar.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
44 lines (33 loc) · 1.31 KB
/

08_headerBar.py

Copy path

File metadata and controls

44 lines (33 loc) · 1.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from gi.repository import Gtk, Gio
class HeaderBarWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="")
self.set_border_width(10)
self.set_default_size(500, 400)
header_bar = Gtk.HeaderBar()
header_bar.set_show_close_button(True)
header_bar.props.title = "Rippin Music Player"
self.set_titlebar(header_bar)
# Audio button on right
audio_button = Gtk.Button()
cd_icon = Gio.ThemedIcon(name="gnome-dev-cdrom-audio")
image = Gtk.Image.new_from_gicon(cd_icon, Gtk.IconSize.BUTTON)
audio_button.add(image)
header_bar.pack_end(audio_button)
# Create a box and link items together
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
Gtk.StyleContext.add_class(box.get_style_context(), "linked")
# Left arrow
left_arrow = Gtk.Button()
left_arrow.add(Gtk.Arrow(Gtk.ArrowType.LEFT, Gtk.ShadowType.NONE))
box.add(left_arrow)
# Right arrow
right_arrow = Gtk.Button()
right_arrow.add(Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE))
box.add(right_arrow)
header_bar.pack_start(box)
self.add(Gtk.TextView())
window = HeaderBarWindow()
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main()
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.