source: trunk/MagicSoft/Cosy/gui/MGEmbeddedCanvas.cc@ 924

Last change on this file since 924 was 920, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 1.3 KB
Line 
1//
2// This File contains the definition of the MGCoordinates-class
3//
4// Author: Thomas Bretz
5// Version: V1.0 (1-8-2000)
6
7#include "MGEmbeddedCanvas.h"
8
9#include <TList.h>
10#include <TCanvas.h>
11
12MGEmbeddedCanvas::MGEmbeddedCanvas(const char *name, const TGWindow* p,
13 const UInt_t width, Float_t range)
14 : TRootEmbeddedCanvas(name, p, width+1, width+1, 0/*kRaisedFrame*/),
15 fModified(kFALSE), fWidth(width), fRange(range), fPix(2.*range/width)
16{
17 fCanvas = GetCanvas();
18
19 fCanvas->SetFillColor(39); // s. TAttFill
20 fCanvas->Range(-fRange, -fRange, fRange, fRange);
21
22 fList = new TList;
23 fList->SetOwner();
24}
25
26MGEmbeddedCanvas::~MGEmbeddedCanvas()
27{
28 delete fList;
29}
30
31void MGEmbeddedCanvas::InitCanvas()
32{
33 MapSubwindows();
34
35 Resize(fWidth, fWidth); //GetDefaultSize()); // ???
36 MapWindow();
37
38 fCanvas->SetEditable(kFALSE);
39}
40
41void MGEmbeddedCanvas::UpdateCanvas()
42{
43 if (!fModified)
44 return;
45
46 //
47 // FIXME: Sometimes (if the canvas couldn't be created correctly:
48 // X11 Pixmap error) Update hangs the Gui system.
49 //
50 // Fixed: Using root 3.01/06 and doing the update from within the
51 // mainthread.
52 //
53
54 fCanvas->Modified();
55 fCanvas->Update();
56
57 fModified = kFALSE;
58}
Note: See TracBrowser for help on using the repository browser.