Recent

Author Topic: Example projects window  (Read 45676 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4106
  • I like bugs.
Example projects window
« on: December 29, 2021, 01:55:57 pm »
This is moved from the "Lazarus Object Inspector is inactive" thread.

So, do we want a quick and easy fix or a full coverage -
* redesign the GUI
* provide a category system for all examples, maybe in the (compulsory) readme file ?
Yes, a readme file is already shown in a memo if it exists. A "Category: xxx" syntax can be added. Later somebody could add a proper readme file for all example projects.

Quote
* Copy the deb/rpm installed example to user space when 'chosen' by the user.
That sounds strange. Why should we use Linux distro package system for Lazarus examples?

Quote
Thats quite a significant change, I'm not keen to get stared unless there is some indication its the way we really want to go ??
The GUI can be improved at the same time while wp or others improve the actual example projects.
My idea of the necessary "Example Projects" window improvements:
  • Register an options pane into the global options window. Move subdirectory selection there. Use wildcards in directory names. Add an "Options" button in the GUI to open it directly.
  • The window would be more useful as modeless. A user can try many examples while keeping the window open. Then it should be opened from View menu instead of Tools menu.
  • A ListView with more columns can be used instead of a ListBox. I remember then years ago ListView had serious bugs.
  • A single selection should be enough. There was some clever idea with multi-selection but I forgot what it was.
  • Before opening an example project from a read-only directory, it should be copied under Lazarus local config directory, the same way as a rebuilt Lazarus binary is placed there. See https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/37509

I attached a mockup GUI following my idea. It is simple.
« Last Edit: December 29, 2021, 03:48:32 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dseligo

  • Hero Member
  • *****
  • Posts: 719
Re: Example projects window
« Reply #1 on: December 29, 2021, 03:47:07 pm »
I like Online Package Manager tool.
It would be nice if similar tool would exist for examples (maybe in Help menu of Lazarus).

It would be fast and easy way to get to the examples and easy to point someone to.

And examples could be 'live' - when someone make new example project  (or update it), it would be available in this tool.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4106
  • I like bugs.
Re: Example projects window
« Reply #2 on: December 29, 2021, 04:04:44 pm »
I like Online Package Manager tool.
It would be nice if similar tool would exist for examples (maybe in Help menu of Lazarus).
It would be fast and easy way to get to the examples and easy to point someone to.
And examples could be 'live' - when someone make new example project  (or update it), it would be available in this tool.
Online example projects. Yes, it is a good idea. It could use the same framework with Online Package Manager. Maybe GetMem has an idea.
Sometime in future OPM should use the the fppkg system and allow authors to upload their packages (+ maybe example projects).

Online example projects is a separate and bigger project. The current window should be simplified and improved in any case.

A proper menu for example projects is tricky. Help menu is for actual help data so far. Project menu is now about the current project only.
Opinions are welcome.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

af0815

  • Hero Member
  • *****
  • Posts: 1024
Re: Example projects window
« Reply #3 on: December 29, 2021, 05:06:33 pm »
Maybe some ideas from the actual Example-Screen and OPM. And help is not Example, and can reference to the example system.

BTW, is the fppkg system for Lazarus too ? OPM is well known in Lazarus, but fppkg more a hidden secret system for IMHO the most user.
« Last Edit: December 29, 2021, 05:10:42 pm by af0815 »
regards
Andreas

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4106
  • I like bugs.
Re: Example projects window
« Reply #4 on: December 29, 2021, 05:21:48 pm »
Maybe some ideas from the actual Example-Screen and OPM.
Do you mean ideas for an Online Example Project system?

Quote
And help is not Example, and can reference to the example system.
Do you mean the Help menu should have entries for example projects, too?

Quote
BTW, is the fppkg system for Lazarus too ? OPM is well known in Lazarus, but fppkg more a hidden secret system for IMHO the most user.
The design goal was that fppkg supports both FPC and Lazarus code. It does not work well yet. It only has a small set of FPC packages to test with. I don't know more about the technical challenges there.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

af0815

  • Hero Member
  • *****
  • Posts: 1024
Re: Example projects window
« Reply #5 on: December 29, 2021, 09:30:26 pm »
Maybe some ideas from the actual Example-Screen and OPM.
Do you mean ideas for an Online Example Project system?
Yes, you must be able to search by a keyword. In the ExampleProjects , this is often done by enter few letters and you hope to find a project with this word :-)

