Module albow.media.MusicOptionsDialog
Source code
from albow.layout.Column import Column
from albow.layout.Grid import Grid
from albow.dialog.Dialog import Dialog
from albow.widgets.Label import Label
from albow.widgets.Button import Button
from albow.media.EnableMusicControl import EnableMusicControl
from albow.media.MusicVolumeControl import MusicVolumeControl
class MusicOptionsDialog(Dialog):
"""
A simple dialog for controlling music-playing options. Incorporates an
`albow.media.EnableMusicControl` and an `albow.media.MusicVolumeControl`.
"""
def __init__(self):
#
# Python 3 update
#
super().__init__()
emc = EnableMusicControl()
mvc = MusicVolumeControl()
controls = Grid([
[Label("Enable Music"), emc],
[Label("Music Volume"), mvc],
])
buttons = Button("OK", self.ok)
contents = Column([controls, buttons], align='r', spacing=20)
contents.topleft = (20, 20)
self.add(contents)
self.shrink_wrap()
def ok(self):
self.dismiss(True)
Classes
class MusicOptionsDialog-
A simple dialog for controlling music-playing options. Incorporates an
albow.media.EnableMusicControland analbow.media.MusicVolumeControl.Args
client- The widget the dialog is on top of
responses- A list of responses
default- The index to the default response; Default is the first
cancel- The index to the cancel response; Default is None
**kwds:
Source code
class MusicOptionsDialog(Dialog): """ A simple dialog for controlling music-playing options. Incorporates an `albow.media.EnableMusicControl` and an `albow.media.MusicVolumeControl`. """ def __init__(self): # # Python 3 update # super().__init__() emc = EnableMusicControl() mvc = MusicVolumeControl() controls = Grid([ [Label("Enable Music"), emc], [Label("Music Volume"), mvc], ]) buttons = Button("OK", self.ok) contents = Column([controls, buttons], align='r', spacing=20) contents.topleft = (20, 20) self.add(contents) self.shrink_wrap() def ok(self): self.dismiss(True)Ancestors
Methods
def ok(self)-
Source code
def ok(self): self.dismiss(True)
Inherited members
Dialog:addadd_anchoradd_centeredanchorattention_lostaugment_mouse_eventbg_colorbg_imageborder_colorborder_widthcall_handlercall_parent_handlercancel_responseclick_outside_responsedefer_drawingdismissdrawdraw_overenter_responsefg_colorfocusfocus_switchfontget_cursorget_focusget_margin_rectget_rootget_top_widgetget_visibleglobal_to_localhas_focusinheritedinvalidateis_gl_containerkey_downkey_uplocal_to_globalmarginmenu_barparentparent_resizedpresentrectrelative_moderemoveremove_anchorresizedscale_bgsel_colorset_parentset_size_for_texttab_stopvisible