Recent

Author Topic: Juggling Multiple Lazarus Projects  (Read 2656 times)

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #15 on: December 04, 2022, 02:47:54 pm »
Quote
In most cases, the value to the end user of the Examples is the chance to look at the code. yep, they might compile and run to ensure its the example they think it is but browsing across the code is the benefit.
Yes, the request sounds unusual. Usually, people want to look at an example project's forms and/or code for a while before running it. Also, pressing F9 is a rather small task.
Still, if somebody wants such an option, it makes no harm to others.
Hi, now let me try and clear up this mess I seem to have caused. I am not, I repeat not requesting any changes in the code. I was simply sharing my own experiences and observations.

Now think about this ok.. let us all forget for a moment that most of us here in the forum are highly experienced and veteran programmers who over the years have gained broad spectrum skill sets that only life can teach you. Let us go back to when we were all newbies who had never seen a line of code.

If you are coming in with absolutely nil/zero coding experience and are fortunate enough to stumble across the holy grail of all IDE's ( I like to call it that please do not ask why just makes me feel really good )what is the first thing you are going to be doing? Browsing through code you do not understand? Browing through code that in a few minutes is going to make you scream, pull out your hair possibly leave you bald for life and more importantly you will walk away. Because there was nothing you could see and immediately understand? That skill comes with experience and many long years of typing away on the keyboard before one can look at code and 'understand' what someone else has done.

So long years ago when I first looked around for tutorials on C there were not many available and the internet was in it's early infancy this was way back in 1990 or so. And the codebase I was looking at I did not understand neither did it have any GUI examples. So I  gave up and walked away and stuck with my trusted Clipper5.3 and dBaseIII and advantage database server and to keep our network alive we had Novell Netware.

Many years later, actually, decades later I stumbled across gtk2 and that codebase had examples ( Google GTK+ Demo ) and suddenly I had what was missing all these years. Something I could run and immediately see what that piece of code did. To a newcomer, this helps tremendously and is the key between someone walking away and getting involved. And Lazarus is growing and we need more people who can help and contribute. Again this is simply me sharing my thoughts this is not a request to change anything in our codebase. My apologies if at any time what I have said made anyone think I was asking for changes. I hope this will help clear up things.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Juggling Multiple Lazarus Projects
« Reply #16 on: December 04, 2022, 03:34:32 pm »
Many years later, actually, decades later I stumbled across gtk2 and that codebase had examples ( Google GTK+ Demo ) and suddenly I had what was missing all these years. Something I could run and immediately see what that piece of code did.

Ok, ... And again I did not read the other thread, so I hope I do not duplicate.

I guess those gtk examples, you had to compile them yourself (gcc), or open them in an editor that could run gcc => so they are very likely like our examples....
Btw, my first exploration (decades ago) was to just drop stuff on the form designer, and use the Object inspector and run it. Did not need an example to figure that out...




Of course there are various expectations you could have towards examples:

1) Find out specifics about a component that you already know. IMHO that is what our examples do....

2) Find a component for a specific purpose / compare components. Probably less easy with what we have.

3) ...?


IMHO, 2 would be helped by having examples like
- Compare all type of buttons
- Compare all type of "text" (label, static-text, caption, OnPaint, ....)
....
Then you would still have to open the project and compile it. But you only need one or two projects that you look at.




The other part that would help (either use case) is improving the presentation....
- Better, more verbose descriptions
- Preview-Images. (2nd search window, to browse those images, rather than text)

Of course with 200+ images that's a lot of work: initial and maintenance.
And there will always be new demos that miss some part...



Worst is, we have so much info, that we don't even know if something already exists.
Maybe a wiki page. That wouldn't be interactive, yet it could list all buttons and describe the diffs.


JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: Juggling Multiple Lazarus Projects
« Reply #17 on: December 04, 2022, 07:22:05 pm »
My apologies if at any time what I have said made anyone think I was asking for changes. I hope this will help clear up things.
Why do you apologize? Asking for changes is perfectly OK, but then you must be prepared for somebody opposing your suggestion. That is how FOSS development works.
It is basically a meritocracy. Those who contribute quality code get more voting power.
If you provided a patch that makes the ExamplesWindow to run a project after opening it, you would get much more attention and the patch would very likely be applied. Now it is just vague suggestion which nobody takes seriously.  :)

FYI:
I will study my ExamplesWindow bug further tomorrow and start a new thread about it.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #18 on: December 04, 2022, 09:40:57 pm »
[Edit] Oops, actually it works with a clean Lazarus configuration, like "./lazarus --pcp=~/.lazarus_test &".
The default config is old and must be corrupt somehow.
I must delete it and tweak the settings again. I will lose file and project history and some settings but it is OK.
Why not keep a backup of that old config? Then you do not lose anything  :) You delete that config all that history goes POOF!
Keep a back up and use it when ever you need to know project history and details?

