-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotebook.php
More file actions
98 lines (85 loc) · 2.92 KB
/
Notebook.php
File metadata and controls
98 lines (85 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Notebook.php - \Callicore\Twitter\Notebook holds tabs for different views of timeline
*
* This is released under the MIT, see license.txt for details
*
* @author Elizabeth Smith <auroraeosrose@php.net>
* @copyright Elizabeth Smith (c)2009
* @link http://callicore.net
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @version $Id: Notebook.php 25 2009-04-30 23:58:52Z auroraeosrose $
* @since Php 5.3.0
* @package callicore
* @subpackage twitter
* @filesource
*/
/**
* Namespace for application
*/
namespace Callicore\Twitter;
use \Callicore\Lib\Application; // grab translate object
use \Gtk; // lots of gtk constants
use \GtkNotebook; // we extend this
use \GtkLabel; // we need labels for our tabs
class Notebook extends GtkNotebook {
/**
* The recent page
* @var object instanceof something
*/
protected $recent;
/**
* The replies page
* @var object instanceof something
*/
protected $replies;
/**
* The messages page
* @var object instanceof something
*/
protected $messages;
/**
* The everyone page
* @var object instanceof something
*/
protected $everyone;
/**
* The everyone page
* @var array of GtkLabel
*/
protected $labels = array('recent' => null,
'replies' => null,
'messages' => null,
'everyone' => null);
/**
* Creates 4 pages for the notebook and places tabs at the
* bottom of the screen
*
* @param string $username twitter username
* @param string $password twitter password
* @return boolean
*/
public function __construct() {
// create the parent
parent::__construct();
// tabs go on the bottom
$this->set_tab_pos(Gtk::POS_BOTTOM);
// grab our translate object
$t = Application::getInstance()->translate;
// create our labels
$this->labels['recent'] = new GtkLabel($t->_('recent'));
$this->labels['replies'] = new GtkLabel($t->_('replies'));
$this->labels['messages'] = new GtkLabel($t->_('messages'));
$this->labels['everyone'] = new GtkLabel($t->_('everyone'));
// create our notebook tabs
$this->recent = new TweetList('recent');
$this->replies = new TweetList('replies');
$this->messages = new TweetList('messages');
$this->everyone = new TweetList('everyone');
// put our tabs in our notebook
$this->append_page($this->recent, $this->labels['recent']);
$this->append_page($this->replies, $this->labels['replies']);
$this->append_page($this->messages, $this->labels['messages']);
$this->append_page($this->everyone, $this->labels['everyone']);
}
}