Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-09

Progress

56 messages · 12 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller
Show quoted text 25 lines
> > Actuallly, users WILL be able to create their own widgets once we add > some drawing mechanism that they can use to draw their widget. They > COULD write the entire thing in Pascal if they wished, just like you > add something totally new in windows. If there isn't something that > looks like you need, then you need to draw it. The drawing interface > will need to be done before this is possible. How do you plan on having this LCL generated component receive new events that were not originally defined for the base widget? How will this be able to support themes? How will this be able to support DnD? How will this be able to support Corba? If you think that you can make it do all of this well then great. We had this dicussion back in the beginning of the summer where we mulled over the possibility of writing directly to the XLIB or GDK. We all decided that it wasn't the way to go. Now all of a sudden everyone is talking about doing that again. If you go that way I feel that it will be extremely difficult to keep the indendence we have started with the InterfaceObject stuff. The only way to do it will most likely be to tie GTK or whatever API directly to the LCL.

Again, events would have to be dispatched internally and the only way they could dispatch those events internally is to have some base of events already active for their new component. This leads me to believe that a GTKEVENTBOX as a TControl or a TWInCOntrol to each component. That way anything that inherits TWINCONTROL would have the events that the GTKEVENTBOX has.

Michael is right, to a point. I can't create a widget that has a double-click mouse event if the base I am inheriting from doesn't have a click event already assigned to it. However, perhaps we should look at the gtkeventbox as a twincontrol or something.

Again, I still say this is not a big deal. We'll never be able to use the Deelphi Super page components (at least not many of them) and throw them into Lazarus. BUT, similiar compnents may be able to be made, especially non visual ones.....

Lets agree to that point and discuss the issue of adding a gtkeventbox to twincontrol. Whenever TWinControl is created, a gtkeventbox is created (depending on the fscompstyle?) so we know the base events that are received.....
I obviously haven't worked this out in my mind yet. I will look further into it, but lets hear other's thoughts.

Shane

Reply by email

Samuel Liddicott
to Michael A. Hess: I am concerned over this statement. Exactly what GTK primitives are you talking about?…
Show quoted text 20 lines
-----Original Message----- From: Michael A. Hess Sent: Tuesday, August 31, 1999 04:14 PM To: Subject: RE: [lazarus] Progress On Tue, 31 Aug 1999, Samuel Liddicott wrote: > Form designer waits on more complete (internally) VCL implementation which I > am also working on. > More complete VCL internals await knowledge of more GTK primitive operations > which I am studying. I am concerned over this statement. Exactly what GTK primitives are you talking about? You should not be dealing with GTK whole idea of the LCL and Lazarus is to remove the requirement of using the primitives. This is something that is handled in and by the widget set library.

I know, but the LCL is not complete. Before I can use it for the form designer we need to implement more of the "hidden" functionality of the VCL and this depends on GTK primitives. I've been through all this, at covers createwnd, recreatewnd, wndproc etc.

I was on vacation for 2 weeks and having read over the archive I get the feeling that there is an impression that Lazarus and the LCL will be able to use ALL of the wonderful tools in places like Delphi Super Page. Well it will not.

Cob. It will run most of them with little change.

Most of these tools rely on the ability to inherit from an existing class say TButton for example. Then they override the Draw method to create a new button which maintains all of the original button features such as events.

No, very few override TButton, very few override the standard windows controls. BTW TButton is one of the least flexible of native windows controls.

Show quoted text 6 lines
This will not work with Lazarus. The reason is due to the fact that ALL and I mean ALL of the generation of the Button, how it looks, how it is drawn, how it reacts to events is found in and controled by the GTK library. If you want to create a new component like that you need to modify the GTK library. You can't do it from within Lazarus or the LCL.

Will the way in which we are going to handle paints, and owner draw is in discussion at the moment. Someone is finding out how to have a GTKCanvas that paints to screen.

We have to keep this separation so that we can support alternate API libraries. The minute you add that feature to GTK and us it in your program you remove the possibility of using other API's if they do not also have that same component.

Listen, if GTK doesn't allow setting and reading of the widget Z-order then its pretty kack anyway. That, and how .visible works are actually the only two points are am searching for at the moment.

So with that respect the core part of Lazarus and the LCL should never support more than the standard widgets found in all API's.

Which are so far unconsidered except win32 and GTK, but I am sure GTK allows setting the Z order, I need to work out how. No I'm not going to use it directly I was just going to implement it in TWinControl, as it wasn't the last time I looked.

That is the only way that the LCL can maintain cross platform and cross API ability.

If you want to make the LCL compatable with the so far unconsidered other API's we had better implement the hole LCL ourselves and only use the bitmap blitting of those API's, its the only way we can
a) inplement the VCL
b) to work on any API

Show quoted text 5 lines
Free Pascal, the FCL, Lazarus, and the LCL will be able to be used like Delphi and be able to port components that are non-visible but it will most likely NEVER be able to port a large portion of visible Delphi components unless they are also found in other widget sets like GTK and Qt.

Whatever; I disagree but there we go.

Is this concept clear to everyone???

No.

I hear what you say but it doesn't seem relevant.

**** I don't plan on introducing dependancy on GTK I plan on overcoming with GTK with dependancy we have on windows.

Delphi can set component z order, GTK can hopefully do it directly; if not I can implement it indirectly.
I need it.

It doesn't make sense that we are not going to implement half the delphi functionality in order not to be dependant on GTK.

Sam

Reply by email

Curtis White
to Shane Miller: So, can we get an update on everyone's progress on their projects? It's become silent…
On 31-Aug-99 Shane Miller wrote
So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

I have been really busy at work, so my time working on things has been really limited. But I am still working slowly on the TNotebook, TClipboard and TCheckbox components.

I am waiting on the TNotebook component because it doesn't seem to be working properly any more. I suspect this might be due to some of the changes that Michael has been working on with the gtkint cleanup. If I remember correctly, he hadn't converted the TNotebook code over to use the new methods. I didn't want to start changing it until Michael had a chance to finish the cleanup he was doing. Then I will start working on the TNotebook again. It recieves a bunch of GTK errors when it is initialized. As I understand it, the new version of GTK fixes some problems with the TNotebook widget, but I don't know exactly what yet. So I will probably check into that and see what was fixed.

I have hit a couple snags that I am trying to figure out with the TClipboard. Copying text to the clipboard isn't all that much trouble. But I can't find anything on how to copy other things, like images, sound files, etc. to the clipboard. I'm not sure it is even possible in Linux. Also, in Linux, normally you select text in one window and while it is still selected, you paste it into the other window. Basically, the two windows communicate with each other. But there is also actually a global clipboard mechanism that allows you to use it like the Windows clipboard. I'm not sure we are going to be able to support all the clipboard operations in Linux that are supported in the Delphi TClipboard. Should I make TClipboard support the Linux clipboard selection mechanism, or just the one that works like Windows? And if it supports the Linux way, then how should I do that? Any ideas?

I have started on the TCheckbox component, but haven't gotten very far with it. I fixed a couple problems with it, but not all of them. It still needs some work.

Curtis

Reply by email

Michael A. Hess
to Samuel Liddicott: I'm with you entirely on this Jeff; and IMHO it is worth lobbying the GTK folk to make…
Samuel Liddicott wrote 5 lines
I am also absolutely horrified to find that weird stretchy-scaling windows are the norm, and that a special widget has to be made to hold windows steady. Surely stretchy/steady should just be a property of the base container widget!

Why???

This is also the method used in Java as well.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

Actuallly, users WILL be able to create their own widgets once we add some drawing mechanism that they can use to draw their widget. They COULD write the entire thing in Pascal if they wished, just like you add something totally new in windows. If there isn't something that looks like you need, then you need to draw it. The drawing interface will need to be done before this is possible.

------------------------------------------------------------ Shane Miller

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Earlier message 44 lines
-----Original Message----- From: Jeffrey A. Wormsley To: Date: Tuesday, August 31, 1999 8:04 PM Subject: Re: [lazarus] Progress > >On 8/31/99, at 7:47 PM, Michael A. Hess wrote: > >>What I am trying to make everyone understand is that the LCL doesn't >>call any primitives to actually draw anything as far as components go. >>You might call some primitives to do some actual drawing within a GTK >>Drawing Widget but you can't CREATE or make an OwnerDrawn component when >>using GTK unless you create it in "C" and add it to the GTK library. >> >>I ask again. Is this clear??? > >Is this an absolute requirement? What I am saying, is that if the GTK >library, as it exists now in C, does not have what is desired, and if >someone is willing to go to the hellishly low levels of implementing it in >FPC, is there any reason not to? To make a ridiculous example... If there >were no button in GTK, would that mean that Lazarus could never have a >button? Or could someone implement a button widget in FPC, calling the >lower level GTK C functions, and make this part of the LCL so that a button >could exist in Lazarus, even though other GTK apps had no concept of one? >While I agree wholeheartedly that if it already exists, use it, I don't see >why we must abandon anything that isn't a part of every single platform, >when it can be created. What I am getting at is that, if a GTK developer >in C can create a new widget, why can't a Lazarus developer in FPC develop >one as well, if there isn't already a C version? Or is it better in your >opinion to develop the widget in C, have it made part of the GTK, then wrap >it into Lazarus? While this would indeed work, personally, it seems to >hold us at the mercy of each API that we support. In other words, Lazarus >can't have feature A until everyone else has feature A. Surely this can't >be your meaning? What have I missed? > >Jeff. > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Shane Miller

-----Original Message-----

Earlier message 72 lines
From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06 PM Subject: Re: [lazarus] Progress >Marc Weustink wrote: >> >> Why not ? > >For the reason I explained right after. > >> >The reason is due to the fact that ALL and I mean ALL of the >> >generation of the Button, how it looks, how it is drawn, how it >> >reacts to events is found in and controled by the GTK library. >> >> OK, but if you found a way to pass drawing to the canvas of the >> LCL-button to the widget-librar, then I cant see why it's wrong to >> inherit a LCL button and add your own stuff.\ > >Because you can't. All of the events that are generated by a component >are done IN the GTK library. The LCL does not generate any events for >any components, EVER. It only receives events that are passed to it from >the GTK lib that were generated by the GTK widget that was made by the >GTK library. The LCL is acting as a wrapper around the GTK library >widgets and the wrapper is being made to look like the same kind of >classes found in Delphi. However the LCL doesn't have any control over >the widgets themselves. They are made by the GTK lib. You can not >override the drawing of a GTK widget from within the LCL. That is part >of the C code within the GTK library. Actually, you can create new "events" for the components simply by using the DISPATCH method. For example, in my code I may need to detect a "move mouse right" event and a "move mouse left" event. So in my code I create a const LM_MOVEMOUSERIGHT = NUMBER; LM_MOVEMOUSELEFT = NUMBER +1; then in the mouse move event (that gtk sends) I track and detect if it is moving right or left. If moving_right then Dispatch(LM_MOVEMOUSERIGHT) else Dispatch(LM_MOVEMOUSELEFT); in the component, obvoiusly I will have a Procedure MoveRight(var msg); message LM_MOVEMOUSELEFT; etc. In that procedure I do a If Assigned(SomeProcedure) then Someprocedure(sender); So, to the user of that component it appears to have a movemouseleft and movemouseright event. This will not be easy for very complicated events, but that's how it's done. Think about it, if you create a component that extends itself off of TBUTTON and want to add events that aren't handled by default, you have to do a dispatch or call a procedure manually. ------------------------------------------------------------ Shane Miller Home page : http://www.lakefield.net/~smiller Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard Lazarus : http://www.miraclec.com/lazarus ----------------------------------------------------------

