Advertisement
Guest User

gtksimple

a guest
Jul 2nd, 2015
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.71 KB | None | 0 0
  1. #!/usr/bin/env perl6
  2. use v6;
  3. use GTK::Simple;
  4.  
  5. my GTK::Simple::App $app1.= new( title => 'App1' );
  6. $app1.border_width = 10;
  7. $app1.size_request(100, 100);
  8. $app1.set_content(
  9.     GTK::Simple::VBox.new(
  10.     my $start = GTK::Simple::Button.new(label => 'Start'),
  11.     my $end = GTK::Simple::Button.new(label => 'Exit')
  12.     )
  13. );
  14.  
  15. my GTK::Simple::App $app2.= new( title => 'App2' );
  16. $app2.border_width = 10;
  17. $app2.size_request(100, 100);
  18. $app2.set_content(
  19.     GTK::Simple::VBox.new(
  20.     my $end1 = GTK::Simple::Button.new(label => 'Exit')
  21.     )
  22. );
  23.  
  24. $start.clicked.tap:
  25. {
  26.     $app1.exit;
  27.     $app1.exit;
  28.     $app2.run;
  29. }
  30.  
  31. $end.clicked.tap:
  32. {
  33.     $app1.exit;
  34. }
  35.  
  36. $end1.clicked.tap:
  37. {
  38.    $app2.exit;
  39. }
  40. $app1.run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement