Module albow.dialog.FileOpenDialog
Source code
import os
from albow.dialog.FileDialog import FileDialog
class FileOpenDialog(FileDialog):
saving = False
ok_label = "Open"
def get_pathname(self):
name = self.list_box.get_selected_name()
if name:
return os.path.join(self.directory, name)
else:
return None
pathname = property(get_pathname)
def ok_enable(self):
path = self.pathname
enabled = self.item_is_choosable(path)
return enabled
def item_is_choosable(self, path):
return bool(path) and self.filter(path)
def double_click_file(self, name):
self.ok()
Classes
class FileOpenDialog (prompt=None, suffixes=None, **kwds)-
The Dialog class provides a convenient container for implementing modal dialogs. Pressing Return or Enter dismisses the dialog with the value True, and pressing Escape dismisses it with the value False.
See the
albow.core.ui.Widgetdismiss()andpresent()methodsArgs
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 FileOpenDialog(FileDialog): saving = False ok_label = "Open" def get_pathname(self): name = self.list_box.get_selected_name() if name: return os.path.join(self.directory, name) else: return None pathname = property(get_pathname) def ok_enable(self): path = self.pathname enabled = self.item_is_choosable(path) return enabled def item_is_choosable(self, path): return bool(path) and self.filter(path) def double_click_file(self, name): self.ok()Ancestors
Subclasses
Class variables
var ok_labelvar saving
Instance variables
var pathname-
Source code
def get_pathname(self): name = self.list_box.get_selected_name() if name: return os.path.join(self.directory, name) else: return None
Methods
def double_click_file(self, name)-
Source code
def double_click_file(self, name): self.ok() def get_pathname(self)-
Source code
def get_pathname(self): name = self.list_box.get_selected_name() if name: return os.path.join(self.directory, name) else: return None def item_is_choosable(self, path)-
Source code
def item_is_choosable(self, path): return bool(path) and self.filter(path) def ok_enable(self)-
Source code
def ok_enable(self): path = self.pathname enabled = self.item_is_choosable(path) return enabled
Inherited members
FileDialog: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_stopup_button_textvisible