FLTK logo

Re: [fltk/fltk] possible incoherence in Fl_Tree_Item drawing (Issue #298)

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 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] possible incoherence in Fl_Tree_Item drawing (Issue #298) erco77 Nov 27, 2021  
 

Sounds like you want to right justify a widget in the item.

Not easy, since there's no flag currently that forces the child widget() to resize to fit the width of the tree. But it can be done with a combo of a custom item (to force the widget()'s size just before drawing it), and a custom widget which would contain your buttons responding to events or whatever.

Here's an example which makes a group with two button children; b1 (left justified, stretches in size), and b2 (right justified, remains fixed size):
tree-custom-right-justified.cxx.txt

As you resize the window, the group resizes, keeping 'b2' right justified at all times, this behavior is regular Fl_Group behavior defined by the resizable()s defined.

If you want more customized resize/handle behavior, you can derive your own FLTK class and make that the child widget do exactly what you want, and use it in place of the Fl_Group/Fl_Button's shown here.

Meanwhile, I can open a separate RFE issue requesting a new flag that forces any child widget() to resize to the full width of the item.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

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