Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build errors encountered on lubuntu while attempting Chapter 12 Drill. #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions GUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ namespace Graph_lib {

struct Menu : Widget {
enum Kind { horizontal, vertical };
Menu(Point xy, int w, int h, Kind kk, const string& label)
: Widget(xy,w,h,label,0), k(kk), offset(0)
{}

Menu(Point xy, int w, int h, Kind kk, const string& label);

Vector_ref<Button> selection;
Kind k;
Expand Down
4 changes: 2 additions & 2 deletions Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ bool can_open(const string& s)
// check if a file named s exists and can be opened for reading
{
ifstream ff(s.c_str());
return ff;
return static_cast<bool>(ff);
}


Expand Down Expand Up @@ -355,4 +355,4 @@ void Image::draw_lines() const
p->draw(point(0).x,point(0).y);
}

} // Graph
} // Graph
2 changes: 1 addition & 1 deletion Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//#include<string>
//#include<cmath>
#include "fltk.h"
//#include "std_lib_facilities.h"
#include "std_lib_facilities.h"

namespace Graph_lib {
// defense against ill-behaved Linux macros:
Expand Down
4 changes: 2 additions & 2 deletions Point.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Graph_lib {

struct Point {
int x,y;
// Point(int xx, int yy) : x(xx), y(yy) { }
// Point() :x(0), y(0) { }
Point(int xx, int yy) : x(xx), y(yy) { }
Point() :x(0), y(0) { }

// Point& operator+=(Point d) { x+=d.x; y+=d.y; return *this; }
};
Expand Down
2 changes: 1 addition & 1 deletion Simple_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using namespace Graph_lib;
// Simple_window is basic scaffolding for ultra-simple interaction with graphics
// it provides one window with one "next" button for ultra-simple animation

struct Simple_window : Window {
struct Simple_window :Graph_lib:: Window {
Simple_window(Point xy, int w, int h, const string& title )
: Window(xy,w,h,title),
button_pushed(false),
Expand Down