| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. Printing wxTextCtrl content #4140 | Hi, I'm working on a small text editor and played around a bit with the printing functions. My problem is the if i want to print the content of a wxTextCtrl the debugger shows me the following error message :
========================================================================= Program has received a signal-name="SIGSEGV",signal-meaning="Segmentation fault" at MyFrame::Draw(wxDC&)({name="this",value="0x0"},{name="dc",value="@0x19eb4f0"}), file f:\Programmierung\Apps\SmartEdit\main.cpp:622 =========================================================================
The line caused it is (textFenster is a wxTextCtrl...) : ========================================================================= dc.DrawText(textFenster->GetValue(), 100, 100); =========================================================================
There are no problems printing any other strings. Made i only a small mistake or is that the compledly wrong way trying to print a wxTextCtrl ? | 2. Re: Printing wxTextCtrl content #4155 Posted by: upCASE 2004-05-17 15:08:13 | Hi! {name="this",value="0x0"} If "this" is NULL, that's pretty bad :) Check if you deleted some pointer accidentaly or pass a NULL pointer.
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! | 3. Re: Printing wxTextCtrl content #4159 | As far i can see that i haven't. But take a look yourself ... :
============================================================================ // Funktion zum Zeichnen der Seite [Function for drawing the page] void MyFrame::Draw(wxDC& dc) { dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); dc.SetFont(wxFont(30, wxSWISS, wxNORMAL, wxNORMAL, FALSE, _T("Lucida Console"))); wxString egal = textFenster->GetValue(); dc.DrawText(egal, 100, 100); }
// Funktion zum Drucken der Seite [Function for printing the page] bool MyPrintout::OnPrintPage(int page) { wxDC *dc = GetDC(); if (dc) { dc->SetDeviceOrigin(0, 0); dc->SetUserScale(1.0, 1.0); frame->Draw(*dc); return TRUE; } else return FALSE; } ============================================================================
That is the core printing code. Looks right, doesn't it ? | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|