/*************************************************************************************************************
This file contains statusbar
2012/6 by Dlxko
**************************************************************************************************************/
#include "Statusbar.h"

// Local static variables
static gchar *msg;
static gint row, col;
static GtkTextIter st_iter;

/*************************** Update statusbar ***********************/
void function_update_statusbar(GtkTextBuffer *buffer, GtkStatusbar  *statusbar)
{
	gtk_statusbar_pop(statusbar, 0);
	gtk_text_buffer_get_iter_at_mark(buffer, &st_iter, gtk_text_buffer_get_insert(buffer));
	row = gtk_text_iter_get_line(&st_iter);
	col = gtk_text_iter_get_line_offset(&st_iter);
	msg = g_strdup_printf("Chat have %d lines, including %d lines of text...", row, (row/2));
	gtk_statusbar_push(statusbar, 0, msg);
	g_free(msg);
}