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

Method create_ui

old_examples/remuxer.py:611–684  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls 7

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

Tested by

no test coverage detected