FLTK logo

Re: [fltk.general] resizable question

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: resizable question Albrecht Schlosser Nov 20, 2020  
 
On 11/21/20 3:14 AM duncan wrote:
Nice. It even works if you increase the width of the window and the width of box C. It's the combination of width of B and starting at the middle of B that does it.

Well, yes, that does it. I apologize if the following sounds like nitpicking, but to make sure the mechanics are clear:

It has nothing to do with the width of B and the width of the invisible box (if that's what you meant): they are not related. The condition that must be met is that the invisible box is centered over the border between B and C. That's all.

You'll see this if you replace the relevant code of my 2nd version with this:


  int d = 1;
  box_i = new Fl_Box(300-d, 24, 2*d, 37, ""); // invisible box
  box_i->box(FL_NO_BOX);
  main_win->resizable(box_i);

where X = 300 - d and W = 2 * d to center it between B and C (at 300). You can vary d in a sensible range (1 - 200) but something goes awry if you make it larger than 200 because it crosses the window borders.

--
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/dc6740bb-b926-3989-8fd6-62b64acf2fb0%40online.de.
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'.