Reply by email

Marc Weustink
to Shane Miller: So, can we get an update on everyone's progress on their projects? It's become silent…
you wrote
So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

I'm documenting and further implementing the Imagelist. However, last thursday night lightning struck a tree in the front of my apartment. Computers (and videos) don't like that. So for now I'm just recovering and get all up and running again (e-mail works by now)

Marc

Reply by email

Michael A. Hess
to Shane Miller: Ttrue, however we this is exaclty the same for window. If it doesn't handle an event by…
Shane Miller wrote 7 lines
Ttrue, however we this is exaclty the same for window. If it doesn't handle an event by defualt you can't force it to. I remeber there's a widget that detects the mouse move, clicks, etc that is invisible and it's meant to be used to add this functionality to components that don't have it by defualt. We could look into adding that to all widgets that need it.

GTKEventBox

GTKMAIN wouldn't receive the info. The new/user defined events would be called and handled in the component, not in gtk.

So you are saying we would need to add an event manager to LCL?

Show quoted text 7 lines
Let's not get hung up too far on this. Let's get something that works and if we need to change something we will have a better idea how to do it once we get a larger base of WORKING code. Otherwise, we'll never end up with anything. Let's get all the components added that gtk handles, get an editor up and running, and get something that we can show.

I guess in a round about way that is what I have been trying to convey all along. I was trying to do it by explaining the problem involved but maybe I should just say "STOP IT", work on GTK. We have been drawn down in to discussions of WindProc, WinHandles, etc. etc. and it just doesn't need to be talked about or done at this time. We certainly aren't at the point to be talking the GTK people and telling them what they should be adding the GTK library.

So I agree let's just keep working on GTK and get something done.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Baeseman, Cliff: I am going to chime in here just a little. I am not opposed to the route we are taking…
Cliff wrote
If we wan't this type of functionality we need to program directly against XLib itself and not involve QT or GTK whatsoever.

This is more or less the message I was trying to impart. We can't easily get there from how we are currently designed.

I do believe from working with the GTK lib for some time that it is probably also the best solution.

Maybe trying to support every and any API is the real problem. I don't exactly thing that building to the XLib would be the best thing though. For example Gnome and KDE both have extensive DnD and Corba and Themes built into the widget set which we would have to reinvent if we coded directly to the XLib.

If I were to be giving advice to borland on how to do their port I would tell them to code directly against XLib and not even worry about GTK and QT.

No I think my advice would be to pick one API and stick withit, period.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Jeff Wormsley
to Shane Miller: So, can we get an update on everyone's progress on their projects? It's become silent…
Shane Miller wrote
So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

Win32 native is on hold, as I am very busy at work, and have little time at home (when I can even stand to see a computer). I should be able to resume work on it next week. I have a lot of fresh ideas to try out.

Jeff.

Reply by email

mariano podesta
to Shane Miller: -----Original Message----- From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06…
Exactly what do you think you could call to get the GTKMain event loop to recognize and send a callback for an event it wasn't designed to handle?

are you sure that GTK library does not dispatch standard messages like 'mouse move'?
because standard messages is all that windows do.
mariano

begin:vcard
n:podesta;mariano
x-mozilla-html:FALSE
org:;investigacion y desarrollo
adr:;;;buenos aires;;;argentina
version:2.1
email;
title:programador
note:informatica industrial y telecomunicaciones
fn:mariano podesta
end:vcard

Reply by email

Baeseman, Cliff

I am going to chime in here just a little. I am not opposed to the route we are taking at the moment but the simple fact is this. If we wan't this type of functionality we need to program directly against XLib itself and not involve QT or GTK whatsoever. I do believe from working with the GTK lib for some time that it is probably also the best solution. If I were to be giving advice to borland on how to do their port I would tell them to code directly against XLib and not even worry about GTK and QT. The stuff will all run inside these environments but you have to get that low in order to make the class library extensible to the point that it is in Delphi now. It may sound like a hard thing to do but I do believe it is harder to make GTK work than to program X directly.

Cliff

Earlier message 169 lines
-----Original Message----- From: Marc Weustink Sent: Wednesday, September 01, 1999 3:40 PM To: Subject: Re: [lazarus] Progress At 19:47 31-08-99 -0400, "Michael A. Hess" wrote: >Marc Weustink wrote: >> >> OK, but if you found a way to pass drawing to the canvas of the >> LCL-button to the widget-librar, then I cant see why it's wrong to >> inherit a LCL button and add your own stuff.\ > >Because you can't. All of the events that are generated by a component >are done IN the GTK library. The LCL does not generate any events for >any components, EVER. Thats clear since: >It only receives events that are passed to it from >the GTK lib that were generated by the GTK widget that was made by the >GTK library. The LCL is acting as a wrapper around the GTK library >widgets and the wrapper is being made to look like the same kind of >classes found in Delphi. However the LCL doesn't have any control over >the widgets themselves. They are made by the GTK lib. You can not >override the drawing of a GTK widget from within the LCL. That is part >of the C code within the GTK library. That maybe a lack of the GTK lib. If you want to be a good standin for Delhpi and not just another graphic pascal ide, an application developer should be able to create it's own components derived for a random class using solely Lazarus/LCL. When s/he also has to dive into the functionality of the used underlying lib, then why use you will end up with something like VB, where, if you want some extra functionality, you end up hacking API in stead of straight using the tool. >> If you have to do this in the lib's then youend up implementing one >> for every lib! > >Well it is done in the lib because that is were the GTK code is. Yes if >you want to create a new fancy component and want it to be used with >whatever API someone wants to use then you need to build it for EVERY >API. If you don't then you will be subjecting the user to only using the >API that you designed it for. There isn't anything we can do about that. > >> >If you want to create a new component like that you need to modify >> >the GTK library. You can't do it from within Lazarus or the LCL. >> > >> >We have to keep this separation so that we can support alternate API >> >libraries. The minute you add that feature to GTK and us it in your >> >program you remove the possibility of using other API's if they do >> >not also have that same component. >> >> Thats what I like about Lazarus. We shouls use core componets >> available in all API's or components based upon/constructed by these >> core components. If I see it correcvtly these should be in the LCL and >> not in the API-lib. > >Again you don't seem to understand how the APIs work. Maybe, maybe not. >Lazarus and the >LCL doesn't create ANYTHING. All components are created in the GTK lib. In my opinion, not necessary all. Yes, for a control at least TWincontrol should be created in the (interface) libs. From there every component could be created from it whithin the LCL. Then you're allmost complete platform independent. I know this is extreme, since you have to do it all your own. But being platform independed you sometimes have to. >There are no core components to create in the LCL. Everything is created >by the widget library. The LCL is acting as a standard wrapper to manage >the widgets no matter which API is used to create them. As I mentioned >earlier this wrapper is just being made to LOOK like the Delphi class >library but it doesn't actually do the work of the Delphi VCL. The Delphi VCL is sometimes just a wrapper itself. It is sometimes a wrapper, sometimes it implements components itself, because the windows functionality is to poor. >Here is a layout of the libs. when using GTK+ > > ------------------------------------------------------- > | Application | > ------------------------------------------------------- > | > | > ------------------------------------------------------- > | Lazarus/LCL | > ------------------------------------------------------- > | | | > | | | > | | --------- > | |----------------------------|------| GTK | > | | | --------- > | | | | > | | | | > | | -------------------- > | | |-----------------| GDK | > | | | -------------------- > | | | | > | | | | > ----------------------- -------------------- > | GLIB | | X Window | > ----------------------- -------------------- > As an application developer I would like to see this a bit more abstract ------------------------------------------------------- | Application | ------------------------------------------------------- | | ------------------------------------------------------- | Lazarus/LCL | ------------------------------------------------------- | | ------------------------------------------------------- | Some interface | ------------------------------------------------------- | | | V or V or V or ? ----------------- --------------- ----------------| |../GLIB/GTK/.. | | WIN32 | | some other lib| | | | | | I dont want to| | | | | | know about | ----------------- --------------- ----------------- I don't want to know what lib there is. If I want to use a LCL component and I don't like its face, I want to repaint it. I don't want to dig in the dirt (whatI've been doing to long ;-) >When using Gnome it gets even more complex because another layer which >is Gnome sites inbetween Lazarus and the GTK+ library. That a problem of the lib builder. Not for just somebdy using Lazarus. >What I am trying to make everyone understand is that the LCL doesn't >call any primitives to actually draw anything as far as components go. Thats clear. But it doesn't say that if we need the ability to draw something and the GTK libs doesn't support this, that we can't use it. What about platform independence. As long as the GTK-libs it will support we will implement the required functionality in LCL? It think this is THE way to get platform dependent! >You might call some primitives to do some actual drawing within a GTK >Drawing Widget but you can't CREATE or make an OwnerDrawn component when >using GTK unless you create it in "C" and add it to the GTK library. > >I ask again. Is this clear??? As I said before. If you want to keep (for instance) the ownerdraw out of the LCL simply because GTK does not support it (wich I ussume from earlier postings), I do. But, if you want to be platform independent and port Delphi since Borland won't, I'm completly lost. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Please post the code and I'll take a , ZIP the entire thing and send directly to

------------------------------------------------------------ Shane Miller

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Earlier message 26 lines
-----Original Message----- From: Peter Vreman To: Date: Wednesday, September 01, 1999 3:48 PM Subject: Re: [lazarus] Progress >> Let's get all the components added that gtk handles, get an editor up and >> running, and get something that we can show. >We can use the editor of Kassandra. I've already 'ported' the code so it >compiles with lazarus. But it doesn't work yet. It's a canvas redraw >problem i'm having. And with my delphi experience which doesn't reach >futher than implementing it in the compiler i need some other ppls who can > needed i can attach the code. > >Also a TScrollBox component is needed to get a fully workable editor. If >someone can help with these 2 probs i can take a look at adding debugger >stuff for the editor. > >Peter > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Jeffrey A. Wormsley
Michael A. Hess wrote 8 lines
If you think that you can make it do all of this well then great. We had this dicussion back in the beginning of the summer where we mulled over the possibility of writing directly to the XLIB or GDK. We all decided that it wasn't the way to go. Now all of a sudden everyone is talking about doing that again. If you go that way I feel that it will be extremely difficult to keep the indendence we have started with the InterfaceObject stuff. The only way to do it will most likely be to tie GTK or whatever API directly to the LCL.

It depends on what you are doing. If a feature exists in toolkit A and B, the Interface object can directly link to the toolkit. If it doesn't exist in toolkit C, then you may have to implement it in toolkit C, using toolkit C's way of doing that, then link that to the Interface object. If GTK has no method of overriding the paint or draw of ANY widgets, then it is indeed likely that this could never be done, which is what it seems you are saying below. If this is indeed the case, then if there is going to be platform independence, ie: write once, run anywhere code, then the LCL will indeed have to be written to the lowest common denominator, and I am afraid that may reduce greatly the intended audience of lazarus. "You can write code for all of these platforms! But... it is limited to simple, ugly apps with none of the best features of any platform." That doesn't make for good ad copy, IMHO.

