Audio-Nama
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Audio/Nama/Graphical.pm view on Meta::CPAN
# ------------ Graphical User Interface ------------
package Audio::Nama::Graphical; ## gui routines
use Modern::Perl '2020'; use Carp;
our $VERSION = 1.071;
use Audio::Nama::Globals qw($term $prompt);
use Module::Load::Conditional qw(can_load);
use Audio::Nama::Assign qw(:all);
use Audio::Nama::Util qw(colonize);
no warnings 'uninitialized';
our @ISA = 'Audio::Nama'; ## default to root namespace, e.g. Refresh_subs, Graphical_subs
# actually this doesn't seem like a
# good idea
# widgets
## The following methods belong to the Graphical interface class
sub hello {"make a window";}
sub loop {
$term->Attribs->{already_prompted} = 0;
$term->tkRunning(1);
while (1) {
my ($user_input) = $term->readline($prompt) ;
Audio::Nama::process_line( $user_input );
}
}
sub initialize_tk {
my $result1 = can_load( modules => { Tk => undef } ) ;
my $result2 = can_load( modules => { 'Tk::PNG' => undef } );
$result1
}
# the following graphical methods are placed in the root namespace
# allowing access to root namespace variables
# with a package path
package Audio::Nama;
# gui handling
# in the $gui variable, keys with leading _underscore
# indicate variables
#
# $gui->{_project_name} # scalar/array/hash var
# $gui->{mw} # Tk objects (widgets, frames, etc.)
sub init_gui {
logsub((caller(0))[3]);
init_palettefields(); # keys only
### Tk root window
# Tk main window
$gui->{mw} = MainWindow->new;
get_saved_colors();
$gui->{mw}->optionAdd('*font', 'Helvetica 12');
$gui->{mw}->optionAdd('*BorderWidth' => 1);
$gui->{mw}->title("Ecasound/Nama");
$gui->{mw}->deiconify;
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.450 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )