summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-11-15 15:48:22 +0100
committerMatthias Melcher <github@matthiasm.com>2023-11-15 15:48:22 +0100
commitfc03d304e787936fa6bdd619a79c1b3fef51484d (patch)
treeed80120ead8a8d4b2a5396d4414821d62baa2bed /fluid
parent4cf758f9c4edf33acb62a320ac4a37ed8f4cf595 (diff)
FLUID: fixing test/valuator.fl and test/tree.fl
Using Fl_Terminal widget instead of subclassing from Fl_Group
Diffstat (limited to 'fluid')
-rw-r--r--fluid/factory.cxx30
1 files changed, 17 insertions, 13 deletions
diff --git a/fluid/factory.cxx b/fluid/factory.cxx
index 2f425a216..79794ce2d 100644
--- a/fluid/factory.cxx
+++ b/fluid/factory.cxx
@@ -843,10 +843,10 @@ public:
static Fl_Text_Editor_Type Fl_Text_Editor_type;
-// ---- Simple Terminal ----
+// ---- Terminal ----
/**
- \brief Manage a simple terminal widget.
+ \brief Manage a terminal widget.
*/
class Fl_Terminal_Type : public Fl_Group_Type
{
@@ -856,19 +856,23 @@ public:
// Older .fl files with Fl_Simple_Terminal will create a Fl_Terminal instead.
const char *alt_type_name() FL_OVERRIDE { return "Fl_Simple_Terminal"; }
Fl_Widget *widget(int x, int y, int w, int h) FL_OVERRIDE {
- Fl_Widget *myo = 0L;
- if (batch_mode) {
- // The Fl_Terminal constructor attaches a buffer which in turn
- // opens a connection to the display. In batch mode, we create the
- // superclass Fl_Text_Display to avoid that.
- myo = new Fl_Text_Display(x,y,w,h);
- } else {
- Fl_Terminal *term = new Fl_Terminal(x, y, w, h);
- term->append("> ls -als");
- myo = term;
+ Fl_Terminal *term = new Fl_Terminal(x, y, w, h);
+ if (!batch_mode) {
+ //term->append("> ls -als"); // TODO: text color does not show
}
- return myo;
+ return term;
}
+// int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) FL_OVERRIDE {
+// Fl_Terminal *myo = (Fl_Terminal*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o);
+// switch (w) {
+// case 4:
+// case 0: f = (Fl_Font)myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break;
+// case 1: myo->textfont(f); myo->append("\033[2J\033[H> ls -als"); break;
+// case 2: myo->textsize(s); myo->append("\033[2J\033[H> ls -als"); break;
+// case 3: myo->textcolor(c); myo->append("\033[2J\033[H> ls -als"); break;
+// }
+// return 1;
+// }
Fl_Widget_Type *_make() FL_OVERRIDE {return new Fl_Terminal_Type();}
int is_parent() const FL_OVERRIDE { return 0; }
ID id() const FL_OVERRIDE { return ID_Terminal; }