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.EnableMusicControl
and 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
:add
add_anchor
add_centered
anchor
attention_lost
augment_mouse_event
bg_color
bg_image
border_color
border_width
call_handler
call_parent_handler
cancel_response
click_outside_response
defer_drawing
dismiss
draw
draw_over
enter_response
fg_color
focus
focus_switch
font
get_cursor
get_focus
get_margin_rect
get_root
get_top_widget
get_visible
global_to_local
has_focus
inherited
invalidate
is_gl_container
key_down
key_up
local_to_global
margin
menu_bar
parent
parent_resized
present
rect
relative_mode
remove
remove_anchor
resized
scale_bg
sel_color
set_parent
set_size_for_text
tab_stop
visible