FLTK logo

Re: [fltk.general] Widget alignment based on external label

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Widget alignment based on external label Gonzalo Garramuño 17:17 Apr 10  
 

On 4/10/2024 7:15 PM, supsm17 wrote:
Let's say I have a Fl_Input with an external label "Input". How can I align the widget such that the labels are aligned with other widgets, rather than just the box?

There are several ways, depending on what you prefer:

1) Create an Fl_Group and place two widgets Box for label, Input without label. and position them using X and W coordinates.  If you use fluid, it can help. 2) Create a Fl_Pack, with similar widgets as Fl_Group.  Fl_Pack will pack the two widgets next to each other if you set the pack horizontally.  You just need to set the widget of the Fl_Group's widgets and the Fl_Pack's height. 3) If you are using fltk1.4, use Fl_Flex.  Similar to Fl_Pack (it is its default behavior).  But you can set the size of one widget (say the label) and let the other resize as you will.

Gonzalo Garramuño
ggarra13@gmail.com

--
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/77ac8c78-c752-4668-9684-6704d237091e%40gmail.com.
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'.