| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
STR #1645
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Documentation |
Summary: | Fl_Text_Buffer::text(): docs need clarification text() returns COPY |
Version: | 1.1-current |
Created By: | greg.ercolano |
Assigned To: | matt |
Fix Version: | 1.1-current (SVN: v5789) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | greg.ercolano 22:43 Apr 02, 2007 |
| Currently the docs for text() and text(char *text) reads: ------ const char* text(); void text(const char* text);
Gets or sets the text in the buffer. When you are done with the text, free it using the free() function. ------
IMHO it is not clear the part about free() is exclusively regarding the get method. Since this sentence is describing two methods that act very differently, I think the docs should be made very clear that text(void) returns a *copy* and not a pointer to the internal buffer, and that the free() comment has nothing at all to do with the text(const char*) method.
Possibly better wording:
------ const char* text(); void text(const char* text);
Gets or sets the text in the buffer. The first form returns a *copy* of the text in the buffer which you must later free() when done using it. The second form sets the text in the buffer, making an internal copy of the string that is automatically managed. ------ | |
|
#2 | AlbrechtS 07:49 Apr 12, 2007 |
| Addition:
The docs of Fl_Text_Buffer show an inconsistent graph that seems to indicate inheritance (like all the other widget docs), but this is not correct, because Fl_Text_Display and Fl_Text_Editor are _not_ derived from Fl_Text_Buffer. | |
|
#3 | matt 07:40 May 01, 2007 |
| Fixed in Subversion repository. | |
[ Return to Bugs & Features ]
|
| |