Show quoted text 8 lines
Above you state that users will be able to create their own widgets. I don't deny can always access the GDK on their own or talk directly to the GTK if they wish. In this case though you are talking about creating NEW code using LCL. A large part of the recent discussion was based on using EXISTING Delphi code. This existing code is based on the premise that you can override things like the paint and draw for the parent component and draw it how you want. But API's like GTK don't work that way and that is what I am trying to point out.

To use a particularly ugly (IMO) example, a TAnimatedBitButton, a button with an animated GIF or some sort of self rotating imagelist for the glyph. With no override of the paint/draw, and no way to attach a timer to it, this could not be done with LCL (ie: modify the component code from VCL to LCL), but would have to be done in GTK native, Win32 native, QT native, etc. if it was to be used in a platform independent app. Or, if you are lucky, you can derive a new button type, in each API, that has the needed attributes, and then the VCL code that you had could be modified to use these button classes (actually, just one, from the App's point of view, the rest being hidden by Interfaces). In either case, it is unlikely to be the application writer that does this. If they do, they have shifted from being just an application writer to a lazarus developer as well. At least, we can hope they share that effort with the rest of us!

Show quoted text 5 lines
Code written brand new using Lazarus and the LCL can extend the base LCL features by linking directly to the GTK and GDK themselves if they so desire. But there will be alot of existing that Delphi code that will only be usuable AFTER it has been modified to meet the feature set of the LCL.

In some ways, this shows how despite its many limitations, it is a good thing that the VCL keeps a handle to the WindProc, and that it can be overriden so that ANY windows message in existence can be handled. Since GTK only implements messages that are specifice to the widget, and does not allow you to override the lowest level to add your own, it will make it very hard to do a lot of things common in Delphi (at the component writers level).

Jeff.

Reply by email

Stefan Hille
to Shane Miller: So, can we get an update on everyone's progress on their projects? It's become silent…

Hi!

Shane Miller wrote
So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

I'm currently implementing TTrackbar but I have a lot of work at the moment so I can't spend too much time on it. Think it'll be useable in about a week or two.

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Michael A. Hess
to Shane Miller: -----Original Message----- From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06…
Shane Miller wrote 27 lines
Actually, you can create new "events" for the components simply by using the DISPATCH method. For example, in my code I may need to detect a "move mouse right" event and a "move mouse left" event. So in my code I create a const LM_MOVEMOUSERIGHT = NUMBER; LM_MOVEMOUSELEFT = NUMBER +1; then in the mouse move event (that gtk sends) I track and detect if it is moving right or left. If moving_right then Dispatch(LM_MOVEMOUSERIGHT) else Dispatch(LM_MOVEMOUSELEFT); in the component, obvoiusly I will have a Procedure MoveRight(var msg); message LM_MOVEMOUSELEFT; etc. In that procedure I do a If Assigned(SomeProcedure) then Someprocedure(sender); So, to the user of that component it appears to have a movemouseleft and movemouseright event. This will not be easy for very complicated events, but that's how it's done.

But this works if and only if the current component fires a callback for a mousemove event. If the component doesn't support that then there is no way to add the mousemove event to the GTK component. That is the point I am trying to make everyone understand. If the event isn't already supported by the component (and I am not talking about the user designed event like above) which will deliver a callback then you can't add the event. The only way to add it would be to modify the "C" code in the GTK library.

Think about it, if you create a component that extends itself off of TBUTTON and want to add events that aren't handled by default, you have to do a dispatch or call a procedure manually.

Exactly what do you think you could call to get the GTKMain event loop to recognize and send a callback for an event it wasn't designed to handle?

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

-----Original Message-----

Earlier message 92 lines
From: Curtis White To: Date: Tuesday, August 31, 1999 6:10 PM Subject: RE: [lazarus] Progress > >On 31-Aug-99 Shane Miller wrote: >> So, can we get an update on everyone's progress on their projects? It's >> become silent here and I want to make sure that progress is being made. >> > >I have been really busy at work, so my time working on things has been really >limited. But I am still working slowly on the TNotebook, TClipboard and >TCheckbox components. > >I am waiting on the TNotebook component because it doesn't seem to be working >properly any more. I suspect this might be due to some of the changes that >Michael has been working on with the gtkint cleanup. If I remember correctly, he >hadn't converted the TNotebook code over to use the new methods. I didn't want >to start changing it until Michael had a chance to finish the cleanup he was >doing. Then I will start working on the TNotebook again. It recieves a bunch of >GTK errors when it is initialized. As I understand it, the new version of GTK >fixes some problems with the TNotebook widget, but I don't know exactly what >yet. So I will probably check into that and see what was fixed. > >I have hit a couple snags that I am trying to figure out with the TClipboard. >Copying text to the clipboard isn't all that much trouble. But I can't find >anything on how to copy other things, like images, sound files, etc. to the >clipboard. I'm not sure it is even possible in Linux. Also, in Linux, normally >you select text in one window and while it is still selected, you paste it into >the other window. Basically, the two windows communicate with each other. But >there is also actually a global clipboard mechanism that allows you to use it >like the Windows clipboard. I'm not sure we are going to be able to support all >the clipboard operations in Linux that are supported in the Delphi TClipboard. >Should I make TClipboard support the Linux clipboard selection mechanism, or >just the one that works like Windows? And if it supports the Linux way, then how >should I do that? Any ideas? Create the clipboard like it works in Windows. We can always exttend it later, but personally I like to be able to Copy something, close the window and paste it somewhere else. We can create a method for using the "extended" copy/paste feature later. Just work on TEXT for now. You get that working and we'll be better off. Then we can move forward and get the other copy/paste functions working. > >I have started on the TCheckbox component, but haven't gotten very far with it. >I fixed a couple problems with it, but not all of them. It still needs some >work. > > >Curtis > >_________________________________________________________________ Keep up the good work Curtis. Just keep plugging away in your spare time and let us know if you need anything. ------------------------------------------------------------ Shane Miller Home page : http://www.lakefield.net/~smiller Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard Lazarus : http://www.pcpros.net/~vbman ----------------------------------------------------------

Reply by email

Jeffrey A. Wormsley
Michael A. Hess wrote 7 lines
Baeseman, Cliff wrote: > > If we wan't this type of functionality we need to program directly > against XLib itself and not involve QT or GTK whatsoever. This is more or less the message I was trying to impart. We can't easily get there from how we are currently designed.

As was previously stated, this is far too time consuming, and reproduces a lot of work.

Show quoted text 5 lines
Maybe trying to support every and any API is the real problem. I don't exactly thing that building to the XLib would be the best thing though. For example Gnome and KDE both have extensive DnD and Corba and Themes built into the widget set which we would have to reinvent if we coded directly to the XLib.

With GTK under linux, you can statically link to just about anything, and hence program at the same level as a C coder would. Under Win32, you have to go through the DLL's and are at the mercy of what is exported. This was why I wanted to work on Win32 native. It is indeed possible to make Win32 native emulate GTK. In one sense, that is useless work, as it has already been done in the DLL's. In another, it does mean faster code with no required DLL's (like those &^*&#* VBRUNxxx.DLL things from VB). I can keep this up, and ignore any possibility of going beyond GTK's functionality, and probably save myself a lot of headaches.

Jeff.

Reply by email

Marc Weustink
to Shane Miller: Ttrue, however we this is exaclty the same for window. If it doesn't handle an event by…
"Michael A. Hess" wrote 13 lines
Shane Miller wrote: > Let's not get hung up too far on this. Let's get something that works > and if we need to change something we will have a better idea how to > do it once we get a larger base of WORKING code. Otherwise, we'll > never end up with anything. > > Let's get all the components added that gtk handles, get an editor up > and running, and get something that we can show. I guess in a round about way that is what I have been trying to convey all along. I was trying to do it by explaining the problem involved but maybe I should just say "STOP IT", work on GTK.

Thats a point, get something visible.

We have been drawn down in to discussions of WindProc, WinHandles, etc. etc. and it just doesn't need to be talked about or done at this time.

While implementing components you run into this. If you just go on and implement things just the way they work in GTK, then you end up with loads of work when you want to use another lib. I think somewhat discussion about how things to do will simplify future work. It is easier to use some alternatives now, than to fix it later.
However sometimes you could go to far! And maybe this is in some of my postings, I look at Lazarus as I look at a tool which helps me develop applications. And I hope it will at some stage (From a GUI-developer point of view, you don't want to know whats under the hood). But, for now, let's make something....

Show quoted text 5 lines
We certainly aren't at the point to be talking the GTK people and telling them what they should be adding the GTK library. So I agree let's just keep working on GTK and get something done.

Marc

Reply by email

Shane Miller
Show quoted text 39 lines
Shane Miller wrote: > > Actually, you can create new "events" for the components simply by > using the DISPATCH method. For example, in my code I may need to > detect a "move mouse right" event and a "move mouse left" event. So > in my code I create a const > > LM_MOVEMOUSERIGHT = NUMBER; > LM_MOVEMOUSELEFT = NUMBER +1; > > then in the mouse move event (that gtk sends) I track and detect if it > is moving right or left. > If moving_right then > Dispatch(LM_MOVEMOUSERIGHT) > else > Dispatch(LM_MOVEMOUSELEFT); > > in the component, obvoiusly I will have a > Procedure MoveRight(var msg); message LM_MOVEMOUSELEFT; > etc. > In that procedure I do a > If Assigned(SomeProcedure) then > Someprocedure(sender); > > So, to the user of that component it appears to have a movemouseleft > and movemouseright event. > This will not be easy for very complicated events, but that's how it's > done. But this works if and only if the current component fires a callback for a mousemove event. If the component doesn't support that then there is no way to add the mousemove event to the GTK component. That is the point I am trying to make everyone understand. If the event isn't already supported by the component (and I am not talking about the user designed event like above) which will deliver a callback then you can't add the event. The only way to add it would be to modify the "C" code in the GTK library.

Ttrue, however we this is exaclty the same for window. If it doesn't handle an event by defualt you can't force it to. I remeber there's a widget that detects the mouse move, clicks, etc that is invisible and it's meant to be used to add this functionality to components that don't have it by defualt. We could look into adding that to all widgets that need it.

Show quoted text 8 lines
> Think about it, if you create a component that extends itself off of > TBUTTON and want to add events that aren't handled by default, you > have to do a dispatch or call a procedure manually. Exactly what do you think you could call to get the GTKMain event loop to recognize and send a callback for an event it wasn't designed to handle?

GTKMAIN wouldn't receive the info. The new/user defined events would be called and handled in the component, not in gtk.

Let's not get hung up too far on this. Let's get something that works and if we need to change something we will have a better idea how to do it once we get a larger base of WORKING code. Otherwise, we'll never end up with anything.

Let's get all the components added that gtk handles, get an editor up and running, and get something that we can show.

Shane

Reply by email

Samuel Liddicott
to Michael A. Hess: For the reason I explained right after. Because you can't. All of the events that are…
Show quoted text 24 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, September 01, 1999 12:48 AM To: Subject: Re: [lazarus] Progress Marc Weustink wrote: > > Why not ? For the reason I explained right after. > >The reason is due to the fact that ALL and I mean ALL of the > >generation of the Button, how it looks, how it is drawn, how it > >reacts to events is found in and controled by the GTK library. > > OK, but if you found a way to pass drawing to the canvas of the > LCL-button to the widget-librar, then I cant see why it's wrong to > inherit a LCL button and add your own stuff.\ Because you can't. All of the events that are generated by a component are done IN the GTK library. The LCL does not generate any events for any components, EVER.

Why not? Delphi does, and often. The API and Delphi both generate messages which are handled by the wndproc and then the message handlers. What do you think all the CM_ messages are?

Show quoted text 6 lines
It only receives events that are passed to it from the GTK lib that were generated by the GTK widget that was made by the GTK library. The LCL is acting as a wrapper around the GTK library widgets and the wrapper is being made to look like the same kind of classes found in Delphi. However the LCL doesn't have any control over the widgets themselves. They are made by the GTK lib.

This is exactly the same situation with delphi and windows

You can not override the drawing of a GTK widget from within the LCL. That is part of the C code within the GTK library.

Then, we are scuppered from the start. But I don't actually believe this.

Show quoted text 7 lines
> If you have to do this in the lib's then youend up implementing one > for every lib! Well it is done in the lib because that is were the GTK code is. Yes if you want to create a new fancy component and want it to be used with whatever API someone wants to use then you need to build it for EVERY API.

No, you just need to implement TControlCanvas different for every API, which we expected anyway.

If you don't then you will be subjecting the user to only using the API that you designed it for. There isn't anything we can do about that.

TControlCanvas and API:LCL message abstraction, and some limited LCL:API abstraction (move widget, hide widget, change parent etc) will manage it all. Then as long as the developer sticks to the delphi VCL methods it will work fine with the LCL. Thats why I DO need to modify the LCL slightly, so the final developer doesn't have to do it every time.

Show quoted text 7 lines
> Thats what I like about Lazarus. We shouls use core componets > available in all API's or components based upon/constructed by these > core components. If I see it correcvtly these should be in the LCL and > not in the API-lib. Again you don't seem to understand how the APIs work. Lazarus and the LCL doesn't create ANYTHING. All components are created in the GTK lib.

With delphi, they are all created by windows.

There are no core components to create in the LCL.

There will be, or we are scuppered. Most of the "extra" delphi components are based on a TWinControl with custom painting. If GTK won't allow this, it will die shortly anyway.

Everything is created by the widget library. The LCL is acting as a standard wrapper to manage the widgets no matter which API is used to create them.

Sam as windows.

As I mentioned earlier this wrapper is just being made to LOOK like the Delphi class library

which is what I need to complete

but it doesn't actually do the work of the Delphi VCL.

err... it does actually, pretty much, and will even more by the time I have finished with it.

It was mentioned in the first post about "waiting to find out about GTK primitives". There are NO GTK primitives. GTK is the widget library that creates components in windows with events. The GTK widget library is built ontop of the GDK Graphics Library.

OK, primitives was the wrong word, I should have said "basic operations on widgets" then.

Show quoted text 34 lines
Here is a layout of the libs. when using GTK+ ------------------------------------------------------- | Application | ------------------------------------------------------- | | ------------------------------------------------------- | Lazarus/LCL | ------------------------------------------------------- | | | | | | | | --------- | |----------------------------|------| GTK | | | | --------- | | | | | | | | | | -------------------- | | |-----------------| GDK | | | | -------------------- | | | | | | | | ----------------------- -------------------- | GLIB | | X Window | ----------------------- -------------------- When using Gnome it gets even more complex because another layer which is Gnome sites inbetween Lazarus and the GTK+ library. What I am trying to make everyone understand is that the LCL doesn't call any primitives to actually draw anything as far as components go. You might call some primitives to do some actual drawing within a GTK Drawing Widget

wow. Sounds like TControlCanvas will work then.

but you can't CREATE or make an OwnerDrawn component when using GTK unless you create it in "C" and add it to the GTK library.

Well maybe we need to implement it by insering a GTK Drawing Widget into the widget then.

I ask again. Is this clear???

This is, but having heard you I don't see what it changes.

Sam

Reply by email

Jeffrey A. Wormsley
Michael A. Hess wrote 8 lines
But this works if and only if the current component fires a callback for a mousemove event. If the component doesn't support that then there is no way to add the mousemove event to the GTK component. That is the point I am trying to make everyone understand. If the event isn't already supported by the component (and I am not talking about the user designed event like above) which will deliver a callback then you can't add the event. The only way to add it would be to modify the "C" code in the GTK library.

I think that we are all, in a sense saying much the same thing, only you do not want to go to the level that others want to go. It is clear that you can't add things to a GTK component at the LCL level. There are really two questions.

First, what do you do when you want something that is not a part of GTK, and can't be created by combinations of existing GTK components? Possible answers are:

1. Do without. That feature cannot and will not exist.
2. Go into the GTK code, create a new component in C with the desired behavior based on the original one, submit it to the GTK team, and if/when it becomes part of the GTK libraries, use it.
3. Go into the GTK code, translate the high level C into Pascal, build the widget as desired in lazarus code, calling low level GTK code (if that is even possible without static linking).
4. Create a new equivalent component from scratch in Pascal, possibly translating large portions of GTK code or making a low level X version for linux (which means it would still work in any window toolkit, but may lack look and feel), and a low level WinAPI version for Windows, and a ??? for ???.

Second, who is the audience of the above question? By that I mean, are we talking about application developers or lazarus developers.

An application developer won't be likely to ever attempt 2 - 4.

A lazarus developer might be willing to try one or more of these avenues. Not knowing enough about the GTK team to be sure, but it seems that they would be more than willing to have new components added to their collection. Chapter 15 of "Developing Linux Applications with GTK+ and GDK" covers creating your own widgets, likewise section 22 of the GTK v1.2 Tutorial. If we want the LCL to be as complete as possible, it may be up to us to fill in some of the deficiencies of some of the API's. Sure, it would be stupid to recreate from scratch something that already exists. But it may be, from time to time, some of us may be willing to step outside of lazarus to make sure lazarus is as useful as possible. There will also be times that this is more trouble that it is worth. For instance, I really doubt anyone would want to add DirectX or RingZeroGDK to linux!

Show quoted text 7 lines
> Think about it, if you create a component that extends itself off of > TBUTTON and want to add events that aren't handled by default, you > have to do a dispatch or call a procedure manually. Exactly what do you think you could call to get the GTKMain event loop to recognize and send a callback for an event it wasn't designed to handle?

Reply by email

Samuel Liddicott
to Shane Miller: So, can we get an update on everyone's progress on their projects? It's become silent…
Show quoted text 9 lines
-----Original Message----- From: Shane Miller Sent: Tuesday, August 31, 1999 05:11 AM To: Subject: [lazarus] Progress So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

Form designer waits on more complete (internally) VCL implementation which I am also working on.
More complete VCL internals await knowledge of more GTK primitive operations which I am studying.

Sam

Reply by email

Peter Vreman
to Shane Miller: Ttrue, however we this is exaclty the same for window. If it doesn't handle an event by…
Let's get all the components added that gtk handles, get an editor up and running, and get something that we can show.

We can use the editor of Kassandra. I've already 'ported' the code so it compiles with lazarus. But it doesn't work yet. It's a canvas redraw problem i'm having. And with my delphi experience which doesn't reach futher than implementing it in the compiler i need some other ppls who can needed i can attach the code.

Also a TScrollBox component is needed to get a fully workable editor. If someone can help with these 2 probs i can take a look at adding debugger stuff for the editor.

Peter

Reply by email

Marc Weustink
to Samuel Liddicott: Form designer waits on more complete (internally) VCL implementation which I am also…
you wrote 5 lines
On Tue, 31 Aug 1999, Samuel Liddicott wrote: > Form designer waits on more complete (internally) VCL implementation

which I

> am also working on. > More complete VCL internals await knowledge of more GTK primitive

operations

Show quoted text 15 lines
> which I am studying. I am concerned over this statement. Exactly what GTK primitives are you talking about? You should not be dealing with GTK whole idea of the LCL and Lazarus is to remove the requirement of using the primitives. This is something that is handled in and by the widget set library. I was on vacation for 2 weeks and having read over the archive I get the feeling that there is an impression that Lazarus and the LCL will be able to use ALL of the wonderful tools in places like Delphi Super Page. Well it will not. Most of these tools rely on the ability to inherit from an existing class say TButton for example. Then they override the Draw method to create a new button which maintains all of the original button features such as events. This will not work with Lazarus.

Why not ?

The reason is due to the fact that ALL and I mean ALL of the generation of the Button, how it looks, how it is drawn, how it reacts to events is found in and controled by the GTK library.

OK, but if you found a way to pass drawing to the canvas of the LCL-button to the widget-librar, then I cant see why it's wrong to inherit a LCL button and add your own stuff. If you have to do this in the lib's then youend up implementing one for every lib!

Show quoted text 8 lines
If you want to create a new component like that you need to modify the GTK library. You can't do it from within Lazarus or the LCL. We have to keep this separation so that we can support alternate API libraries. The minute you add that feature to GTK and us it in your program you remove the possibility of using other API's if they do not also have that same component.

Thats what I like about Lazarus. We shouls use core componets available in all API's or components based upon/constructed by these core components. If I see it correcvtly these should be in the LCL and not in the API-lib.

Show quoted text 10 lines
So with that respect the core part of Lazarus and the LCL should never support more than the standard widgets found in all API's. That is the only way that the LCL can maintain cross platform and cross API ability. Free Pascal, the FCL, Lazarus, and the LCL will be able to be used like Delphi and be able to port components that are non-visible but it will most likely NEVER be able to port a large portion of visible Delphi components unless they are also found in other widget sets like GTK and Qt.

If these visual components neatly use the core components and no ugly windows hacks I still see no problem.

Is this concept clear to everyone???

I hope (but am not sure).

Marc

Reply by email

Michael A. Hess
to Jeffrey A. Wormsley: Is this an absolute requirement? What I am saying, is that if the GTK library, as it…
Jeffrey A. Wormsley wrote 5 lines
Is this an absolute requirement? What I am saying, is that if the GTK library, as it exists now in C, does not have what is desired, and if someone is willing to go to the hellishly low levels of implementing it in FPC, is there any reason not to?

Sure they can in their application. They can link directly and efficiently to whatever library they so desire. They can talk directly to X Windows if they wish. Should this be in the LCL? I don't think so. If we intended on writting the LCL to work with just GTK and only GTK we would for one be further along then we are and we could get as ugly and hellishly low level as we wanted. However there are some people who do not and will never use GTK. They want to use Qt. They want to write it using Gnome. That is why I say we just stick to the basic components and let the user get as messy with it after that as they wish.

<snip>

Or is it better in your opinion to develop the widget in C, have it made part of the GTK, then wrap it into Lazarus?

Yes this is exactly what I think should be done. Should the Lazarus and LCL team do it? No. Can the application developer do it? Sure.

While this would indeed work, personally, it seems to hold us at the mercy of each API that we support. In other words, Lazarus can't have feature A until everyone else has feature A. Surely this can't be your meaning? What have I missed?

You are already considering yourself at the mercy of the API. That is why I feel that the LCL should only support the base set of components found on just about every API. This way if someone builds code with just the native LCL code they can use any API they wish. If they wish to extend the capability of the API they are using, great, let them. If we try to write the LCL so that any extended component can be used with any API we will pull our hair out.

As it is with the currently movement the LCL development has come to a halt. We had decided months ago that the initial LCL would support and be written for GTK. When that worked then and only then would we begin to work on supporting other API's. We need to stop trying to support GTK, Windows, Qt and whatever else before we have even managed to support one. Attempts are being made to be able to support extended components in various API's and we haven't even finished with the coding to support the basic ones yet.

Can't we just work on supporting the base components first???

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Jeffrey A. Wormsley: Is this an absolute requirement? What I am saying, is that if the GTK library, as it…

I'm with you entirely on this Jeff; and IMHO it is worth lobbying the GTK folk to make all components support owner draw.

I am also absolutely horrified to find that weird stretchy-scaling windows are the norm, and that a special widget has to be made to hold windows steady. Surely stretchy/steady should just be a property of the base container widget!

I will join the GTK list and see what can be done there.

Sam

Show quoted text 35 lines
-----Original Message----- From: Jeffrey A. Wormsley Sent: Wednesday, September 01, 1999 03:55 AM To: Subject: Re: [lazarus] Progress Is this an absolute requirement? What I am saying, is that if the GTK library, as it exists now in C, does not have what is desired, and if someone is willing to go to the hellishly low levels of implementing it in FPC, is there any reason not to? To make a ridiculous example... If there were no button in GTK, would that mean that Lazarus could never have a button? Or could someone implement a button widget in FPC, calling the lower level GTK C functions, and make this part of the LCL so that a button could exist in Lazarus, even though other GTK apps had no concept of one? While I agree wholeheartedly that if it already exists, use it, I don't see why we must abandon anything that isn't a part of every single platform, when it can be created. What I am getting at is that, if a GTK developer in C can create a new widget, why can't a Lazarus developer in FPC develop one as well, if there isn't already a C version? Or is it better in your opinion to develop the widget in C, have it made part of the GTK, then wrap it into Lazarus? While this would indeed work, personally, it seems to hold us at the mercy of each API that we support. In other words, Lazarus can't have feature A until everyone else has feature A. Surely this can't be your meaning? What have I missed? Jeff. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Jeffrey A. Wormsley
Michael A. Hess wrote 7 lines
What I am trying to make everyone understand is that the LCL doesn't call any primitives to actually draw anything as far as components go. You might call some primitives to do some actual drawing within a GTK Drawing Widget but you can't CREATE or make an OwnerDrawn component when using GTK unless you create it in "C" and add it to the GTK library. I ask again. Is this clear???

Is this an absolute requirement? What I am saying, is that if the GTK library, as it exists now in C, does not have what is desired, and if someone is willing to go to the hellishly low levels of implementing it in FPC, is there any reason not to? To make a ridiculous example... If there were no button in GTK, would that mean that Lazarus could never have a button? Or could someone implement a button widget in FPC, calling the lower level GTK C functions, and make this part of the LCL so that a button could exist in Lazarus, even though other GTK apps had no concept of one? While I agree wholeheartedly that if it already exists, use it, I don't see why we must abandon anything that isn't a part of every single platform, when it can be created. What I am getting at is that, if a GTK developer in C can create a new widget, why can't a Lazarus developer in FPC develop one as well, if there isn't already a C version? Or is it better in your opinion to develop the widget in C, have it made part of the GTK, then wrap it into Lazarus? While this would indeed work, personally, it seems to hold us at the mercy of each API that we support. In other words, Lazarus can't have feature A until everyone else has feature A. Surely this can't be your meaning? What have I missed?

Jeff.

Reply by email

Michael A. Hess
to Samuel Liddicott: Form designer waits on more complete (internally) VCL implementation which I am also…
Marc Weustink wrote
Why not ?

For the reason I explained right after.

Show quoted text 7 lines
>The reason is due to the fact that ALL and I mean ALL of the >generation of the Button, how it looks, how it is drawn, how it >reacts to events is found in and controled by the GTK library. OK, but if you found a way to pass drawing to the canvas of the LCL-button to the widget-librar, then I cant see why it's wrong to inherit a LCL button and add your own stuff.\

Because you can't. All of the events that are generated by a component are done IN the GTK library. The LCL does not generate any events for any components, EVER. It only receives events that are passed to it from the GTK lib that were generated by the GTK widget that was made by the GTK library. The LCL is acting as a wrapper around the GTK library widgets and the wrapper is being made to look like the same kind of classes found in Delphi. However the LCL doesn't have any control over the widgets themselves. They are made by the GTK lib. You can not override the drawing of a GTK widget from within the LCL. That is part of the C code within the GTK library.

If you have to do this in the lib's then youend up implementing one for every lib!

Well it is done in the lib because that is were the GTK code is. Yes if you want to create a new fancy component and want it to be used with whatever API someone wants to use then you need to build it for EVERY API. If you don't then you will be subjecting the user to only using the API that you designed it for. There isn't anything we can do about that.

Show quoted text 12 lines
>If you want to create a new component like that you need to modify >the GTK library. You can't do it from within Lazarus or the LCL. > >We have to keep this separation so that we can support alternate API >libraries. The minute you add that feature to GTK and us it in your >program you remove the possibility of using other API's if they do >not also have that same component. Thats what I like about Lazarus. We shouls use core componets available in all API's or components based upon/constructed by these core components. If I see it correcvtly these should be in the LCL and not in the API-lib.

Again you don't seem to understand how the APIs work. Lazarus and the LCL doesn't create ANYTHING. All components are created in the GTK lib. There are no core components to create in the LCL. Everything is created by the widget library. The LCL is acting as a standard wrapper to manage the widgets no matter which API is used to create them. As I mentioned earlier this wrapper is just being made to LOOK like the Delphi class library but it doesn't actually do the work of the Delphi VCL.

It was mentioned in the first post about "waiting to find out about GTK primitives". There are NO GTK primitives. GTK is the widget library that creates components in windows with events. The GTK widget library is built ontop of the GDK Graphics Library.

Here is a layout of the libs. when using GTK+

------------------------------------------------------- | Application | ------------------------------------------------------- |
|
------------------------------------------------------- | Lazarus/LCL | ------------------------------------------------------- | | |
| | |
| | --------- | |----------------------------|------| GTK | | | | --------- | | | |
| | | |
| | -------------------- | | |-----------------| GDK | | | | -------------------- | | | |
| | | |
----------------------- -------------------- | GLIB | | X Window | ----------------------- --------------------

When using Gnome it gets even more complex because another layer which is Gnome sites inbetween Lazarus and the GTK+ library.

What I am trying to make everyone understand is that the LCL doesn't call any primitives to actually draw anything as far as components go. You might call some primitives to do some actual drawing within a GTK Drawing Widget but you can't CREATE or make an OwnerDrawn component when using GTK unless you create it in "C" and add it to the GTK library.

I ask again. Is this clear???

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Shane Miller

So, can we get an update on everyone's progress on their projects? It's become silent here and I want to make sure that progress is being made.

I am working on the editor and am having trouble with the arrow keys causing the editor to crash. Not sure why yet but I will figure it out. I am also trying to xor a few pixels on the widget to create the illusion of a cursor, but I don't know how to get the pixel color. I see there's a function called gdk_image_get_pixel that returns a guint32 but what is it returning? Not a gtk color. Is it a delphi-like color representation? Also, when I use it, it's VERY slow. Not sure what to do about it yet.

Thanks

------------------------------------------------------------ Shane Miller

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.pcpros.net/~vbman
----------------------------------------------------------

Earlier message 63 lines
-----Original Message----- From: Shane Miller To: Date: Wednesday, August 25, 1999 6:33 PM Subject: Re: [lazarus] Internal compiler error >You constantly get that error when compiling many >recompile again and because some don't need to be updated, less will be >compiled and it'll get further. >------------------------------------------------------------ >Shane Miller > >Home page : http://www.lakefield.net/~smiller > >Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip > >Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard > >Lazarus : http://www.pcpros.net/~vbman >---------------------------------------------------------- >-----Original Message----- >From: Marc Weustink >To: >Date: Wednesday, August 25, 1999 3:01 PM >Subject: [lazarus] Internal compiler error > > >>Hi, >>I just found the $FPCDIR/ide/text tree in the sources and was a bit >>courious what it does. However it needs the file >>$FPCDIR/compiler/browcol.pas, which needs to be compiled :-) >>This results in: >> >>marc:~/lazarus/compiler$ ppc386 browcol.pas >>Target OS: Linux for i386 >>Compiling browcol.pas >>Compiling files.pas >>Compiling symtable.pas >>Compiling tree.pas >>Panic : Internal compiler error, exiting. >>tree.pas(765,20) Fatal: Internal error 9999 >>marc:~/lazarus/compiler$ >> >>Seems not ok. However I compiled the compiler successfull and there is a >>tree.o and a tree.ppu >> >>Anyone a clue >> >>Marc >> >> >>_________________________________________________________________ >> To unsubscribe: mail with >> "unsubscribe" as the Subject >> archives at http://www.miraclec.com/list_archives/lazarus >> > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Marc Weustink
to Samuel Liddicott: Form designer waits on more complete (internally) VCL implementation which I am also…
"Michael A. Hess" wrote 9 lines
Marc Weustink wrote: > > OK, but if you found a way to pass drawing to the canvas of the > LCL-button to the widget-librar, then I cant see why it's wrong to > inherit a LCL button and add your own stuff.\ Because you can't. All of the events that are generated by a component are done IN the GTK library. The LCL does not generate any events for any components, EVER.

Thats clear since:

Show quoted text 8 lines
It only receives events that are passed to it from the GTK lib that were generated by the GTK widget that was made by the GTK library. The LCL is acting as a wrapper around the GTK library widgets and the wrapper is being made to look like the same kind of classes found in Delphi. However the LCL doesn't have any control over the widgets themselves. They are made by the GTK lib. You can not override the drawing of a GTK widget from within the LCL. That is part of the C code within the GTK library.

That maybe a lack of the GTK lib. If you want to be a good standin for Delhpi and not just another graphic pascal ide, an application developer should be able to create it's own components derived for a random class using solely Lazarus/LCL. When s/he also has to dive into the functionality of the used underlying lib, then why use you will end up with something like VB, where, if you want some extra functionality, you end up hacking API in stead of straight using the tool.

Show quoted text 23 lines
> If you have to do this in the lib's then youend up implementing one > for every lib! Well it is done in the lib because that is were the GTK code is. Yes if you want to create a new fancy component and want it to be used with whatever API someone wants to use then you need to build it for EVERY API. If you don't then you will be subjecting the user to only using the API that you designed it for. There isn't anything we can do about that. > >If you want to create a new component like that you need to modify > >the GTK library. You can't do it from within Lazarus or the LCL. > > > >We have to keep this separation so that we can support alternate API > >libraries. The minute you add that feature to GTK and us it in your > >program you remove the possibility of using other API's if they do > >not also have that same component. > > Thats what I like about Lazarus. We shouls use core componets > available in all API's or components based upon/constructed by these > core components. If I see it correcvtly these should be in the LCL and > not in the API-lib. Again you don't seem to understand how the APIs work.

Maybe, maybe not.

Lazarus and the LCL doesn't create ANYTHING. All components are created in the GTK lib.

In my opinion, not necessary all.
Yes, for a control at least TWincontrol should be created in the (interface) libs. From there every component could be created from it whithin the LCL. Then you're allmost complete platform independent. I know this is extreme, since you have to do it all your own. But being platform independed you sometimes have to.

Show quoted text 5 lines
There are no core components to create in the LCL. Everything is created by the widget library. The LCL is acting as a standard wrapper to manage the widgets no matter which API is used to create them. As I mentioned earlier this wrapper is just being made to LOOK like the Delphi class library but it doesn't actually do the work of the Delphi VCL.

The Delphi VCL is sometimes just a wrapper itself. It is sometimes a wrapper, sometimes it implements components itself, because the windows functionality is to poor.

Show quoted text 26 lines
Here is a layout of the libs. when using GTK+ ------------------------------------------------------- | Application | ------------------------------------------------------- | | ------------------------------------------------------- | Lazarus/LCL | ------------------------------------------------------- | | | | | | | | --------- | |----------------------------|------| GTK | | | | --------- | | | | | | | | | | -------------------- | | |-----------------| GDK | | | | -------------------- | | | | | | | | ----------------------- -------------------- | GLIB | | X Window | ----------------------- --------------------

As an application developer I would like to see this a bit more abstract

------------------------------------------------------- | Application | ------------------------------------------------------- |
|
------------------------------------------------------- | Lazarus/LCL | ------------------------------------------------------- |
|
------------------------------------------------------- | Some interface | ------------------------------------------------------- | | |
V or V or V or ? ----------------- --------------- ----------------| |../GLIB/GTK/.. | | WIN32 | | some other lib| | | | | | I dont want to| | | | | | know about | ----------------- --------------- -----------------

I don't want to know what lib there is. If I want to use a LCL component and I don't like its face, I want to repaint it. I don't want to dig in the dirt (whatI've been doing to long ;-)

When using Gnome it gets even more complex because another layer which is Gnome sites inbetween Lazarus and the GTK+ library.

That a problem of the lib builder. Not for just somebdy using Lazarus.

What I am trying to make everyone understand is that the LCL doesn't call any primitives to actually draw anything as far as components go.

Thats clear. But it doesn't say that if we need the ability to draw something and the GTK libs doesn't support this, that we can't use it. What about platform independence. As long as the GTK-libs it will support we will implement the required functionality in LCL? It think this is THE way to get platform dependent!

Show quoted text 5 lines
You might call some primitives to do some actual drawing within a GTK Drawing Widget but you can't CREATE or make an OwnerDrawn component when using GTK unless you create it in "C" and add it to the GTK library. I ask again. Is this clear???

As I said before. If you want to keep (for instance) the ownerdraw out of the LCL simply because GTK does not support it (wich I ussume from earlier postings), I do. But, if you want to be platform independent and port Delphi since Borland won't, I'm completly lost.

Marc

Reply by email

Michael A. Hess
to Shane Miller: Actuallly, users WILL be able to create their own widgets once we add some drawing…
Shane Miller wrote 7 lines
Actuallly, users WILL be able to create their own widgets once we add some drawing mechanism that they can use to draw their widget. They COULD write the entire thing in Pascal if they wished, just like you add something totally new in windows. If there isn't something that looks like you need, then you need to draw it. The drawing interface will need to be done before this is possible.

How do you plan on having this LCL generated component receive new events that were not originally defined for the base widget?

How will this be able to support themes?

How will this be able to support DnD?

How will this be able to support Corba?

If you think that you can make it do all of this well then great. We had this dicussion back in the beginning of the summer where we mulled over the possibility of writing directly to the XLIB or GDK. We all decided that it wasn't the way to go. Now all of a sudden everyone is talking about doing that again. If you go that way I feel that it will be extremely difficult to keep the indendence we have started with the InterfaceObject stuff. The only way to do it will most likely be to tie GTK or whatever API directly to the LCL.

Above you state that users will be able to create their own widgets. I don't deny can always access the GDK on their own or talk directly to the GTK if they wish. In this case though you are talking about creating NEW code using LCL. A large part of the recent discussion was based on using EXISTING Delphi code. This existing code is based on the premise that you can override things like the paint and draw for the parent component and draw it how you want. But API's like GTK don't work that way and that is what I am trying to point out.

Code written brand new using Lazarus and the LCL can extend the base LCL features by linking directly to the GTK and GDK themselves if they so desire. But there will be alot of existing that Delphi code that will only be usuable AFTER it has been modified to meet the feature set of the LCL.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Samuel Liddicott: Form designer waits on more complete (internally) VCL implementation which I am also…
Samuel Liddicott wrote
Form designer waits on more complete (internally) VCL implementation which I am also working on. More complete VCL internals await knowledge of more GTK primitive operations which I am studying.

I am concerned over this statement. Exactly what GTK primitives are you talking about? You should not be dealing with GTK
whole idea of the LCL and Lazarus is to remove the requirement of using the primitives. This is something that is handled in and by the widget set library.

I was on vacation for 2 weeks and having read over the archive I get the feeling that there is an impression that Lazarus and the LCL will be able to use ALL of the wonderful tools in places like Delphi Super Page. Well it will not. Most of these tools rely on the ability to inherit from an existing class say TButton for example. Then they override the Draw method to create a new button which maintains all of the original button features such as events. This will not work with Lazarus. The reason is due to the fact that ALL and I mean ALL of the generation of the Button, how it looks, how it is drawn, how it reacts to events is found in and controled by the GTK library. If you want to create a new component like that you need to modify the GTK library. You can't do it from within Lazarus or the LCL.

We have to keep this separation so that we can support alternate API libraries. The minute you add that feature to GTK and us it in your program you remove the possibility of using other API's if they do not also have that same component. So with that respect the core part of Lazarus and the LCL should never support more than the standard widgets found in all API's. That is the only way that the LCL can maintain cross platform and cross API ability.

Free Pascal, the FCL, Lazarus, and the LCL will be able to be used like Delphi and be able to port components that are non-visible but it will most likely NEVER be able to port a large portion of visible Delphi components unless they are also found in other widget sets like GTK and Qt.

Is this concept clear to everyone???

---
Michael A. Hess
Miracle Concepts, Inc.

Reply by email

Michael A. Hess
to Shane Miller: -----Original Message----- From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06…
mariano podesta wrote 5 lines
are you sure that GTK library does not dispatch standard messages like 'mouse move'? because standard messages is all that windows do. mariano

GTK does not dispatch ANY messages. It handles them all internally. All it does is fire a callback if an event has occured that it has handled. It does the same thing we do in Delphi with the On Event stuff. In a class we create we can assign an additional task to be completed if an event has occured. That is all we are getting from the GTK. It has handled the event and done whatever the control needs to have done. Then if and only if we have assigned a callback (an onEvent in Delphi) to the widget does it even bother to tell us about the event. That is the callback that we receive in the LCL. Then if we have assigned an OnEvent to the class for this type of event do we call that. We never actually receive the message from the GTK we only get the callback or as in Delphi the OnEvent signal that the event has occured.

In other words you can receive the callback and then determine wheither you want the control to accept it. It has already accepted it and is just telling you about it. If we could tell the GTK not to accept it we wouldn't be getting the callback in the first place.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Michael A. Hess: But what you need it for is Windows. The main push at this point is to get a product for…
Show quoted text 13 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 05:10 PM To: Subject: Re: [lazarus] Progress Samuel Liddicott wrote: > > Glk!! The reason I'm talking about it is because I think it really > does need talking about early on, before we take a long strategy. But what you need it for is Windows.

I don't need it for windows, I don't actually care much about Lazarus on windows - I've got Delphi, after all.

The main push at this point is to get a product for Linux. Don't expect people to jump ship from Delphi to FPC and Lazarus on Windows any time soon. They will just continue to use Delphi. (Even I will).

Me too. Yet still the reason I'm talking about it is because I think it really
does need talking about early on, before we take a long strategy.

First off you are mixing things up. The arguement is between GTK and Qt not GTK and KDE. For that matter it isn't even much of an arguement any more since they are both merging some of their features.

I don't mean our argument, I mean theirs. If helping us also supports their position in that Lazarus "requires" GTK, so much the better for them; also more GTK app's will be produced more quickly. Hence I think they will do it.

Show quoted text 5 lines
Secondly that is why we are trying to make the LCL API independent so that we aren't part of any arguement or religious war. We want anyone to be able to use whatever API they want to build an X Windows product with FPC. We do not want to become part of the GTK team or the Qt team or what have you.

I know, thats why I think we should talk about it first; otherwise (and the way we are going right now) the LCL will be very GTK dependant.

As I've said before, using wndproc adds another level of abstraction, and in fact loosens the strings to GTK as you so well pointed out when you said I only wanted it for windows.

> Good; but I've said before, I *need* the wndproc support; and I am > modifying the LCL to support it. But that is for Windows.

It is not, I don't care a fig about LCL for windows (no offense to the current converter).

Again the main push is to develope Lazarus and the LCL for Linux, an environment where we don't have any tools like Delphi.

We do. We have FEDIT the form designer for a start.

That is what we need to concentrate on.

But unless we discuss it we don't know what it is that is that is "lazarus for linux"

Why is it so important to try and make Lazarus support the Windows API at this time?

It isn't, I just want to stop it being bound so strongly to GTK, and to make it Delphi compatable (to hell with the windows API, I make thorough use of overridden wndprocs in my delphi code)

> I also *need* GTK to be less stingy with its events. It isn't stingy. That is how it is designed. It is designed to simplify application development. It does the dirty work so you don't have to.

I know; but it is still a problem for the lcl component developer if he can't get at them, so I *need* GTK to be more free with its events.

I do. You may not, but I do.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: Why??? This is also the method used in Java as well. ==== Programming my first best…
Show quoted text 15 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, September 01, 1999 08:58 PM To: Subject: Re: [lazarus] Progress Samuel Liddicott wrote: > > I am also absolutely horrified to find that weird stretchy-scaling > windows are the norm, and that a special widget has to be made to hold > windows steady. Surely stretchy/steady should just be a property of > the base container widget! Why???

So you can just turn it on or off. Un-stretchy is so boring that for it not to be at least an optional behaviour of the default container widget means they must have some container algorithms I can't even begin to imagine.

This is also the method used in Java as well.

I don't like it much their either.

I *do* like the Delphi 4 anchors, tho'; and happily it is set on a per-control basis and not per-container.

Sam

Reply by email

Jeff Wormsley
to Samuel Liddicott: Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of…
Michael A. Hess wrote
No it doesn't. The GTK NEVER sends any messages to the LCL. All it ever does is call a callback routine after the event has been handled and then if and only if a callback has been assigned to the widget for that event.

Does this mean an application can never prevent an event from being serviced? Are there any equivalents to "Before" events? Like a callback that is called before the widget does something, that can return something that prevents or allows the widget to act on the event? Or are all of the callbacks always "After" the fact?

Jeff.

Reply by email

Markku Niskanen
to Shane Miller: -----Original Message----- From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06…
you wrote
GTK does not dispatch ANY messages. It handles them all internally. All it does is fire a callback if an event has occured that it has handled.

Thanks, Michael, that explained a lot. I have been trying to figure out how the LCL/GTK system works
and you told it in just one sentence.

Have you or has anybody yet found out why the GTK
drawing routines make the X swell to such an extent that it finally crashes the system? (I sent a simple example a couple of weeks ago).

Markku

Reply by email

Samuel Liddicott
to Michael A. Hess: OK. First let me clarify something. GTK returns 2 things signals and events. Signals are…
Show quoted text 9 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 07:42 PM To: Subject: Re: [lazarus] Progress As I have been saying all along. If the LCL was made to be GTK specific then alot of what you are asking about would be easier. Again it is this keeping it independent from the API that is causing the trouble.

What? Michael, you were the one saying DON'T make it API specific. But to rephrase you it is this keeping it independant from the API that is causing the "discussion".

You are saying "don't discuss, do"; but we are discussing what it is we are to do.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: Not in the least. GTK was written mainly for use by "C". We are using wrappers to access…
Show quoted text 9 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 04:59 PM To: Subject: Re: [lazarus] Progress Again this is what I have been trying to tell you. It can look like Delphi and you can code standard stuff like Delphi you just can't extend it like Delphi.

But it doesn't have to be like that.

The discussion currently under way (the validity of which discussion is under question) is how to get round this, and I think the solution has been reached.

Also we never intended this to be a Delphi clone in it's entirity. A Delphi replacement, maybe.

Fine, but we can have more functionality and extensability - at least as much as Delphi has; and that is a lot of the attraction for Delphi

Sam

Reply by email

Michael A. Hess
to Samuel Liddicott: This is how I see it. It is a GTK mistake. If GTK do not nohow allow overriding of…
Samuel Liddicott wrote
This is how I see it. It is a GTK mistake.

Not in the least. GTK was written mainly for use by "C". We are using wrappers to access this code which isn't always the easiest to do. Expecially if we are going to continue to try and keep the LCL, API independent. If we were to code the LCL and Lazarus as strickly a GTK product then many of things you want to do would be more easily accomplished.

If GTK do not nohow allow overriding of methods or events they have not permitted, AND if we cannot quickly derive our own descendant of any GTK widget that DOES pass all events,

As I mentioned in the other email. Please be clear that it never passes any events just notification that the event took place and was handled.

then I start to wonder why we are with GTK, because whatever nice thing lazarus is, whatever nice object pascal gui thing it will be, it will be nothing like delphi.

Again this is what I have been trying to tell you. It can look like Delphi and you can code standard stuff like Delphi you just can't extend it like Delphi.

Also we never intended this to be a Delphi clone in it's entirity. A Delphi replacement, maybe.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Samuel Liddicott: then lets use it. if thats the way, then *I* certainly am saying it. Glk!! The reason I'm…
Samuel Liddicott wrote
Glk!! The reason I'm talking about it is because I think it really does need talking about early on, before we take a long strategy.

But what you need it for is Windows. The main push at this point is to get a product for Linux. Don't expect people to jump ship from Delphi to FPC and Lazarus on Windows any time soon. They will just continue to use Delphi. (Even I will).

Show quoted text 7 lines
> We certainly aren't at the > point to be talking the GTK people and telling them what they should > be adding the GTK library. If we are part of the GTK people we can express what we need. And if they want to win the fight against KDE, the more support for them the better.

First off you are mixing things up. The arguement is between GTK and Qt not GTK and KDE. For that matter it isn't even much of an arguement any more since they are both merging some of their features.

Secondly that is why we are trying to make the LCL API independent so that we aren't part of any arguement or religious war. We want anyone to be able to use whatever API they want to build an X Windows product with FPC. We do not want to become part of the GTK team or the Qt team or what have you.

Good; but I've said before, I *need* the wndproc support; and I am modifying the LCL to support it.

But that is for Windows. Again the main push is to develope Lazarus and the LCL for Linux, an environment where we don't have any tools like Delphi. That is what we need to concentrate on. If in the future we can adapt the LCL to build Windows applications using the Windows API will great but that isn't what we should focus on right now. If you want to build a Windows application with Lazarus then just use GTK on Windows and you are all set. Why is it so important to try and make Lazarus support the Windows API at this time?

I also *need* GTK to be less stingy with its events.

It isn't stingy. That is how it is designed. It is designed to simplify application development. It does the dirty work so you don't have to.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Michael A. Hess: No it doesn't. The GTK NEVER sends any messages to the LCL. All it ever does is call a…
Show quoted text 13 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 04:51 PM To: Subject: Re: [lazarus] Progress Samuel Liddicott wrote: > > Can you just confirm that the GTK interface to LCL notifys the LCL > objects by means of messages (via wndproc)? No it doesn't. The GTK NEVER sends any messages to the LCL.

I know, I know:

In the LCL we have sort of faked the concept of messages coming from the GTK by assigning a callback for every event we want for every control.

so: does it go "by means of messages (via wndproc)?"

After the event has been handled by the GTK it calls our callback which we then filter down to the assigned OnEvent method for the class. We never get a real message from the GTK. They don't exist, that is what I have been trying to tell you.

This point is not lost on me.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: GTK does not dispatch ANY messages. It handles them all internally. All it does is fire a…
Show quoted text 17 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 01:20 PM To: Subject: Re: [lazarus] Progress mariano podesta wrote: > > are you sure that GTK library does not dispatch standard messages like > 'mouse move'? > because standard messages is all that windows do. > mariano GTK does not dispatch ANY messages. It handles them all internally. All it does is fire a callback if an event has occured that it has handled. It does the same thing we do in Delphi with the On Event stuff.

Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of messages (via wndproc)?

Sam

Reply by email

Samuel Liddicott
to Jeffrey A. Wormsley: It depends on what you are doing. If a feature exists in toolkit A and B, the Interface…
Show quoted text 14 lines
-----Original Message----- From: Jeffrey A. Wormsley Sent: Wednesday, September 01, 1999 11:47 PM To: Subject: Re: [lazarus] Progress In some ways, this shows how despite its many limitations, it is a good thing that the VCL keeps a handle to the WindProc, and that it can be overriden so that ANY windows message in existence can be handled. Since GTK only implements messages that are specifice to the widget, and does not allow you to override the lowest level to add your own, it will make it very hard to do a lot of things common in Delphi (at the component writers level).

This is how I see it. It is a GTK mistake. If GTK do not nohow allow overriding of methods or events they have not permitted, AND if we cannot quickly derive our own descendant of any GTK widget that DOES pass all events, then I start to wonder why we are with GTK, because whatever nice thing lazarus is, whatever nice object pascal gui thing it will be, it will be nothing like delphi.

Sam

Reply by email

Michael A. Hess
to Samuel Liddicott: It jolly well won't unless the developer adds that. No. we are staying stick with GDK,…
Samuel Liddicott wrote 8 lines
> How will this be able to support themes? > > How will this be able to support DnD? > > How will this be able to support Corba? It jolly well won't unless the developer adds that.

Well that is the whole point of the LCL API independence. We are currently working on the GTK interface design. It will not take that much effort to then make a Gnome interface design. All of the above things are already handled by Gnome so all of the components automatically deal with all of these features for you. This also goes for the KDE libraries. Why reinvent the wheel. Use what already exists.

Don't get too focused on thinking about how Delphi does things. In some cases they are far from the best solution.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Shane Miller: -----Original Message----- From: Michael A. Hess To: Date: Tuesday, August 31, 1999 5:06…
Markku Niskanen wrote 5 lines
Have you or has anybody yet found out why the GTK drawing routines make the X swell to such an extent that it finally crashes the system? (I sent a simple example a couple of weeks ago).

I have been gone for 2 weeks and am still trying to get the rest of my business in order. I haven't even had a change to update from CVS since I got back. Hopefully by this weekend I can get back on track with Lazarus. May then I can look at you sample.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Jeff Wormsley
to Samuel Liddicott: Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of…
Michael A. Hess wrote
However if you handle all of the events instead of letting GTK handle them then what are you using GTK for?

See below...

It would be possible for you to catch the event, tell GTK to ignore it and then handle it up the class chain yourself but then you lose all of the GTK functionality.

The only reason I am asking is that if there is a Before as well as an After, then Interfaces could by default set the Before callback to tell GTK to handle the event, but if the LCL event were overriden, it could in turn override the Before event. So, to use a GTK button as normal, there would be no difference from current code. But, if you wanted to, say, keep someone from clicking on it, you would set the callback that came before the click to something other than the default, then handle the event yourself, and return to GTK whether to keep going or not. In essence, you have then overridden the event, just as you would have in windows if you intercepted the WindProc and acted on a WM_MOUSECLICK (or whatever that message is). In Windows, you either pass the message on to the parent handler for normal handling, or throw it away. In GTK, you either return False to the Before event for normal handling, or return True to tell GTK the event has already been handled.

Since Qt is different in nature the way you would need to code the LCL to handle this will most likely be radically different for Qt. (I'm not familiar with Qt to really say.)

I don't know about QT either, but it would seem that the ability to override default event behavior would be a fairly common ability in any GUI toolkit. Whether it is done, as GTK seems to, with a callback, or as windows with a message intercept, should be capable of being handled by the Interfaces code, I would think.

Jeff.

Reply by email

Michael A. Hess
to Samuel Liddicott: Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of…
Samuel Liddicott wrote
Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of messages (via wndproc)?

No it doesn't. The GTK NEVER sends any messages to the LCL. All it ever does is call a callback routine after the event has been handled and then if and only if a callback has been assigned to the widget for that event. In the LCL we have sort of faked the concept of messages coming from the GTK by assigning a callback for every event we want for every control. After the event has been handled by the GTK it calls our callback which we then filter down to the assigned OnEvent method for the class. We never get a real message from the GTK. They don't exist, that is what I have been trying to tell you.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Samuel Liddicott: Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of…

I changed some of my position in mid response to this email. Read the whole thing to follow my train of thought.

Jeff Wormsley wrote 16 lines
The only reason I am asking is that if there is a Before as well as an After, then Interfaces could by default set the Before callback to tell GTK to handle the event, but if the LCL event were overriden, it could in turn override the Before event. So, to use a GTK button as normal, there would be no difference from current code. But, if you wanted to, say, keep someone from clicking on it, you would set the callback that came before the click to something other than the default, then handle the event yourself, and return to GTK whether to keep going or not. In essence, you have then overridden the event, just as you would have in windows if you intercepted the WindProc and acted on a WM_MOUSECLICK (or whatever that message is). In Windows, you either pass the message on to the parent handler for normal handling, or throw it away. In GTK, you either return False to the Before event for normal handling, or return True to tell GTK the event has already been handled.

Again were back to the problem of the API independence. If the LCL was written just for GTK we wouldn't be using the InterfaceObject code and the GTK routines and calls and callbacks could be an integral part of the LCL classes. Then we could more easily do what you are asking about. The problem is with our callback dispatching. It currently works as follows.

* The GTK callback routine is called. This is found in the gtkint.pp set of files.

* This callback routine establishes which LCL component to Dispatch the message to by the data variable that is passed into the callback routine from GTK.

* The callback routine calls the low level RTL code for the Dispatch to and FPC Object.

Now this is where I was seeing a problem. How to return the information to GTK telling to ignore the event. I suppose you could pass a record to the Dispatch which would include a variable as a flag that the LCL eventhandler could set indicating whether to pass a result that it did or did not handle it. Hmmmmmmm.

I'm beginning to change my mind here. We just might be able to do what you are talking about after all. If we can inclose every component inside the GTKEventBox so that we are always assured that every component is capable of receiving any trapped event and we include a return state variable with every {DoEvent}, this just might work.

It will still depend on how the GTK deals with default handlers of the various events within the GTK library. It might not always be possible to override every event. We will have to examine some of the internals of the GTK widgets to be sure this will work. Hmmmm.

This will require us to backup and redo alot of what has already been built for the LCL. Really it will only require changes in the gtkint.pp files but it will be some heavy changes. It will also require some changes to how the TNotify routines are written for every class. But it might be worth it. Hmmmmmm.

I am including some more information from the GTK tutorial with regards to the GTKEventBox. It is an example showing how to add buttonClick to a Label Widget which doesn't naturally have one. So if the EventBox does support all events we could indeed over ride any control to include or ignore events it previously used. Hmmmmm.

We still have to look if it is an easy matter to override the various widget class methods for things like draw normally written in "C". Then we have to see if we can maintain this separation via the gtkint.pp code. I still think that this might be getting to complex to maintain independence. It might make more sense to make an LCL that is just written for use by GTK. I'm still not sure of the whole concept.

-------------------

10.1 The EventBox

Some GTK widgets don't have associated X windows, so they just draw on their parents. Because of this, they cannot receive events and if they are incorrectly sized, they don't clip so you can get messy overwriting, etc. If you require more from these widgets, the EventBox is for you.

At first glance, the EventBox widget might appear to be totally useless. It draws nothing on the screen and responds to no events. However, it does serve a function - it provides an X window for its child widget. This is important as many GTK widgets do not have an associated X window. Not having an X window saves memory and improves performance, but also has some drawbacks. A widget without an X window cannot receive events, and does not perform any clipping on its contents. Although the name EventBox emphasizes the event-handling function, the widget can also be used for clipping. (and more, see the example below).

To create a new EventBox widget, use:

     GtkWidget *gtk_event_box_new( void );

A child widget can then be added to this EventBox:

         gtk_container_add( GTK_CONTAINER(event_box), child_widget );

The following example demonstrates both uses of an EventBox - a label is created that is clipped to a small box, and set up so that a mouse-click on the label causes the program to exit. Resizing the window reveals varying amounts of the label.

/* example-start eventbox eventbox.c */

     #include <gtk/gtk.h>
     int
     main (int argc, char *argv[])
     {
         GtkWidget *window;
         GtkWidget *event_box;
         GtkWidget *label;
         gtk_init (&argc, &argv);
         window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
         gtk_window_set_title (GTK_WINDOW (window), "Event Box");
         gtk_signal_connect (GTK_OBJECT (window), "destroy",
                             GTK_SIGNAL_FUNC (gtk_exit), NULL);
         gtk_container_set_border_width (GTK_CONTAINER (window), 10);
         /* Create an EventBox and add it to our toplevel window */
         event_box = gtk_event_box_new ();
         gtk_container_add (GTK_CONTAINER(window), event_box);
         gtk_widget_show (event_box);
         /* Create a long label */
         label = gtk_label_new ("Click here to quit, quit, quit, quit,
                                 quit");
         gtk_container_add (GTK_CONTAINER (event_box), label);
         gtk_widget_show (label);
         /* Clip it short. */
         gtk_widget_set_usize (label, 110, 20);
         /* And bind an action to it */
         gtk_widget_set_events (event_box, GDK_BUTTON_PRESS_MASK);
         gtk_signal_connect (GTK_OBJECT(event_box),
                             "button_press_event",
                             GTK_SIGNAL_FUNC (gtk_exit), NULL);
         /* Yet one more thing you need an X window for ... */
         gtk_widget_realize (event_box);
         gdk_window_set_cursor (event_box->window,
                              gdk_cursor_new(GDK_HAND1));
         gtk_widget_show (window);
         gtk_main ();
         return(0);
     }
     /* example-end */

Something more to think about. But again is it still worth the effort??

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Michael A. Hess: How do you plan on having this LCL generated component receive new events that were not…
Show quoted text 11 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, September 01, 1999 09:24 PM To: Subject: Re: [lazarus] Progress How will this be able to support themes? How will this be able to support DnD? How will this be able to support Corba?

It jolly well won't unless the developer adds that.

Show quoted text 5 lines
If you think that you can make it do all of this well then great. We had this dicussion back in the beginning of the summer where we mulled over the possibility of writing directly to the XLIB or GDK. We all decided that it wasn't the way to go. Now all of a sudden everyone is talking about doing that again.

No. we are staying stick with GDK, but lets not require C++ in order to write new components.

If you go that way I feel that it will be extremely difficult to keep the indendence we have started with the InterfaceObject stuff.

No, I can manage this.

The only way to do it will most likely be to tie GTK or whatever API directly to the LCL.

Nope, we can abstract it, I have it worked out.

Show quoted text 5 lines
A large part of the recent discussion was based on using EXISTING Delphi code. This existing code is based on the premise that you can override things like the paint and draw for the parent component and draw it how you want. But API's like GTK don't work that way and that is what I am trying to point out.

If its a Delphi clone then this needs to be worked out the YES way, not the NO way.

Show quoted text 5 lines
Code written brand new using Lazarus and the LCL can extend the base LCL features by linking directly to the GTK and GDK themselves if they so desire. But there will be alot of existing that Delphi code that will only be usuable AFTER it has been modified to meet the feature set of the LCL.

I really don't like differences can be encapsulated in the GTK interface, with possibly a few additions to GTK itself.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: I changed some of my position in mid response to this email. Read the whole thing to…
Show quoted text 6 lines
10.1 The EventBox Some GTK widgets don't have associated X windows, so they just draw on their parents. Because of this, they cannot receive events and if they are incorrectly sized, they don't clip so you can get messy overwriting, etc. If you require more from these widgets, the EventBox is for you.

Hmm; same as TControl in delphi. Excellent.

Something more to think about. But again is it still worth the effort??

Yes, because it supports abstraction which may be required by other API's and at the same time is instantly very Delphi compatable.

Sam

Reply by email

Samuel Liddicott
to Jeffrey A. Wormsley: I think that we are all, in a sense saying much the same thing, only you do not want to…
Show quoted text 15 lines
-----Original Message----- From: Jeffrey A. Wormsley Sent: Wednesday, September 01, 1999 11:20 PM To: Subject: Re: [lazarus] Progress >Exactly what do you think you could call to get the GTKMain event loop >to recognize and send a callback for an event it wasn't designed to >handle? >From LCL, nothing. But that doesn't stop you from asking it to be added to GTK, or volunteering to the GTK team to do it yourself. Most of the time, I would think you would just have to live without it, but it shouldn't be ruled out.

Jeff, this is a good idea. It may not be hard to descend a widget that returns all events instead of the few the GTK developers happened to need at the time.

Sam

Reply by email

Samuel Liddicott
to Michael A. Hess: Well that is the whole point of the LCL API independence. We are currently working on the…
Show quoted text 18 lines
-----Original Message----- From: Michael A. Hess Sent: Thursday, September 02, 1999 05:15 PM To: Subject: Re: [lazarus] Progress Samuel Liddicott wrote: > > > How will this be able to support themes? > > > > How will this be able to support DnD? > > > > How will this be able to support Corba? > > It jolly well won't unless the developer adds that. Well that is the whole point of the LCL API independence.

Do we want GTK dependance or independance? I thought we wanted independance.

We are currently working on the GTK interface design.

Which is what most of the discussion is about.

It will not take that much effort to then make a Gnome interface design. All of the above things are already handled by Gnome so all of the components automatically deal with all of these features for you.
This also goes for the KDE libraries. Why reinvent the wheel. Use what already exists.

Its because I want to use what already exists that I'm talking about it.

Don't get too focused on thinking about how Delphi does things. In some cases they are far from the best solution.

Is this, or is it not, Delphi for Linux?
And in this case avoiding wndproc just because GTK doesn't need it, is becoming API specific, which is not sensible especially as we are already away of two styles of API that REQUIRE wndprocs.

again, are we API specific, or not?

I say not, hence the need for abstraction.
Are we working on Delphi for linux, or just some other object-pascal visual builder? I thought it was Delphi for linux.

Sam

Reply by email

Michael A. Hess
to Samuel Liddicott: Can you just confirm that the GTK interface to LCL notifys the LCL objects by means of…
Jeff Wormsley wrote 6 lines
Does this mean an application can never prevent an event from being serviced? Are there any equivalents to "Before" events? Like a callback that is called before the widget does something, that can return something that prevents or allows the widget to act on the event? Or are all of the callbacks always "After" the fact?

OK. First let me clarify something. GTK returns 2 things signals and events. Signals are just flags saying that something has happened in case you want to do something about it. Like Destroy. It isn't an event as much as a maintence signal. Hence a signal.

It also sends callbacks that are for events. To answer your question yes it is possible in some cases to have the widget ignore the event and for you to take control and handle the event. However if you handle all of the events instead of letting GTK handle them then what are you using GTK for? Since Qt is different in nature the way you would need to code the LCL to handle this will most likely be radically different for Qt. (I'm not familiar with Qt to really say.)

It would be possible for you to catch the event, tell GTK to ignore it and then handle it up the class chain yourself but then you lose all of the GTK functionality.

Maybe this will help. What follows is out of the GTK Tutorial

--------------------

18.2 Signal Emission and Propagation

Signal emission is the process whereby GTK runs all handlers for a specific object and signal.

First, note that the return value from a signal emission is the return value of the last handler executed. Since event signals are all of type GTK_RUN_LAST, this will be the default (GTK supplied) handler, unless you connect with gtk_signal_connect_after().

The way an event (say "button_press_event") is handled, is:

* Start with the widget where the event occured.
* Emit the generic "event" signal. If that signal handler returns a value of TRUE, stop all processing.
* Otherwise, emit a specific, "button_press_event" signal. If that returns TRUE, stop all processing.
* Otherwise, go to the widget's parent, and repeat the above two steps.
* Continue until some signal handler returns TRUE, or until the top-level widget is reached.

Some consequences of the above are:

* Your handler's return value will have no effect if there is a default handler, unless you connect with
gtk_signal_connect_after().
* To prevent the default handler from being run, you need to connect with gtk_signal_connect() and use gtk_signal_emit_stop_by_name() - the return value only affects whether the signal is propagated, not the current emission.

-------------------

As I have been saying all along. If the LCL was made to be GTK specific then alot of what you are asking about would be easier. Again it is this keeping it independent from the API that is causing the trouble.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Samuel Liddicott
to Michael A. Hess: GTKEventBox So you are saying we would need to add an event manager to LCL? I guess in a…
Show quoted text 17 lines
-----Original Message----- From: Michael A. Hess Sent: Wednesday, September 01, 1999 10:03 PM To: Subject: Re: [lazarus] Progress Shane Miller wrote: > > Ttrue, however we this is exaclty the same for window. If it doesn't > handle an event by defualt you can't force it to. I remeber there's a > widget that detects the mouse move, clicks, etc that is invisible and > it's meant to be used to add this functionality to components that > don't have it by defualt. We could look into adding that to all > widgets that need it. GTKEventBox

then lets use it.

> GTKMAIN wouldn't receive the info. The new/user defined events would > be called and handled in the component, not in gtk. So you are saying we would need to add an event manager to LCL?

if thats the way, then *I* certainly am saying it.

We have been drawn down in to discussions of WindProc, WinHandles, etc. etc. and it just doesn't need to be talked about or done at this time.

Glk!! The reason I'm talking about it is because I think it really does need talking about early on, before we take a long strategy.

We certainly aren't at the point to be talking the GTK people and telling them what they should be adding the GTK library.

If we are part of the GTK people we can express what we need. And if they want to win the fight against KDE, the more support for them the better.

So I agree let's just keep working on GTK and get something done.

Good; but I've said before, I *need* the wndproc support; and I am modifying the LCL to support it.
I also *need* GTK to be less stingy with its events.

Sam

Reply by email