|
|
On 11/30/21 2:46 PM 'Mark' via
fltk.general wrote:
I want to have a row of buttons like this:
[New] [Options] ...gap... [About] [Help] ...gap... [Quit]
Where the first two are aligned to the left of the parent
window, the middle two are in the middle of the row and the last
one is on the right. And of course I want them to keep these
relative positions when the window is resized.
Can this be done with pack or flex?
I don't think that this can be done with pack (Fl_Pack), you can't
define arbitrary and resizing "gaps".
flex (Fl_Flex) is not a core FLTK widget, it is a user contribution
added to the rust bindings. I don't know what it can do or not.
With standard FLTK (1.4, git, as of today) I'd derive my own
container widget from Fl_Group and override the resize() method.
However, I'm working on a new Fl_Grid widget that can do
easily what you want to achieve. This is intended to be in FLTK
1.4.0 when released, hopefully early in the next year (Jan, Feb,
Mar?).
I'm attaching a screenshot of two instances of the test/grid_buttons.cxx
demo and you can view the source code in my fork (branch Fl_Grid):
https://github.com/Albrecht-S/fltk/blob/Fl_Grid/test/grid_buttons.cxx
PS: I know that @MoAlyousef, the maintainer of fltk-rs, is following
the development and I assume that he will add Fl_Grid to the Rust
bindings as soon as it is ready for production (i.e. at least in the
official FLTK 1.4 branch in git).
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/20544235-c3ef-f99e-55d2-45685d122e66%40online.de.
Attachment:
grid_buttons.png
Description: PNG image
[ Direct Link to Message ] | |
|
| |