OPM is IMHO based on a json, with a lot more features and information. So a keyword based search is more possible. A program can use eventually the information from VersionsInfo to make it similar to a package in OPM.

Quote
And help is not Example, and can reference to the example system.
Do you mean the Help menu should have entries for example projects, too?
Yes or inserted links to the sample projects. Or the keywords can bypassed from lhelp to the sampleproject manager.

Quote
BTW, is the fppkg system for Lazarus too ? OPM is well known in Lazarus, but fppkg more a hidden secret system for IMHO the most user.
The design goal was that fppkg supports both FPC and Lazarus code. It does not work well yet. It only has a small set of FPC packages to test with. I don't know more about the technical challenges there.
But to change a well working system to a 'not well working' system, is not a target. And the actual OPM system is stable. So if you want to seperate the samples from Lazarus, you should use a stable base. Actual i think a fast way is to use the technique of OPM and start. On the other side you have to wait for a realy working fppkg system (for Lazarus too). I think fppkg will make a brake through with dynamics packages in the future.
 
regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8260
  • Debugger - SynEdit - and more
    • wiki
Re: Example projects window
« Reply #6 on: December 29, 2021, 10:30:58 pm »
I like Online Package Manager tool.
It would be nice if similar tool would exist for examples (maybe in Help menu of Lazarus).

I don't think we need a new tool for that.

If someone want to provide examples, the OPM can be used as it.
- Just make an empty package
- create an example folder in the package
- put your examples into that folder
- get the package added to OPM

The only thing that needs to be done, is for the "example window" in the IDE, to search all the <packagedir>/example/ folders (optional).

If (and that is an "if and only if") this takes off (i.e. if contributor pop up, and create example packages) the OPM window can easily have a button added "open example manager" (and set a filter for the examples of the selected package). But that is an "if and only if". No point adding, unless there will be packages with examples.

Doing it via opm, and the "example window" searching packages, also offers the advance that existing packages (e.g. packages that add new components), can include examples for those components.




That said, it will still be a good idea to have some examples included in the IDE distro itself. So that still needs addressing.

And, no matter if packages come via OPM or are included, if they should be presented, that presentation may need to be polished. And that presentation is the "example window"


wp

  • Hero Member
  • *****
  • Posts: 10060
Re: Example projects window
« Reply #7 on: December 29, 2021, 11:31:18 pm »
Sorry, Martin. This is not a good idea: It will be an unacceptable burdon to GetMem who handles all the additions to OPM manually. And unless "examples" are separated from "components" in some kind of GUI, components will be buried underneath loads of examples.

dbannon

  • Hero Member
  • *****
  • Posts: 2080
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Example projects window
« Reply #8 on: December 29, 2021, 11:57:44 pm »
Quote
Quote
* Copy the deb/rpm installed example to user space when 'chosen' by the user.
That sounds strange. Why should we use Linux distro package system for Lazarus examples?

Because, from what I understand, one of the issues in the bug report is that end users who install Lazarus using deb/rpm/pakman etc end up with it all in Read Only space.  Its not a packaging thing, its a ReadOnly issue. So, if they try a build an example project, it cannot write. I, personally always build from source but lots and lots of people install distro packages.

This, of course a *nix problem and WP is a Windows user. Hmm....

I like the other suggestions made.

WP, the category model ?  I'd really like to see all the examples have a readme file (and its contents displays as per the existing GUI) and that seems like a great way to categorize them at the same time. And maybe some keywords ?  So, maybe the first two line of the readme has (eg) -

Category : beginner
Keywords : buttons, memo

Categories need to be agreed on, [ beginner, example, test ...]

Davo



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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1988
  • Former Delphi 1-7, 10.2 user
Re: Example projects window
« Reply #9 on: December 30, 2021, 12:11:04 am »
My two cents worth:

1) Remove all the examples from the distributions
2) Add an Examples entry to the Lazarus IDE Help menu (separate FPC and Lazarus?)
3) Link to a to-be-created Wiki page which lists example category pages
4) Add examples to appropriate yet-to-be-created category pages
5) Example entry in Wiki links to SourceForge/Github/Gitlab for the source for each example

Benefits:

