FLTK logo

STR #3437

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 | SVN ⇄ GIT ]

STR #3437

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:2 - Specific to an operating system
Subsystem:MacOS
Summary:Support display of windows in tabbed form as in MacOS 10.12 Sierra
Version:1.4-feature
Created By:manolo
Assigned To:manolo
Fix Version:1.4.0 (SVN: v12596)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 manolo
06:10 Nov 22, 2017
usetabs.patch
23k
 
 
#2 manolo
00:43 Nov 28, 2017
usetabs_v2.patch
23k
 
 
#3 manolo
01:48 Nov 29, 2017
usetabs_v3.patch
24k
 
 
#4 manolo
08:40 Dec 05, 2017
usetabs_v4.patch
25k
 
 
#5 manolo
08:19 Dec 15, 2017
usetabs_v5.patch
24k
 
 
#6 manolo
09:00 Dec 15, 2017
TabbedWindows.png
166k
 
 
#7 manolo
09:03 Dec 15, 2017
WindowMenu.png
71k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 manolo
06:01 Nov 22, 2017
MacOS 10.12 Sierra (and above) introduced the possibility to
display several windows in tabbed form.

Attached usetabs.patch proposes an FLTK API to support that.

Without source level change, any FLTK app behaves as standard
Apple apps do (e.g., Preview): it contains a Window menu in the
system menu bar which lists current windows and contains
"Merge All Windows" to merge all windows into tabs of a single
"window".

A new member function of class Fl_Sys_Menu_Bar allows to activate
other styles of the Window menu, including a
"Merge Windows by Class" style intended to be useful for apps
that handle various kinds of windows.

Doxygen doc describes details.
 
 
#2 manolo
00:45 Nov 28, 2017
Use attached file #2.  
 
#3 greg.ercolano
21:25 Dec 07, 2017
I can confirm the v4 patch works with one of my commercial apps
which uses Fl_Sys_Menu_Bar.

My app doesn't create a Windows menu, so the one this patch provides
works fine, providing the mac defaults.

The only problem I had was building svn r12582 + v4 patch; I was getting
this error:

____________________________________________________________________
=== making src ===
Compiling Fl_cocoa.mm...
Compiling drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm...
Compiling Fl_Native_File_Chooser_MAC.mm...
Compiling Fl_MacOS_Sys_Menu_Bar.mm...
In file included from Fl_MacOS_Sys_Menu_Bar.mm:22:
In file included from ../FL/Fl_Sys_Menu_Bar_Driver.H:24:
In file included from ../FL/Fl_Sys_Menu_Bar.H:22:
In file included from ../FL/Fl_Menu_Bar.H:25:
In file included from ../FL/Fl_Menu_.H:28:
../FL/Fl_Menu_Item.H:413:16: error: expected member name or ';' after declaration specifiers
  void check() {flags |= FL_MENU_VALUE;}
  ~~~~         ^
1 error generated.
make[1]: *** [Fl_MacOS_Sys_Menu_Bar.o] Error 1
____________________________________________________________________

There seemed to be a check() macro being defined somewhere that was
breaking the definition of the check() member in Fl_Menu_Item, so I
found adding '#undef check' above that line fixed the error, e.g.

+#undef check
   void check() {flags |= FL_MENU_VALUE;}

I'm not sure where that define is coming from. I suspect, but cannot
currently prove, it might be coming from /usr/include/AssertMacros.h
 
 
#4 greg.ercolano
09:40 Dec 08, 2017
I've been able to confirm the check() error is caused by AssertMacros.h.
I'm on 10.12.6.

Apparently this is not a new problem, as I can't compile this simple
program on 10.10 or 10.12 without an error about check():

____________________________________________________________________
$ cat foo.mm
#include <stdio.h>
#import <Cocoa/Cocoa.h>   // this indirectly includes AssertMacros.h

int check() {             // simulates issue with check() method in Fl_Menu_Item.H
    printf("This is a test\n");
}

int main() {
    check();
    return 0;
}

$ g++ foo.mm -o foo
foo.mm:4:13: error: expected unqualified-id   <-- ERROR
int check() {                                 <-- caused by check() macro definition in AssertMacros.h
            ^
1 error generated.
____________________________________________________________________
 
 
#5 manolo
08:22 Dec 15, 2017
Attached patch #5 fixes the check() conflict.  
 
#6 manolo
09:12 Dec 15, 2017
Attached files to give an idea of the topic for those
who don't run MacOS :

- TabbedWindows.png illustrates two windows grouped
together in tabbed form. This is obtained with test/utf8
without any source code change.

- WindowMenu.png shows the "Window" menu of the same app.
Item "Merge All Windows" produces the tabbed form
shown in the other file.
Item "Move Tab To New Window" ungroups tabbed windows.
"Show Previous/Next Tab" allows to navigate between tabs.
The rest of the menu lists available top-level windows.
 
 
#7 manolo
07:22 Dec 18, 2017
Fixed in Subversion repository.

Following positive votes from Albrecht, Greg, Evan and Manolo,
this new feature implementation has been committed at r.12596.
 
 
#8 manolo
00:24 Mar 07, 2018
Fixed in Subversion repository.  
     

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