Curses::Toolkit    FOSDEM 2011                  dams - FOSDEM’11
Who I am• I‘m dams (Damien Krotkine)• french Perl Monger, doing Perl stuff for many  years (at work and at home)• not good...
This talk• Commercial breaks• slides• demonstration ( the fun part )                                   dams - FOSDEM’11
Commercial breaks  ☺          ☺                    dams - FOSDEM’11
• Part of the French Perl Mongers• We have a cool logo• organizing the FPW 2011 ➸ Paris, be there !• http://journeesperl.f...
• Cool Perl centric company• sponsored me• they are hiring two Perl devs & one dba• http://weborama.com                   ...
• Effortless Web Framework for Perl• easy, powerful, flexible, stable• nice community• http://perldancer.org               ...
• All about modern Perl• french book• 4 authors (including me)• 450 pages• available here, go buy it !• http://perlmoderne...
End of Commercials   ☹   ☠☢☣   ☹                     dams - FOSDEM’11
Curses::Toolkit• do you use a Terminal ?• do you know ncurses ?• do you know GTK / QT ?• Curses : perl binding• Curses bas...
1. History ofCurses::Toolkit                  dams - FOSDEM’11
History• I’ve been doing ncurses based stuff before• some Gentoo Linux app, like profuse• RT::Client::Console for Venda(tm...
Existing solutions Issues• Curses module on CPAN not good enough• Curses : too low level• Curses::UI : buggy, absolute coo...
Curses::Toolkit• a true toolkit, with widgets and events• OO hierarchy.• events : keyboard, mouse, timers, etc• Fully them...
2. Concepts              dams - FOSDEM’11
Terminal             Root window             WindowLabel             Widget
Widget::Label                          everything goes through         theme                                the theme     ...
Root window  Window1                   Window2    BoxBorder    ButtonLabel
Object HierarchyCurses::Toolkit::Widget|+-- Curses::Toolkit::Widget::Label|+-- Curses::Toolkit::Widget::Entry|+-- Curses::...
Signals• signals can com from • keyboards • mouse • timer • terminal resize• they are sent back and forth to POE• simply u...
Cool stuff• Windows • have animated titles • can be moved / resized (with mouse too)• labels • can wrap, be justified • sup...
3. Code          dams - FOSDEM’11
my $root = POE::Component::Curses->spawn;my $window = Curses::Toolkit::Widget::Window->new;my $label = Curses::Toolkit::Wi...
POE::Component::Curses->spawn  ->add_window(     Curses::Toolkit::Widget::Window       ->new()       ->set_coordinates(x1 ...
DEMO       dams - FOSDEM’11
Thanks !•   Curses::Toolkit on CPAN•   http://damien.krotkine.com/blog•   http://github.com/curses-toolkit                ...
Curses::Toolkit
Curses::Toolkit
Upcoming SlideShare
Loading in …5
×

Curses::Toolkit

4,286 views

Published on

Curses::Toolkit is a Perl module to build ncurses based applications.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,286
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Curses::Toolkit

    1. 1. Curses::Toolkit FOSDEM 2011 dams - FOSDEM’11
    2. 2. Who I am• I‘m dams (Damien Krotkine)• french Perl Monger, doing Perl stuff for many years (at work and at home)• not good at blogging, twittering, etc ☺ dams - FOSDEM’11
    3. 3. This talk• Commercial breaks• slides• demonstration ( the fun part ) dams - FOSDEM’11
    4. 4. Commercial breaks ☺ ☺ dams - FOSDEM’11
    5. 5. • Part of the French Perl Mongers• We have a cool logo• organizing the FPW 2011 ➸ Paris, be there !• http://journeesperl.fr/fpw2011 dams - FOSDEM’11
    6. 6. • Cool Perl centric company• sponsored me• they are hiring two Perl devs & one dba• http://weborama.com dams - FOSDEM’11
    7. 7. • Effortless Web Framework for Perl• easy, powerful, flexible, stable• nice community• http://perldancer.org dams - FOSDEM’11
    8. 8. • All about modern Perl• french book• 4 authors (including me)• 450 pages• available here, go buy it !• http://perlmoderne.fr dams - FOSDEM’11
    9. 9. End of Commercials ☹ ☠☢☣ ☹ dams - FOSDEM’11
    10. 10. Curses::Toolkit• do you use a Terminal ?• do you know ncurses ?• do you know GTK / QT ?• Curses : perl binding• Curses based Toolkit in Perl, inspired by GTK dams - FOSDEM’11
    11. 11. 1. History ofCurses::Toolkit dams - FOSDEM’11
    12. 12. History• I’ve been doing ncurses based stuff before• some Gentoo Linux app, like profuse• RT::Client::Console for Venda(tm) dams - FOSDEM’11
    13. 13. Existing solutions Issues• Curses module on CPAN not good enough• Curses : too low level• Curses::UI : buggy, absolute coordinates, event loop not flexible• Curses::Widget : horrible API, event loop too simple, Widget::Forms too heavy• damned manual hellish coordinates calculation ! dams - FOSDEM’11
    14. 14. Curses::Toolkit• a true toolkit, with widgets and events• OO hierarchy.• events : keyboard, mouse, timers, etc• Fully themable• POE based event loop• no damned manual hellish coordinates calculation anymore ! dams - FOSDEM’11
    15. 15. 2. Concepts dams - FOSDEM’11
    16. 16. Terminal Root window WindowLabel Widget
    17. 17. Widget::Label everything goes through theme the theme screen
    18. 18. Root window Window1 Window2 BoxBorder ButtonLabel
    19. 19. Object HierarchyCurses::Toolkit::Widget|+-- Curses::Toolkit::Widget::Label|+-- Curses::Toolkit::Widget::Entry|+-- Curses::Toolkit::Widget::Scrollbar| || +-- Curses::Toolkit::Widget::HScrollbar| || +-- Curses::Toolkit::Widget::VScrollbar|+-- Curses::Toolkit::Widget::Container | +-- Curses::Toolkit::Widget::HBox | +-- Curses::Toolkit::Widget::VBox | +-- Curses::Toolkit::Widget::Paned | | | +-- Curses::Toolkit::Widget::HPaned | | | +-- Curses::Toolkit::Widget::VPaned | +-- Curses::Toolkit::Widget::Bin | +-- Curses::Toolkit::Widget::Border | +-- Curses::Toolkit::Widget::Window | +-- Curses::Toolkit::Widget::Button | +-- Curses::Toolkit::Widget::GenericButton | +-- Curses::Toolkit::Widget::ProgressBar | +-- Curses::Toolkit::Widget::HProgressBar | +-- Curses::Toolkit::Widget::VProgressBar dams - FOSDEM’11
    20. 20. Signals• signals can com from • keyboards • mouse • timer • terminal resize• they are sent back and forth to POE• simply use signal_connect( signal => sub { } ) dams - FOSDEM’11
    21. 21. Cool stuff• Windows • have animated titles • can be moved / resized (with mouse too)• labels • can wrap, be justified • support tagging (colors, bold...) like GTK• entries • support shortcuts dams - FOSDEM’11
    22. 22. 3. Code dams - FOSDEM’11
    23. 23. my $root = POE::Component::Curses->spawn;my $window = Curses::Toolkit::Widget::Window->new;my $label = Curses::Toolkit::Widget::Label->new;$root->add_window( $window );$window->add_widget( $label );$window->set_coordinates( x1 => 0, y1 => 0, x2 => 40, y2 => 20 );POE::Kernel->run;
    24. 24. POE::Component::Curses->spawn ->add_window( Curses::Toolkit::Widget::Window ->new() ->set_coordinates(x1 => 0, y1 => 0, x2 => 40, y2 => 20) ->add_widget( Curses::Toolkit::Widget::Label ->new() ) );POE::Kernel->run;
    25. 25. DEMO dams - FOSDEM’11
    26. 26. Thanks !• Curses::Toolkit on CPAN• http://damien.krotkine.com/blog• http://github.com/curses-toolkit dams - FOSDEM’11

    ×