mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 14:18:18 +02:00
gtk2: workaround Min >= Max for TTrackBar
git-svn-id: trunk@17104 -
This commit is contained in:
parent
b6bfdfc7a4
commit
57f365b076
@ -323,12 +323,16 @@ begin
|
||||
with ATrackBar do
|
||||
begin
|
||||
wHandle := Handle;
|
||||
Adjustment := gtk_range_get_adjustment (GTK_RANGE(Pointer(wHandle)));
|
||||
Adjustment := gtk_range_get_adjustment(GTK_RANGE(Pointer(wHandle)));
|
||||
// min >= max cause s crash
|
||||
Adjustment^.lower := Min;
|
||||
Adjustment^.upper := Max;
|
||||
Adjustment^.value := Position;
|
||||
if Min < Max then
|
||||
Adjustment^.upper := Max
|
||||
else
|
||||
Adjustment^.upper := Min + 1;
|
||||
Adjustment^.step_increment := LineSize;
|
||||
Adjustment^.page_increment := PageSize;
|
||||
Adjustment^.value := Position;
|
||||
{ now do some of the more sophisticated features }
|
||||
{ Hint: For some unknown reason we have to disable the draw_value first,
|
||||
otherwise it's set always to true }
|
||||
|
Loading…
Reference in New Issue
Block a user