Fl_Tree Horizontal Scrollbar

18 views
Skip to first unread message

Nimday Satria

unread,
Aug 8, 2017, 10:36:47 PM8/8/17
to fltk.general
Hello again, I have little problem
I don't see horizontal scrollbar from Fl_Tree
1.3.4 on Linux and 1.3.3 on Windows XP

#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Tree.H>

int main(int argc, char *argv[]) {
   
Fl_Double_Window*win = new Fl_Double_Window(100,100);
   
Fl_Tree *tree = new Fl_Tree(0,0,100, 70);
   tree
->add("abcdefghijklmnopqrstuvwxyz");
   tree
->add("abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz");
   tree
->add("abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwx/abcdefghijklmnopqrstuvwxyz");
   win
->show();
   
return Fl::run();
}

Thanks.

Greg Ercolano

unread,
Aug 8, 2017, 11:12:33 PM8/8/17
to fltkg...@googlegroups.com
    Hmm, I can't replicate on Linux with 1.3.3 or 1.3.4; both horizontal and vertical
    scrollbars show up:



    ..which is what I'd expect to see, given you've set the window's
     width,height to only 100,100.

    I don't have windows handy at the moment so I can't check that, but if you
    focus on Linux I can try to help you with that.

    Can you send a screenshot of what you're seeing, along with more details
    about the distro/window manager and how you installed FLTK, giving any
    special details about build options (configure/cmake), or if you installed
    from internet binaries, include yum/apt-get installer details.

Nimday Satria

unread,
Aug 9, 2017, 1:03:59 AM8/9/17
to fltk.general

Thank you for replaying Sir,

Below the screenshot and configure from my distro Tinycore 8 32 bit with FLWM window manager


tc@box:/tmp$ fltk-config --version
1.3.4
tc@box:/tmp$ fltk-config --api-version
1.3
tc@box:/tmp$ g++ tree2.cpp -o tree `fltk-config --cxxflags --ldflags`
tc@box:/tmp$ ./tree



http://distro.ibiblio.org/tinycorelinux/8.x/x86/tcz/src/fltk/


cd fltk-1.3.4-1

patch -Np1 -i ../fltk-no-printing.patch [fluid will not compile]

CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --enable-shared --disable-gl --disable-xinerama --disable-xft --disable-xfixes --disable-xcursor --disable-xrender



Configuration Summary
    Directories: prefix=/usr/local
                 bindir=${exec_prefix}/bin
                 datadir=${datarootdir}
                 datarootdir=${prefix}/share
                 exec_prefix=${prefix}
                 includedir=${prefix}/include
                 libdir=${exec_prefix}/lib
                 mandir=${datarootdir}/man
       Graphics: X11+Xdbe
Image Libraries: JPEG=System
                 PNG=System
                 ZLIB=System
    Large Files: YES
         OpenGL: NO
        Threads: YES








Greg Ercolano

unread,
Aug 9, 2017, 1:37:02 AM8/9/17
to fltkg...@googlegroups.com
On 08/08/17 22:03, Nimday Satria wrote:
> Thank you for replaying Sir,
> Below the screenshot and configure from my distro Tinycore 8 32 bit with FLWM window manager


I see -- OK, I think I see why I couldn't replicate; I have FLTK
built with FL_ABI_VERSION set to 10304, which makes the problem go away.

So in your 1.3.4 version of FLTK, try running this unix command
from the FLTK source directory:

echo '#define FL_ABI_VERSION 10304' >> FL/abi-version.h

..and then rebuild FLTK:

make clean; make

..and then recompile/link your program; I imagine that will fix it.

This #define in the abi-version file enables a bunch of new
features in Fl_Tree. These are off by default because the features
break the ABI, but if you're statically linking, that should be of
no concern.

Greg Ercolano

unread,
Aug 9, 2017, 1:51:32 AM8/9/17
to fltkg...@googlegroups.com
On 08/08/17 22:36, Greg Ercolano wrote:
> I see -- OK, I think I see why I couldn't replicate; I have FLTK
> built with FL_ABI_VERSION set to 10304, which makes the problem go away.
> [..]
> This #define in the abi-version file enables a bunch of new
> features in Fl_Tree.


By the way, to see the new features the FL_ABI_VERSION setting adds
to e.g. the Fl_Tree widget, see:

http://www.fltk.org/doc-1.3/classFl__Tree.html

..and search the page for "ABI", and you'll see all the ABI features
that this setting enables for 1.3.4.

I think you also mentioned you're also using fltk 1.3.3.
I believe that same change will fix the problem there as well,
though you should probably use 10303 in place of 10304 in that case,
e.g.

echo '#define FL_ABI_VERSION 10303' >> FL/abi-version.h

..and then do a /clean/ rebuild fltk and a /clean/ rebuild of your app.

Albrecht Schlosser

unread,
Aug 9, 2017, 4:51:13 AM8/9/17
to fltkg...@googlegroups.com
On 09.08.2017 07:36 Greg Ercolano wrote:
>
> I see -- OK, I think I see why I couldn't replicate; I have FLTK
> built with FL_ABI_VERSION set to 10304, which makes the problem go away.
>
> So in your 1.3.4 version of FLTK, try running this unix command
> from the FLTK source directory:
>
> echo '#define FL_ABI_VERSION 10304' >> FL/abi-version.h

FWIW: for FLTK 1.3.4 I recommend the "official" way to configure FLTK with

./configure --with-abiversion=10304 <more options>

For FLTK 1.3.3 this new configure option is not available though, so
Greg's advice is a simple way to edit FL/abi-version.h.

Nimday Satria

unread,
Aug 9, 2017, 9:33:50 PM8/9/17
to fltk.general
Thank you both Mr.Greg Ercolano and Mr.Albrecht Schlosser, now i understand
I'm going to build it again.
Reply all
Reply to author
Forward
0 new messages