| [ Return to Bugs & Features | SVN ⇄ GIT ]
STR #3380
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | FLUID |
Summary: | Change FLUID codegeneration behavior for "Widget Clas" with "relative" option "ON" |
Version: | 1.4-feature |
Created By: | kmxm |
Assigned To: | AlbrechtS |
Fix Version: | 1.4.0 |
Fix Commit: | b76152cf6c0346a34a1f866ad1809ad0c6f2e6ea |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | kmxm 12:45 Apr 21, 2017 |
| Normally FLUID generates constructor for widgets derived from Fl_Group in a way like this (with "relative option switched on"): SomeWidget::SomeWidget(int X, int Y, int W, int H, const char *L) : Fl_Group(0, 0, W, H, L) ... position(X, Y); ...
But this leads to problem if W & H specified in constructor don't match original widget's W & H at subsequent resize() call. All group's children will be resized erroneously due to changed parent size. It seems better way to construct widget with it's original size and the resize it to new W & H at the end of constructor. Something like this: SomeWidget::SomeWidget(int X, int Y, int W, int H, const char *L) : Fl_Group(0, 0, 200, 300, L) ... resize(X, Y, W, H); ... I have made corrections in FLUID's Fl_Window_Type.cxx and it seems work well. | |
|
#2 | AlbrechtS 10:32 May 01, 2017 |
| Thanks for the report.
I can understand what you mean, but it's hard to know what exactly the wrong behavior you describe is. And what are the changes you made to fluid?
It would be very much appreciated if you could post (use the 'Post File' link):
(a) a full fluid example file that shows the wrong behavior (b) a patch that shows your changes.
Ideally the full fluid example would also contain a main() function so that it can be compiled and linked. OTOH a separate main() would do as well. Please use unified diff format, i.e. diff -u, svn diff, git diff, or similar for the patch.
Please do also describe the expected behavior of your example and what you think is wrong if it's not obvious. TIA.
Note: this will be fixed in FLTK 1.4.0, if possible, since 1.3 development is closed. Moved STR from 1.3-feature to 1.4-feature. | |
|
#3 | matt 08:02 Jan 20, 2023 |
| I believe that this is fixed since b76152cf6c0346a34a1f866ad1809ad0c6f2e6ea in Nov. 2022, but maybe I am not entirely understanding the issue. | |
|
#4 | kmxm 06:07 Jan 23, 2023 |
| Nope. The same behavior on the last master (1.4). I've added some more explanations in the attached file together with the video demonstrating the differences in the behavior of the original and modified code. | |
|
#5 | AlbrechtS 06:32 Jan 23, 2023 |
| @kmxm: I believe what Matt wanted to say that the mentioned commit introduces a new variation of the "relative position" option. Current options are:
- Fixed - Reposition - Resize
Can you please try if the new option fixes your issue? You'd have to change your fl file.
Disclaimer: I'm not a "fluid guy" and can't follow what exactly you're doing in your example, I'm just trying to help. | |
|
#6 | kmxm 07:03 Jan 23, 2023 |
| Yes. It works on the mentioned commit ID. It was difficult to find this new option without a hint. And I also thought that this feature was already in the master branch. | |
|
#7 | AlbrechtS 14:36 Jan 23, 2023 |
| Fixed in Git repository.
OK, thanks for the confirmation.
This will be in release 1.4.0. | |
[ Return to Bugs & Features ]
|
| |