* Reduces distribution size (I didn't even know there were examples)
* Avoids read-only issues
* Adds missing "readme" info
* Allows ANYONE to add examples, info etc
* Removes any load on the dev team(s)
« Last Edit: December 30, 2021, 12:14:00 am by trev »
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 x86_64 Xcode 13.4
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 aarch64 Xcode 13.4

dbannon

  • Hero Member
  • *****
  • Posts: 2080
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Example projects window
« Reply #10 on: December 30, 2021, 02:03:07 am »
....
3) Link to a to-be-created Wiki page which lists example category pages

yes, interesting idea. I'd sure support it if we can be sure (pretty sure) that there is no security/privacy issues happening. Further on this topic below.

> Reduces distribution size (I didn't even know there were examples)
"mostly" in ./examples - 15M

> Avoids read-only issues
Yep

>Allows ANYONE to add examples, info etc
>Removes any load on the dev team(s)
There is a safety,  quality and relevance issue there I have to say. On the other hand, the quality of what we have now is not great due to old content (rather than poor content).  Personally, I am a big believer (and a contributor to) the wiki but this wiki, and all wikis do tend to drift into chaotic quite quickly.

I see a danger in "anyone" being able to load a project on the wiki, we tell the beginners "go look there" and they download a project that does something nasty. Sorry, I see that as quite a serious danger.

Davo



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

speter

  • Sr. Member
  • ****
  • Posts: 279
Re: Example projects window
« Reply #11 on: December 30, 2021, 05:01:27 am »
This sounds like a good idea.

The forum (presumably) has "classes" of users, does the wiki have similar? Maybe restrict edits to this section of the wiki to people who are forum "Global Moderators" / "Hero Members" (or whatever).

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1988
  • Former Delphi 1-7, 10.2 user
Re: Example projects window
« Reply #12 on: December 30, 2021, 05:20:06 am »
I see a danger in "anyone" being able to load a project on the wiki, we tell the beginners "go look there" and they download a project that does something nasty. Sorry, I see that as quite a serious danger.

You could say the same about any of the existing code on the Wiki and all the FPC + Lazarus projects linked from the Wiki not to mention all the tutorials, components and libraries also linked from the Wiki.
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 x86_64 Xcode 13.4
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 aarch64 Xcode 13.4

dbannon

  • Hero Member
  • *****
  • Posts: 2080
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Example projects window
« Reply #13 on: December 30, 2021, 05:40:29 am »
You could say the same about any of the existing code on the Wiki and all the FPC + Lazarus projects linked from the Wiki not to mention all the tutorials, components and libraries also linked from the Wiki.

No, I disagree, code pasted in a wiki page or appearing in forum are discrete lumps of viewable code. By definition, its reasonably short and lots of people run their eyes over it. That should not be compared to a zip file that could contain many units, thousands of lines of code, frankly, its not going to be checked.

Code, elsewhere, linked from our wiki is not officially endorsed to the same extent. Indeed, I expect there is a disclaimer somewhere, no one reads them anyway....

You must remember that we are talking about, in many cases here, rank beginners. Ones who will follow instructions, line by line.

Having some sort of barrier is, IMHO, necessary and we would be considered as failing in our duty of care we did not have a proper process in place. I am definitely not against the idea, it just needs to be done appropriately.

I am assuming there is a way (and people are happy) to make the wiki allow uploads of zip files ?  Or do we need an alternative location. Hmm, gitlab ?

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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1988
  • Former Delphi 1-7, 10.2 user
Re: Example projects window
« Reply #14 on: December 30, 2021, 05:49:40 am »
You could say the same about any of the existing code on the Wiki and all the FPC + Lazarus projects linked from the Wiki not to mention all the tutorials, components and libraries also linked from the Wiki.

No, I disagree, code pasted in a wiki page or appearing in forum are discrete lumps of viewable code. By definition, its reasonably short and lots of people run their eyes over it. That should not be compared to a zip file that could contain many units, thousands of lines of code, frankly, its not going to be checked.

I never advocated a ZIP file - I advocated links to SourceForge et al code repos.

Quote
I am assuming there is a way (and people are happy) to make the wiki allow uploads of zip files ?  Or do we need an alternative location. Hmm, gitlab ?

Again, I never advocated either ZIP files or uploading them to the Wiki.

You seem to have setup a straw man just so you could demolish it :)
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 x86_64 Xcode 13.4
Lazarus 2.3, FPC 3.3.1 macOS 12.3.1 aarch64 Xcode 13.4

 

TinyPortal © 2005-2018