// sock.Read(charbuf, 1);
// if (isprint(charbuf[0])) buf.Append(charbuf[0], 1);
//} while(isprint(charbuf[0]));
- printf("<%s\n", (const char *)buf);
}
// Write a line of text to the server
void CitClient::serv_puts(wxString buf) {
- printf(">%s\n", (const char *)buf);
//sock.Write(buf, strlen(buf));
//sock.Write("\n", 1);
sock.serv_puts(buf);
wxString *infoptr;
wxString infoline;
- sendcmd = "IDEN 0|6|000|Daphne";
+ sendcmd = "IDEN 0|6|001|Daphne";
serv_trans(sendcmd);
sendcmd = "INFO";
citsock = sock;
+ who_refresh *ref = new who_refresh(this);
+
// set the frame icon
/* SetIcon(wxICON(mondrian)); */
wholist->SetItem(i, 3, host);
}
}
+
+
+
+
+who_refresh::who_refresh(who *parent_who)
+ : wxTimer() {
+
+ which_who = parent_who; // Know which instance to refresh
+
+ Start(30000, FALSE); // Call every 30 seconds
+}
+
+
+void who_refresh::Notify(void) {
+ which_who->LoadWholist();
+}
public:
who(CitClient *sock, wxMDIParentFrame *MyMDI);
int do_login();
+ void LoadWholist();
private:
void OnButtonPressed(wxCommandEvent& whichbutton);
CitClient *citsock;
wxListCtrl *wholist;
- void LoadWholist();
DECLARE_EVENT_TABLE()
};
+
+
+// This is a timer that periodically refreshes the wholist.
+class who_refresh : public wxTimer {
+public:
+ who_refresh(who *parent_who);
+private:
+ who *which_who;
+ void Notify(void);
+};