MCPcopy Create free account
hub / github.com/GStreamer/gst-python / create_ui

Method create_ui

old_examples/synchronizer.py:603–676  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

601 lambda *x: self.play_toggled())
602
603 def create_ui(self):
604 vbox = gtk.VBox()
605 vbox.show()
606 self.add(vbox)
607
608 self.videowidget = VideoWidget()
609 self.videowidget.show()
610 vbox.pack_start(self.videowidget)
611
612 hbox = gtk.HBox()
613 hbox.show()
614 vbox.pack_start(hbox, fill=False, expand=False)
615
616 self.adjustment = gtk.Adjustment(0.0, 0.00, 100.0, 0.1, 1.0, 1.0)
617 hscale = gtk.HScale(self.adjustment)
618 hscale.set_digits(2)
619 hscale.set_update_policy(gtk.UPDATE_CONTINUOUS)
620 hscale.connect('button-press-event', self.scale_button_press_cb)
621 hscale.connect('button-release-event', self.scale_button_release_cb)
622 hscale.connect('format-value', self.scale_format_value_cb)
623 hbox.pack_start(hscale)
624 hscale.show()
625 self.hscale = hscale
626
627 table = gtk.Table(3,3)
628 table.show()
629 vbox.pack_start(table, fill=False, expand=False, padding=6)
630
631 self.button = button = gtk.Button(stock=gtk.STOCK_MEDIA_PLAY)
632 button.set_property('can-default', True)
633 button.set_focus_on_click(False)
634 button.show()
635
636 # problem: play and paused are of different widths and cause the
637 # window to re-layout
638 # "solution": add more buttons to a vbox so that the horizontal
639 # width is enough
640 bvbox = gtk.VBox()
641 bvbox.add(button)
642 bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PLAY))
643 bvbox.add(gtk.Button(stock=gtk.STOCK_MEDIA_PAUSE))
644 sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
645 for kid in bvbox.get_children():
646 sizegroup.add_widget(kid)
647 bvbox.show()
648 table.attach(bvbox, 0, 1, 1, 3, gtk.FILL, gtk.FILL)
649
650 # can't set this property before the button has a window
651 button.set_property('has-default', True)
652 button.connect('clicked', lambda *args: self.play_toggled())
653
654 self.sync = sync = SyncPoints(self)
655 sync.show()
656 table.attach(sync, 1, 2, 0, 3, gtk.EXPAND, gtk.EXPAND|gtk.FILL, 12)
657 # nasty things to get sizes
658 l = gtk.Label('\n\n\n')
659 l.show()
660 table.attach(l, 0, 1, 0, 1, 0, 0, 0)

Callers 1

__init__Method · 0.95

Calls 7

play_toggledMethod · 0.95
do_choose_fileMethod · 0.95
do_remuxMethod · 0.95
SyncPointsClass · 0.85
addMethod · 0.80
set_propertyMethod · 0.80
VideoWidgetClass · 0.70

Tested by

no test coverage detected