How is it possible that nobody has noticed this?
Most experienced and knowledgeable programmers rarely look for examples. That could be why...  :)

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Juggling Multiple Lazarus Projects
« Reply #19 on: December 05, 2022, 01:14:58 am »
Sounds like you like to use keyboard commands while using a GUI.  Personally I use the mouse where ever possible in a GUI but when in a terminal window, thats where I use the keyboard. I am a vi user for example.
 
......It does give you a list of available examples but you are unable to select immediately using the list. Try pressing Enter and see. 

Thats because the tab order is set to [ Searchbox - ListView - .....]   
So, as the Window opens, the focus is on the SearchBox, thats the most likely thing the user wants to use. But you can, at any time, press tab, that moves you to the ListView, you can now cursor (up or) down to a target project and press Enter.

 
.....we have to run it by pressing F9 to see what it looks like.  More keystrokes again.
Or one click of the green triangle, its a GUI, use the Mouse Luke !

But don't forget, not all Example project have a GUI, several do something "behind the scene". For example, there is one that generates a PDF from some content, you only know its run by looking for a fresh PDF in the working directory.

 
Or once you select the example you have to copy it to the work area then open it.
No ! All you need do is double click on a project, that will select it, copy it to the work area, open the IDE on it. Its a GUI, use the mouse.

The way it is right now when searching the results are displayed only after you have typed in what your are searching for and then pressed the enter key.
Yes, there is no reason while I did not implement Search While You Type, there is even a comment in the code where I note that would be a better way, its easy. Maybe I will implement that. Further, it should remove the search prompt when you click into the search box, again something I should have done. (Incidentally, something my own app does do in similar circumstances)

And, while I was testing why you think the Enter key does not work, I have triggered an AV. Some some work on my part is needed !

Aruna, I suggest you make a standalone project that does what you want, as I suggested before, grab the code that reads the project meta data from Lazarus, uexampledata.pas in particular. Make something that works and then you can consider if it remains as stand alone or implement it as a Lazarus plugin (as the Example Window is). If people like it, they can choose to plug it in, if the developers like it, they can include it with eg, bigide. Its vastly easier and quicker to develop something standalone and later integrate it into a something like Lazarus. 

On the other hand, having it standalone may not be a bad idea, it means you could run it and look at a example project without disrupting the project you are working on. My solution to that is to open the Example source in a browser from the remote repository but GitLab's syntax highlighting leaves a lot to be desired.

As Linus says, shown me the code !

