Added new type 'Channel' to encapsulate per Channel widget instances

This commit is contained in:
Tristan B. Kildaire 2020-10-18 00:53:33 +02:00
parent 0da0b58760
commit e126bf62c1
1 changed files with 76 additions and 0 deletions

View File

@ -7,7 +7,83 @@
* along with the input box state
*/
import gtk.Box;
import gtk.ListBox;
import gtk.Label;
public final class Channel
{
/**
* Channel details
*/
private string channelName;
/**
* The container for this Channel
*/
private Box box;
/**
* UI components
*
* Users's box
* - Label users
* - ListBox users
*/
private ListBox users;
private ListBox textArea;
this(string channelName)
{
this.channelName = channelName;
initializeBox();
}
private void initializeBox()
{
box = new Box(GtkOrientation.HORIZONTAL, 1);
/* The user's box */
Box userBox = new Box(GtkOrientation.VERTICAL, 1);
/* The user's list */
users = new ListBox();
userBox.add(new Label("Users"));
userBox.add(users);
/* The text box */
Box textBox = new Box(GtkOrientation.VERTICAL, 1);
textBox.add(new Label(channelName));
textArea = new ListBox();
import gtk.ScrolledWindow;
ScrolledWindow scrollTextChats = new ScrolledWindow(textArea);
textBox.add(scrollTextChats);
import gtk.TextView;
textBox.add(new TextView());
// import gtk.TextView;
// TextView f = new TextView();
// textBox.add(f);
box.add(textBox);
box.packEnd(userBox,0,0,0);
textBox.setChildPacking(scrollTextChats, true, true, 0, GtkPackType.START);
box.setChildPacking(textBox, true, true, 0, GtkPackType.START);
}
public Box getBox()
{
return box;
}
}