summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/buddywindow.cpp8
-rw-r--r--src/resources/buddylist.cpp2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/buddywindow.cpp b/src/gui/buddywindow.cpp
index 54652a30..b125f34c 100644
--- a/src/gui/buddywindow.cpp
+++ b/src/gui/buddywindow.cpp
@@ -26,9 +26,16 @@ BuddyWindow::BuddyWindow():
Window("Buddys")
{
setContentSize(80,200);
+
listbox = new gcn::ListBox();
listbox->setListModel(dynamic_cast<ListModel*>(this));
+
scrollArea = new ScrollArea(listbox);
+ scrollArea->setDimension(gcn::Rectangle(
+ 2, 0, 76, 180));
+ add(scrollArea);
+
+ addBuddy("Usiu"); // for testing
}
BuddyWindow::~BuddyWindow()
@@ -41,7 +48,6 @@ void BuddyWindow::draw(gcn::Graphics *graphics)
{
// Draw the children
Window::draw(graphics);
-
}
void BuddyWindow::action(const std::string& eventId)
diff --git a/src/resources/buddylist.cpp b/src/resources/buddylist.cpp
index 87e6438f..91bcf986 100644
--- a/src/resources/buddylist.cpp
+++ b/src/resources/buddylist.cpp
@@ -69,7 +69,7 @@ int BuddyList::getNumberOfElements(void)
std::string BuddyList::getElementAt(int number)
{
- if(number <= buddylist.size())
+ if(number <= buddylist.size() - 1)
{
buddyit = buddylist.begin();
std::advance(buddyit, number);