If you need any help, do not hesitate to ask, looks like I am going to be refreshing my memory of the present code right now anyway so good time to ask !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #20 on: December 05, 2022, 05:34:18 am »
I guess those gtk examples, you had to compile them yourself (gcc), or open them in an editor that could run gcc => so they are very likely like our examples....
Yes we had to use gcc but with a very strange set of flags I had not seen before
Code: Pascal  [Select][+][-]
  1. $ gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0`
it was the first time I saw `pkg-config --libs --cflags gtk+-2.0` For anyone who may be interested the tutorial is still here:GTK2 C Tutorial/

IMHO, 2 would be helped by having examples like
- Compare all type of buttons
- Compare all type of "text" (label, static-text, caption, OnPaint, ....)
...
I am working on a demo that does this  :)

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #21 on: December 05, 2022, 05:38:11 am »
Code: [Select]
[quote author=JuhaManninen link=topic=61473.msg462655#msg462655 date=1670178125]
It is basically a meritocracy. Those who contribute quality code get more voting power.
If you provided a patch that makes the ExamplesWindow to run a project after opening it, you would get much more attention and the patch would very likely be applied. Now it is just vague suggestion which nobody takes seriously.  :)
I am working on the code but taking things slow like I was advised to do  :)

FYI:
I will study my ExamplesWindow bug further tomorrow and start a new thread about it.
So what is the latest with your ExamplesWindow bug? In a new thread of course :)

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Juggling Multiple Lazarus Projects
« Reply #22 on: December 05, 2022, 05:47:36 am »
OK, patch submitted to fix that corner case AV I mentioned. And improves handling of the "Search Here" prompt as a user tabs or clicks in or out of the EditSearch Box.

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40034

@Aruna
Quote
The way it is right now when searching the results are displayed only after you have typed in what your are searching for and then pressed the enter key.
Yes, there is no reason why I did not implement Search While You Type,
Wrong, I did in fact implement Search While You Type. I am not sure how Aruna thinks its not there, has been there since early days. With each keypress in the EditSearch, the contents of the ListView is updated.....

Davo

edit: typo
« Last Edit: December 05, 2022, 06:45:00 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #23 on: December 05, 2022, 06:45:09 am »
Sounds like you like to use keyboard commands while using a GUI.  Personally I use the mouse where ever possible in a GUI but when in a terminal window, thats where I use the keyboard. I am a vi user for example.
 
That depends on what is involved at any given time and what I may be trying to do. It has been years since I last used vi, now a days most of the time I use Geany
You are aware we also have gVim right?

Or one click of the green triangle, its a GUI, use the Mouse Luke !
Tsk..Tsk.. Luke does not have the IDE CoolBar enabled so I do not have that green triangle. Just to prove a point (humour me ok) disable the mouse. Pull that USB cable out, please. If it's a wireless mouse pull out the dongle. Now enable that IDE CoolBar and if you are able to make that green triangle work using that keyboard I will never dispute or oppose anything ever again. Prove me wrong Yoda  :P I prefer not to assume anything about an end user's system ( especially guys like us ) who may have disabled the IDE CoolBar to regain some screen real estate or for whatever reason. 

But don't forget, not all Example project have a GUI, several do something "behind the scene". For example, there is one that generates a PDF from some content, you only know its run by looking for a fresh PDF in the working directory.
Ah.. thank you. Good to know..

Yes, there is no reason while I did not implement Search While You Type, there is even a comment in the code where I note that would be a better way, its easy. Maybe I will implement that. Further, it should remove the search prompt when you click into the search box, again something I should have done. (Incidentally, something my own app does do in similar circumstances)
Yes I saw that a few minutes back when I started to go through your code. No biggie we will fix things soon.

And, while I was testing why you think the Enter key does not work, I have triggered an AV. Some some work on my part is needed !
Huh? Say what? Oh my... FTW is a AV? Anti Virus? Audio Visual? AV as in Adult Video? Jokes aside I seriously have no clue what you meant by AV? Hope it is nothing serious.

Aruna, I suggest you make a standalone project that does what you want, as I suggested before, grab the code that reads the project meta data from Lazarus, uexampledata.pas in particular. Make something that works and then you can consider if it remains as stand alone or implement it as a Lazarus plugin (as the Example Window is). If people like it, they can choose to plug it in, if the developers like it, they can include it with eg, bigide. Its vastly easier and quicker to develop something standalone and later integrate it into a something like Lazarus.
Yes David your absolutely right and spot on and this is what I think I will try and do. I also felt a plugin will be the best way to go.

On the other hand, having it standalone may not be a bad idea, it means you could run it and look at a example project without disrupting the project you are working on. My solution to that is to open the Example source in a browser from the remote repository but GitLab's syntax highlighting leaves a lot to be desired.
I actually once opened up two separate instances of Lazarus IDE and opened two different projects and had absolutey no issues switching between them Lazarus managed everything beautifully. I was again amazed and humbled.

As Linus says, shown me the code !
Uh-Uh and Hell NO! Very bad idea. I am not showing Linus anything until we have this working bug free. Even then am not showing him anything. Yes I am scared of Linus and GregKH and I am even more afraid of Valdis but that is another story for another time.

If you need any help, do not hesitate to ask, looks like I am going to be refreshing my memory of the present code right now anyway so good time to ask !
Thank you very much David for offering to help. Yes I will need help understanding what you have done in the 'package' the *.lpk I meant. Please try to understand what may be obvious to you may not be so visible to a new comer like me so have patience when I may ask silly questions. It is 42 minutes after midnight here in Toronto been a long day for me I am a wee bit tired so will be calling it a day soon. I will take you up on that offer come tomorrow morning.

Thank you once again for your patience and sense of humour.

Aruna

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #24 on: December 05, 2022, 07:13:13 am »
Wrong, I did in fact implement Search While You Type. I am not sure how Aruna thinks its not there, has been there since early days. With each keypress in the EditSearch, the contents of the ListView is updated.....
David please watch this to the very end very carefully: Examples Window Seach Text Not Updating ListBox it is only 3 minutes.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Juggling Multiple Lazarus Projects
« Reply #25 on: December 05, 2022, 07:36:57 am »
You are aware we also have gVim right?
Hmm, that probably reinforcess my point. In Text mode, use Text tools. In GUI mode, use GUI tools. There is a pattern there ....

Tsk..Tsk.. Luke does not have the IDE CoolBar enabled so I do not have that green triangle. Just to prove a point (humour me ok) disable the mouse.
Now I understand, have I got a solution for you !  Open a terminal, type fp and press enter. Problem solved.

My work here is done.     O:-)   Queue the riding off into the sunset music .....

(The CoolBar buttons are speed buttons, they don't have a tab stop. But, honestly, Lazarus is meant to be used with a full GUI. Running it without the cool CoolBar really does not make sense IMHO. But even without the green triangle, there are Menu short cuts and they a do have tab stops .....)

Quote
Oh my... FTW is a AV? Anti Virus? Audio Visual? AV as in Adult Video? Jokes aside I seriously have no clue what you meant by AV? Hope it is nothing serious.
An Access Violation, for this purpose (only), a Seg Fault https://xkcd.com/371/

Quote
Watch this video ...
What, after you mention Adult Videos ?  Ok, I watched it, very unexpected. I note that you have only 166 Examples available. Are you sure you are using lazarus-main from the Official Lazarus gitlab site ?  https://gitlab.com/freepascal.org/lazarus/lazarus  ?
There should be about 205 Example Projects, has been for over six months.

Or, perhaps, are you running very old hardware that is not updating in time ?  I wonder if I should have a checkbox, "Do NOT SWYT" for people who's systems are not capable of keeping up with the demand.

OK, so, now you have had time, what do you think of the cool (but no coolbar) fp text IDE ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: Juggling Multiple Lazarus Projects
« Reply #26 on: December 05, 2022, 09:10:51 am »
So what is the latest with your ExamplesWindow bug? In a new thread of course :)
I created a new thread "Bugs in Example Projects window".

BTW, please provide your fixed / improved version of the TestAll project at some point so we can add it to lcl/tests or somewhere.
The latest changes in "main" for TestAll before it was deleted should be included.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Juggling Multiple Lazarus Projects
« Reply #27 on: December 05, 2022, 01:09:37 pm »
Wrong, I did in fact implement Search While You Type. I am not sure how Aruna thinks its not there, has been there since early days. With each keypress in the EditSearch, the contents of the ListView is updated.....
David please watch this to the very end very carefully: Examples Window Seach Text Not Updating ListBox it is only 3 minutes.
Interesting, may be a linux bug.
On Windows the list is filtered while I type.

@dbannon: That should be a filter edit (there is a special control). The "Search here" should be .TextHint, i.e. you don't need to clear it...

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #28 on: December 05, 2022, 01:18:53 pm »
Now I understand, have I got a solution for you !  Open a terminal, type fp and press enter. Problem solved.
Oh man this is a blast from the past and I suppose that is one way to solve a problem. Thank you I have a new toy.

My work here is done.     O:-)   Queue the riding off into the sunset music .....
45 degrees you said? Riding off into the Simpson desert sunset is going to make Mr.Clint Eastwood have issues because that is his job :-D

(The CoolBar buttons are speed buttons, they don't have a tab stop. But, honestly, Lazarus is meant to be used with a full GUI. Running it without the cool CoolBar really does not make sense IMHO. But even without the green triangle, there are Menu short cuts and they a do have tab stops .....)
Relax I was just messing with the IDE, the CoolBar will be enabled but after I am done testing and messing with the ide first. Know your tools well said Yoda to Luke and Luke said to yoda ya-ya I know... use the mouse Luke :-D

An Access Violation, for this purpose (only), a Seg Fault https://xkcd.com/371/
Serious request here please consider expanding any and all acronyms after this. I had no idea what AV meant and there may be others out there who are lost just like I was.
Quote
Watch this video ...
What, after you mention Adult Videos ?  Ok, I watched it, very unexpected. I note that you have only 166 Examples available. Are you sure you are using lazarus-main from the Official Lazarus gitlab site ?  https://gitlab.com/freepascal.org/lazarus/lazarus  ?
There should be about 205 Example Projects, has been for over six months.
See..? I was not fibbing and I am not sure which branch I am on but I will now delete everything and start from scratch with lazarus-main.

Or, perhaps, are you running very old hardware that is not updating in time ?
Here you go this is  my setup: system info bare metal and friends you tell me if it's ancient hardware or not.

I wonder if I should have a checkbox, "Do NOT SWYT" for people who's systems are not capable of keeping up with the demand.
[/quote] Please don't not even in jest. Never discourage anyone from exploring the codebase or going bald by doing so. Some folks take things literally and may simply walk away after reading something like "Do NOT SWYT"

OK, so, now you have had time, what do you think of the cool (but no coolbar) fp text IDE ?
First impression was omg this is sweet. I am yet to do anything useful with it. But definitely beautifully designed text interface very impressive. Now Luke has to get text mode fp ide to talk to the mouse. Just kidding mouse works fine in my shell/terminal.  :D

Aruna

  • Full Member
  • ***
  • Posts: 119
Re: Juggling Multiple Lazarus Projects
« Reply #29 on: December 05, 2022, 01:25:38 pm »
So what is the latest with your ExamplesWindow bug? In a new thread of course :)
I created a new thread "Bugs in Example Projects window".

BTW, please provide your fixed / improved version of the TestAll project at some point so we can add it to lcl/tests or somewhere.
The latest changes in "main" for TestAll before it was deleted should be included.
Hi Juha I will be happy to send it in please give me a little more time.

 

TinyPortal © 2005-2018