[RE: [[lazarus] GTK Z order & fixed frame]]

Michal Bukovjan mbukovjan at netscape.net
Mon Aug 30 11:42:34 EDT 1999


"Samuel Liddicott" <sam at campbellsci.co.uk> wrote:
...
> > > Next problem is that in windows, each "window" is er... a
> > normal window and
> > > can actually have child controls.
> > > A button or a list box can have child controls (I've done this in some
> > > applications...).
> > >
> > > Can GTK list boxes have child controls?
> >
> > Yes. In fact, the GtkList is only a container containing GktItems
(provide
> > white background behind the text), which in turn may contain a
> > GtkLabel, which
> > is then what you see. But theoretically, the list may contain anything,
> > pictures, buttons, any other container containing yet another controls,
> > anything you like.
> 
> Does this imply that any gtkWidget may contain other gtkWidgets?
> 
No. GtkWidget cannot have child controls. The GtkContainer can, and most
widgets and derived from GtkContainer.

...
> > This OwnerDraw stuff as I see it now is the most likely candidate to be
> > incompatible with WinDelphi.
> 
> We can make it work!  We may have to do a ReCreateWnd and make a generic
GTK
> window if it is ownerdraw and then err.... draw by hand.  No probs! 
(Except
> of course TListBoxStrings will be implemented slightly differently to cope
> for the fact when there is no gtkListBox)

I thought about that, and will try that approach in near future. I have to
test Shane's implementation of TCanvas first, and few other things, because in
OnDraw event (OnOwnerDraw ?), you pass not the TCanvas, but TWinControl, and a
rectangle. Unlike Win32 listbox, which has one big canvas for all of its
lines, the GtkListBox approach (which I find cool :-) is that for each line
(item) it contains another container, GtkItem, and this another container
(descendant of GtkContainer, GtkBin - designed to hold just one child), may or
may not hold a GtkLabel (which provides Canvas). The label holds and paints
the text.
This OwnerDrawing would require to create an arbitrary control on the fly, and
put it instead of the GtkLabel, which is not a problem. The problem is in the
structure of the OwnerDraw event, which would point to different rectangles,
but that need not be a problem, too.

Your approach, to create one big control with one canvas might also be a
solution, but then a complete selection and focus management would have to be
reprogrammed for TListBox :-(

> 
> It seems that the only things which may affect how things work then, are:
> 
> Z order stetting
> Can any gtk widget be a parent widget
No, only GtkContainer, which is a descendant of GtkWidget.

Michal Bukovjan


____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.






More information about the Lazarus mailing list