FLTK logo

STR #1280

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 #1280

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:FLUID
Summary:FLUID 1.1-x: wrong initalization for static arrays
Version:1.1.7
Created By:matt
Assigned To:matt
Fix Version:1.1-current (SVN: v5218)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 matt
16:11 May 15, 2006
FLUID offers the array syntax ("bttn[0]" etc) for naming in the field
  "Properties" -> "C++" -> "Name".
But for static objects like a menu structure, FLUID generates a wrong
initialization code. E.g. for a class `A' with a static menu and two
items named "item_[0]" and "item_[1]" it is produced in the .cxx file

Fl_Menu_Item* A::item_[2] = A::menu_Menu + 1;

instead of

Fl_Menu_Item* A::item_[] = {A::menu_Menu + 0, A::menu_Menu + 1};

Below an .fl example.

Best regards
Hartmut
------------------------------------------------------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0107
header_name {.h}
code_name {.cxx}
class A {open
} {
  Function {A()} {open
  } {
    Fl_Window window_ {
      label {Menu Test} open
      private xywh {326 250 355 190} type Double visible
    } {
      Fl_Menu_Button {} {
        label Menu open
        private xywh {25 25 85 20}
      } {
        MenuItem {menu_item_[0]} {
          label {Channel 1}
          private xywh {0 0 30 20}
        }
        MenuItem {menu_item_[1]} {
          label {Channel 2} selected
          private xywh {0 0 30 20}
        }
      }
    }
  }
  Function {show()} {open return_type void
  } {
    code {window_->show();} {}
  }
}

Function {} {open
} {
  code {A a;
a.show();} {}
}
-----------------------------------------------
 
 
#2 matt
03:20 Jun 20, 2006
Fixed in Subversion repository.

This should work now. Please give feedback about irregularities.
 
     

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'.