Skip to content

Commit

Permalink
Fixed window title setting and added a window class example
Browse files Browse the repository at this point in the history
  • Loading branch information
iberflow committed Feb 2, 2016
1 parent 02c2d84 commit 562fbee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/window.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

include __DIR__ . '/../vendor/autoload.php';

$window = new \Iber\Console\UI\Window();
$window->setTitle('My App');

echo "Window size: ", $window->getHeight(), 'x', $window->getWidth(),PHP_EOL;
2 changes: 1 addition & 1 deletion src/UI/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public function getHeight()
* @param $title
*/
public function setTitle($title) {
fwrite(STDOUT, "\033[0;{$title}\007");
fwrite(STDOUT, "\033]0;$title\007");
}
}

0 comments on commit 562fbee

Please sign in to comment.