FLTK logo

STR #1645

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

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:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#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 ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.