Rajagopalan Srinivasan wrote:
> i am doing my first qtada program and am looking for some help. Listed here
> is the spec and body of a new widget i am trying to create.
> 
> clearly something is missing since this widget does not update the window.
> (Just a blank where it is supposed to be).
> 
> following is the spec of a new widget :any clues appreciated.
> 
You create QLcdNumber instance but don't "connect" it to your widget. At
least you should pass value for Parent:

   Self.Display :=
     Qt4.LCD_Numbers.Constructors.Create
      (Num_Digits => 12, Parent => Self);

or even better to use layout engine like:

function Create (Parent : access Qt4.Widgets.Q_Widget'Class := null)
  return not null Engine_Widget_Access
is
   Self   : constant Engine_Widget_Access := new Engine_Widget;
   Layout : constant not null Qt4.V_Box_Layouts.Q_V_Box_Layout_Access
     := Qt4.V_Box_Layouts.Constructors.Create;

begin
   Qt4.Widgets.Directors.Constructors.Initialize (Self, Parent);

   Self.Display :=
     Qt4.LCD_Numbers.Constructors.Create (Num_Digits => 12);
   Self.Display.Set_Segment_Style (Qt4.LCD_Numbers.Flat);

   Layout.Add_Widget (Self.Display);
   Self.Set_Layout (Layout);

   return Self;
end Create;

PS. Note, you need not redefine Paint_Event unless you need to do
special processing of paint events.

_______________________________________________
qtada-users mailing list
[email protected]
http://lists.qtada.com/mailman/listinfo/qtada-users_lists.qtada.com

Reply via email to