Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » ChatClient with Ultimate++
Re: ChatClient with Ultimate++ [message #14671 is a reply to message #14668] Thu, 06 March 2008 22:02 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
chochmah wrote on Thu, 06 March 2008 15:39

///layout

LAYOUT(j2Layout, 624, 436)
ITEM(LineEdit, a, LeftPosZ(4, 564).TopPosZ(412, 20))
ITEM(RichTextView, e, LeftPosZ(0, 624).TopPosZ(0, 408))
END_LAYOUT

///main

class j2 : public Withj2Layout<TopWindow> {
public:
typedef j2 CLASSNAME;
j2();
};

j2 HG;
String qtfx;

j2::j2() {
CtrlLayout(*this, "Joachim 0.1");
SetLanguage( LNG_('D','E','D','E') );
SetDefaultCharset(CHARSET_UTF8);
}

void textin_cb(int x,String farbe,String Sender,String text) {
qtfx<<"\1"<<Sender<<":"<<text<<"\1]&";
HG.e.SetQTF(qtfx);
HG.e.ScrollEnd();
}


GUI_APP_MAIN
{
readinifile();
int ids = 1;
pthread_t threads;
pfi = &ParseChatLine;
pthread_create (&threads, NULL, readchat, &ids);
HG.Run();
}


Thanks for the Reply, I hope this helps. Calling textin_cb result in an heap or memory error when:
-The scrollbar is moved while textin_cb is called
-More then one page of text in the widget
(also happens without HG.e.ScrollEnd()Wink


Thank you


Still too little info. I do not even see when textin_cb is called....

A proper testcase is zipped package to demonstrate the rpoblem that compiles, most preferably on both Win32 and linux.


Anyway:

If you are using threads, you should use U++ threads, otherwise you will have memory leaks.

GUI can run in the main thread only.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [BUG] Ctrl::AlignRight
Next Topic: what is the largest Array size please? ("out of memory" error)
Goto Forum:
  


Current Time: Wed Sep 03 20:01:01 CEST 2025

Total time taken to generate the page: 0.04949 seconds