Some more stuff

This commit is contained in:
Tristan B. Kildaire 2020-10-17 19:32:31 +02:00
parent 5d76b434cb
commit 3bfe967e68
2 changed files with 12 additions and 5 deletions

View File

@ -99,8 +99,6 @@ public final class Connection : Thread
if(notificationType == 0) if(notificationType == 0)
{ {
/* TODO: Decode using tristanable */ /* TODO: Decode using tristanable */
writeln("new message"); writeln("new message");
} }
/* Channel notification (ntype=1) */ /* Channel notification (ntype=1) */
@ -191,6 +189,10 @@ public final class Connection : Thread
users.add(new Label(member)); users.add(new Label(member));
users.showAll(); users.showAll();
} }
/* Clear the text area */
textArea.removeAll();
textArea.showAll();
} }
@ -231,7 +233,7 @@ public final class Connection : Thread
userBox.add(new Label("Users")); userBox.add(new Label("Users"));
userBox.add(users); userBox.add(users);
/* The text box */
textArea = new ListBox(); textArea = new ListBox();
@ -239,7 +241,7 @@ public final class Connection : Thread
box.add(textArea); box.add(textArea);
box.packEnd(userBox,0,0,0); box.packEnd(userBox,0,0,0);
box.setChildPacking(textArea, true, true, 0, GtkPackType.START);

View File

@ -127,7 +127,7 @@ public class GUI : Thread
/* Connect option */ /* Connect option */
MenuItem connectItem = new MenuItem(); MenuItem connectItem = new MenuItem();
connectItem.setLabel("Connect"); connectItem.setLabel("Connect");
connectItem.addOnActivate(&exitButton); connectItem.addOnActivate(&connectButton);
gustavMenu.add(connectItem); gustavMenu.add(connectItem);
/* Exit option */ /* Exit option */
@ -165,6 +165,11 @@ public class GUI : Thread
// tl(); // tl();
} }
private void connectButton(MenuItem)
{
connections ~= new Connection(this, parseAddress("0.0.0.0", 7777), ["testGustav1", "bruh"]);
}
private void shutdownConnections() private void shutdownConnections()
{ {
foreach(Connection connection; connections) foreach(Connection connection; connections)