View Issue Details

IDProjectCategoryView StatusLast Update
0023190LazarusWidgetsetpublic2015-06-24 14:27
ReporterThomas Schleusener Assigned ToZeljan Rikalo  
Status closedResolutionfixed 
Product Version1.0.2 
Summary0023190: TFloatSpinEdit - Lazarus freezes when opening
DescriptionLazarus freezes, when opening a form with a FloatSpinEdit. It is ok, when using only the default values. I have set them to Inc 0.1 , Max 59.9, Min 0.1 and Value 59 at design time, after that saved and closed the project. When I try to open it again, Lazarus freezes completely. I have tried it with Win32, it works fine there.
Additional InformationOS is OpenSuse 12.1 with KDE 4.7.2
TagsNo tags attached.
Fixed in Revision39229
WidgetsetGTK 2
Attached Files


related to 0023266 assignedZeljan Rikalo Lazarus while FloatSpinEdit.MinValue<>0 Keyboard input does not work correctly 
related to 0028123 assignedZeljan Rikalo Patches TFloatSpinEdit, TSpinEdit: Cannot enter value as expected 


2012-10-22 13:43


project1.tar.gz (128,141 bytes)

Juha Manninen

2012-10-23 00:41

developer   ~0063383

Last edited: 2012-10-23 00:44

For me it does not freeze immediately but only after changing the values in a certain way, sometimes clicking the value to go above the upper limit, sometimes editing it by keys.

It goes into an eternal loop (1 CPU core runs 100%) somewhere inside LCL but I could not find where.
It is not in TCustomFloatSpinEdit code nor in TGtk2WSCustomFloatSpinEdit code. I debugged both with breakpoints in every method.

I almost never was able to fix a bug in GTK2 bindings although I tried, and the same trend continues...

Thomas Schleusener

2012-10-23 16:48

reporter   ~0063390

I have updated Lazarus from 0.9.32 to 1.0.2 one week ago. With 0.9.32 that problem never occured.

Thomas Moritz

2012-10-23 19:06

reporter   ~0063394

LazRevision: 1.1 / 39151, Fpc 2.7.1 / opensuse 12.2/x86_64 /

MinValue=0 ; Value=0 ; Increment=0,2 ; MaxValue=99,1

Only with this settings (MinValue/Value) starts the Application.
Increment is OK from 0,0 to 99,0 -> after = 99,1 (increment 0,2 ?!)
Decrement is OK from 99,1 to 0,1 -> after = 0,0 (increment 0,2 ?!)

Zeljan Rikalo

2012-10-25 10:38

developer   ~0063435

Workaround: add clocale unit into .lpr uses clause (for UNIX targets).
I'll try to fix that. Problem is that eg. my system is hr_HR.UTF-8, and if you don't use clocale then:
gtk_entry_get_text() returns eg. 59,01 ,but our DecimalSeparator='.' so our callback stays in infinite loop because of that.

Thomas Schleusener

2012-10-25 16:40

reporter   ~0063446

Adding clocale unit into .lpr uses clause does not fix the issue correctly. I can change the value by the up/down arrows only by an increment of 1, actually it is 0.1. And if I set Increment 0.1, MinValue 0.1, MaxValue 59.9 and Value 59.2 at design time, Lazarus freezes completely while loading the project.

I have tried to change Sysutils.DecimalSeparator to '.' without clocale, and it was much better. Only when I select all digits of the value and try to enter a new one by keys, the application freezes again.

Zeljan Rikalo

2012-10-25 18:41

developer   ~0063452

what's regular decimal separator of your locale ?

Thomas Schleusener

2012-10-25 20:11

reporter   ~0063455


Zeljan Rikalo

2012-11-01 10:11

developer   ~0063595

So it is same here. When clocale isn't added into lpr then it's freezing. When clocale unit is included then everything is ok. Another question is what echo $LANG says in your case ?

Thomas Schleusener

2012-11-01 11:01

reporter   ~0063596

echo $LANG says de_DE.UTF-8

Zeljan Rikalo

2012-11-01 14:17

developer   ~0063609

