[[lazarus] GTK Z order & fixed frame]

Samuel Liddicott sam at campbellsci.co.uk
Mon Aug 23 05:37:34 EDT 1999




> -----Original Message-----
> From: Michal Bukovjan [mailto:mbukovjan at netscape.net]
> Sent: 20 August 1999 07:03 PM
> To: lazarus at miraclec.com
> Subject: Re: [[lazarus] GTK Z order & fixed frame]
>
> Hmm, I am not sure at this point, but as I studied the GTK, I
> think there is
> some gtk_??widget??_??set??_??window??_??policy?? (I really do
> not remember
> now), in which you pass four arguments for scaling, in a range
> 0-1, where 1
> means resize totally in that direction upon parent resize, 0 means do not
> resize. (you can pass float values in between). So, I think if
> you set that up
> to 0,0,0,0, you get non-resizable control.

Oh, good.

> > 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?

> > Do we get to intercept the painting for child controls?  In delphi I do
> this
> > quite a bit - not least for OwnerDraw buttons and OwnerDraw list boxes?
>
> Now this is what I am interested now. I am not sure though, maybe
> Shane, who
> does this Canvas stuff, will listen. Do you, Shane?
> Is it possible to get/make use/map arbitrary widget's GdkCanvas to a
> Delphi-like TCanvas, or better yet, to an arbitrary control ?
> (i.e. I don't
> want a control that creates its Canvas, but rather have a dummy
> control (say
> TGraphicControl descendant) and assign an existing GdkCanvas (of
> some existing
> GtkWidget) to it on the fly ?
>
> 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)

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

If this are both possible we can implement the full VCL model the way Delphi
does.

Sam






More information about the Lazarus mailing list