| 1 | package LibUI::ColorButton 0.01 { | ||
| 2 | 1 | ▶ | use 5.008001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Affix; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use parent 'LibUI::Control'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | # | ||
| 8 | sub color ($) { | ||
| 9 | my $s = shift; | ||
| 10 | CORE::state $affix //= wrap( | ||
| 11 | LibUI::lib(), | ||
| 12 | 'uiColorButtonColor', | ||
| 13 | [ InstanceOf ['LibUI::ColorButton'], | ||
| 14 | Pointer [Double], | ||
| 15 | Pointer [Double], | ||
| 16 | Pointer [Double], | ||
| 17 | Pointer [Double] | ||
| 18 | ] => Void | ||
| 19 | ); | ||
| 20 | my ( $r, $g, $b, $a ) = ( 0, 0, 0, 0 ); | ||
| 21 | $affix->( $s, $r, $g, $b, $a ); | ||
| 22 | ( $r, $g, $b, $a ); | ||
| 23 | } | ||
| 24 | affix( | ||
| 25 | LibUI::lib(), 'uiColorButtonSetColor', | ||
| 26 | [ InstanceOf ['LibUI::ColorButton'], Double, Double, Double, Double ] => Void, | ||
| 27 | 'setColor' | ||
| 28 | ); | ||
| 29 | affix( | ||
| 30 | LibUI::lib(), | ||
| 31 | 'uiColorButtonOnChanged', | ||
| 32 | [ InstanceOf ['LibUI::ColorButton'], | ||
| 33 | CodeRef [ [ InstanceOf ['LibUI::ColorButton'], Any ] => Void ], Any | ||
| 34 | ] => Void, | ||
| 35 | 'onChanged' | ||
| 36 | ); | ||
| 37 | affix( LibUI::lib(), 'uiNewColorButton', [Void] => InstanceOf ['LibUI::ColorButton'], 'new' ); | ||
| 38 | }; | ||
| 39 | 1; | ||
| 40 | # | ||
| 41 | __END__ | ||