then it's same as here, my lang=hr_HR.UTF-8, so:
1.Gtk takes decimal separator from $LANG
2.If you don't include clocale unit fpc's decimalseparator = '.'
3.If you include clocale then decimalseparator is ','.
Problem is "2". You should NOT set decimalseparator to '.';
Both decimalseparators must be same (LANG and DecimalSeparator). Another issue might be SusE (I've already had problems with suse 10.3 and decimal separator).
It sets '.' as decimal separator, no matter what lang is choosen.
So, maybe you should force DecimalSeparator := ',' before app init if LANG='de_DE.UTF-8' and see if it works.

Bart Broersma

2012-11-01 19:42

developer   ~0063616

Related to 0013349?

Zeljan Rikalo

2012-11-02 09:32

developer   ~0063626

@Bart,yes it is related to 13349 somehow, but again, problem is in gtk2. It takes decimal separator from $LANG, and if you forget to include clocale, then lcl provides '.' as decimal separator and then you're in trouble in case of this control.

Thomas Schleusener

2012-11-02 09:54

reporter   ~0063627

I did some tests. I have included clocale, and put a new FloatSpinEdit on my from. Everything seems to be fine.
I put a
on button, it reports ','.

Then I put in FormShow:

everything is still fine, except FloatSpinEdit1 shows 39.2, not 39,2.
When I put the line
in FormShow, the Increment seems to be 1 now, FolatSpinEdit1 does not show any decimal places any more. Even if I set MinValue to 1, I have the same problem.

It seems, that setting MinValue to values other than 0 causes a problem.

Zeljan Rikalo

2012-11-02 10:04

developer   ~0063628

If FloatSpinEdit shows '.' instead of ',' then you have problem with locales on your OS. As I already mentioned : I had problems with locales with Suse distros (and still don't know why it is so). Try export LC_ALL=de_DE.UTF-8 from console and then start your app from same console.

Thomas Schleusener

2012-11-02 10:18

reporter   ~0063629

Sorry, it doesn't change anything. But it's not so important for me, if I see ',' or '.'. The problem with MinValue is much more serious.

Thomas Moritz

2012-11-02 13:47

reporter   ~0063633

With clocale and DecimalSeparator:=','; is OK with mouse!
But: Example:

Value = 11.3

Click the Cursor between 1 and 1
then press any key
The app freezes completely!

Put the cursor after the 3 and remove the 3
With mouse you can continue set up and down...

Thomas Schleusener

2012-11-02 14:01

reporter   ~0063634

I have the same problem, but only if MinValue<>0, with MinValue=0 everything works fine.

Zeljan Rikalo

2012-11-02 14:46

developer   ~0063635

Please test and close if ok. I've tested on Fedora 14,16 and Ubuntu 12.

Thomas Schleusener

2012-11-02 17:26

reporter   ~0063639

Last edited: 2012-11-02 17:27

It works perfect now. MinValue is ok and even ',' is shown in FloatSpinEdit.

Thank you, great job!

Issue History

Date Modified Username Field Change
2012-10-22 13:43 Thomas Schleusener New Issue
2012-10-22 13:43 Thomas Schleusener File Added: project1.tar.gz
2012-10-22 13:43 Thomas Schleusener Widgetset => GTK 2
2012-10-23 00:41 Juha Manninen LazTarget => -
2012-10-23 00:41 Juha Manninen Note Added: 0063383
2012-10-23 00:41 Juha Manninen Status new => confirmed
2012-10-23 00:44 Juha Manninen Note Edited: 0063383
2012-10-23 16:48 Thomas Schleusener Note Added: 0063390
2012-10-23 19:06 Thomas Moritz Note Added: 0063394
2012-10-25 10:36 Zeljan Rikalo Status confirmed => assigned
2012-10-25 10:36 Zeljan Rikalo Assigned To => Zeljan Rikalo
2012-10-25 10:38 Zeljan Rikalo Note Added: 0063435
2012-10-25 10:38 Zeljan Rikalo Status assigned => feedback
2012-10-25 16:40 Thomas Schleusener Note Added: 0063446
2012-10-25 18:41 Zeljan Rikalo Note Added: 0063452
2012-10-25 20:11 Thomas Schleusener Note Added: 0063455
2012-11-01 10:11 Zeljan Rikalo Note Added: 0063595
2012-11-01 11:01 Thomas Schleusener Note Added: 0063596
2012-11-01 14:17 Zeljan Rikalo Note Added: 0063609
2012-11-01 19:42 Bart Broersma Note Added: 0063616
2012-11-02 09:32 Zeljan Rikalo Note Added: 0063626
2012-11-02 09:54 Thomas Schleusener Note Added: 0063627
2012-11-02 10:04 Zeljan Rikalo Note Added: 0063628
2012-11-02 10:18 Thomas Schleusener Note Added: 0063629
2012-11-02 13:47 Thomas Moritz Note Added: 0063633
2012-11-02 14:01 Thomas Schleusener Note Added: 0063634
2012-11-02 14:46 Zeljan Rikalo Fixed in Revision => 39229
2012-11-02 14:46 Zeljan Rikalo Status feedback => resolved
2012-11-02 14:46 Zeljan Rikalo Resolution open => fixed
2012-11-02 14:46 Zeljan Rikalo Note Added: 0063635
2012-11-02 17:26 Thomas Schleusener Note Added: 0063639
2012-11-02 17:27 Thomas Schleusener Note Edited: 0063639
2012-11-02 17:28 Thomas Schleusener Status resolved => closed
2012-11-04 02:30 Juha Manninen Relationship added related to 0023266
2015-06-24 14:27 Zeljan Rikalo Relationship added related to 0028123