my
$plsub
=
sub
{
return
2 };
sub
new {
my
$class
=
shift
;
my
$self
=
$class
->SUPER::new(
@_
);
return
undef
unless
defined
$self
;
my
$sb
=
$self
->extGet(
'SideBars'
);
my
$page
=
$sb
->pageAdd(
'navigator panel'
,
'Colors'
,
'fill-color'
,
undef
,
'Select and insert colors'
);
$page
->Label(
-text
=>
'Colors'
)->
pack
(
-expand
=> 1,
-fill
=>
'both'
);
$self
->{QUITTER} = 1;
$self
->cmdHookBefore(
'plusser'
,
$plsub
);
return
$self
;
}
sub
CanQuit {
my
$self
=
shift
;
return
$self
->{QUITTER};
}
sub
MenuItems {
my
$self
=
shift
;
return
(
[
'menu'
,
undef
,
"~Test"
],
[
'menu_normal'
,
'Test::'
,
"~PopTest"
,
'poptest'
,
'help-about'
,
'CTRL+T'
],
)
}
sub
SettingsPage {
return
(
Test
=> [
'Label'
,
-text
=>
'TestPage'
],
)
}
sub
ToolItems {
return
(
[
'tool_button'
,
'Test'
,
'poptest'
,
'help-about'
,
'Pop up a message'
],
)
}
sub
Unload {
my
$self
=
shift
;
if
(
$self
->{QUITTER}) {
$self
->cmdUnhookBefore(
'plusser'
,
$plsub
);
my
$sb
=
$self
->extGet(
'SideBars'
);
$sb
->pageDelete(
'navigator panel'
,
'Colors'
);
return
$self
->SUPER::Unload
}
return
0
}
sub
Quitter {
my
(
$self
,
$val
) =
@_
;
$self
->{QUITTER} =
$val
;
}
1;