2018-07-26 18:15 UTC+01:00, code dz <[email protected]>:
> Hi Martin
> i tried to create a slider at runtime with this code , but nothing appears
>
> procedure tmainfo.onbuttonclick(const sender: TObject);
> var sd : tslider;
> begin
> sd := tslider.create(tscrollbox1);
> sd.top := 10;
> sd.left := 10;
> sd.width := 100;
> sd.height := 25;
> end;
>
seems widget constructor does not assign the parent widget . sorry i
followed the delphi way
this code works
procedure tmainfo.on_create(const sender: TObject);
var
bt : tSlider;
begin
bt := tSlider.create(nil);
bt.bounds_x := 10;
bt.bounds_y := 10;
bt.bounds_cx := 80;
bt.bounds_cy:= 20;
bt.parentwidget := self; <----
end;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk