English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. System (https://eab.abime.net/forumdisplay.php?f=113)
-   -   GUI toolkit alternatives (https://eab.abime.net/showthread.php?t=84279)

bwldrbst 29 September 2016 15:39

GUI toolkit alternatives
 
Over the last few months I've been working on a pretty light weight Dock application intended to work on 3.0 or 3.1 systems. I'm a fan of BetterWB (and my most powerful real Amiga is an A2000 with and 030 and 10MB RAM) so the idea is to have something that fits in with it.

A picture of the dock as it currently looks can be seen at https://www.dropbox.com/s/tlxvb85y5v...60929.png?dl=0

Each object shown on the dock is implemented as a BOOPSI class that is responsible for rendering and responding to user actions. The object can respond to clicks, dropped workbench icons or a hotkey.

The icon button class is built in to application but the clock and memory meter in the linked image are loaded dynamically based on the config file.

One part that I haven't really decided on is the GUI for the preferences application. I'd like to have it dynamic so that each object can provide it's own config UI.

I've considered using MUI but would prefer something a bit lighter.

Are there any GUI libraries around that make it easy to add and remove gadgets to a window at run time?

Korodny 29 September 2016 18:18

Quote:

Originally Posted by bwldrbst (Post 1113880)
Over the last few months I've been working on a pretty light weight Dock application intended to work on 3.0 or 3.1 systems.

Looks nice.

Quote:

Are there any GUI libraries around that make it easy to add and remove gadgets to a window at run time?
Can't really help you with that, two somewhat popular (i.e. I occasionally encountered programs using them) alternative GUI toolkits that were more lightwight than MUI/Classact were gtlayout and BGUI, they're both on Aminet. No idea if they do what you want though.

How about just adding a context sensitive popup menu using popupmenu.library? Checkmarks for "show handlebar/clock/memmeter", an entry for adding a new object to the dock plus a bunch of options (change icon/executable/helptext, remove object etc.) for the current item? The actual requesters could then be simple ASL/gadtools affairs for entering text, picking a file etc.

thomas 29 September 2016 18:19

As you are already working with BOOPSI you might want to have a look at ClassAct:
http://aminet.net/package/dev/gui/ClassAct2Demo
http://aminet.net/package/dev/gui/classact33

The SDK is not publicly available but the examples compile smoothly with the OS 3.9 NDK if you replace all mentions of CA_ by RA_ and classact by reaction.
http://www.haage-partner.de/download/AmigaOS/NDK39.lha

buggs 07 October 2016 07:55

Quote:

Originally Posted by bwldrbst (Post 1113880)
Over the last few months I've been working on a pretty light weight Dock application intended to work on 3.0 or 3.1 systems. I'm a fan of BetterWB (and my most powerful real Amiga is an A2000 with and 030 and 10MB RAM) so the idea is to have something that fits in with it.

A picture of the dock as it currently looks can be seen at https://www.dropbox.com/s/tlxvb85y5v...60929.png?dl=0

Each object shown on the dock is implemented as a BOOPSI class that is responsible for rendering and responding to user actions. The object can respond to clicks, dropped workbench icons or a hotkey.

The icon button class is built in to application but the clock and memory meter in the linked image are loaded dynamically based on the config file.

One part that I haven't really decided on is the GUI for the preferences application. I'd like to have it dynamic so that each object can provide it's own config UI.

I've considered using MUI but would prefer something a bit lighter.

Are there any GUI libraries around that make it easy to add and remove gadgets to a window at run time?

Looks good, already. I'd love to see animation support (like Toolmanager 2.1). Also, variable size tiles might be worth a thought.

bwldrbst 07 October 2016 15:50

2 Attachment(s)
So I've been playing around a bit with Triton as it appears to be just a light wrapper around gadtools and boopsi gadgets. The preferences editor is currently looking like this:

Attachment 50326

The plan is to have it support dropping of icons and displaying of icons in the prefs editor.

I'll probably change the dock to support tiles the same size as the icons. Simple animation is possible as each gadget in the dock receives a TICK message several times a second and can request a redraw at that time. This is used to display the icon's alternate image when it is clicked:

Attachment 50327

I've run into a couple of gotchas with Triton: it doesn't seem to deal with TagItem lists in the intended way and won't work if you're trying to append tags using TAG_MORE. Also, even though it provides a way to display a BOOPSI image within the UI there doesn't seem to be a way to actually access the image instance (to, for example, hand my custom image class an icon to render) so unless I'm missing something I'm not sure what use it is.

hth313 19 June 2019 18:09

Old thread, but I wonder if this Dock app was ever completed and if it can be found on Github or something?

AMIGASYSTEM 19 June 2019 18:21

Quote:

Originally Posted by hth313 (Post 1328125)
Old thread, but I wonder if this Dock app was ever completed and if it can be found on Github or something?


https://github.com/adkennan/DockBot

hth313 19 June 2019 19:26

Quote:

Originally Posted by AMIGASYSTEM (Post 1328127)

Cool, thanks!

bwldrbst 20 June 2019 01:19

Wow, that's interesting timing... I got distracted working on something else and never got around to tidying this up for release. I've been using it myself for years though.

Over the last couple of weeks I've picked it up again and have been getting it ready - fixing a couple of bugs, writing a manual and an installer. I'll hopefully upload it it Aminet in the next day or so.

hth313 20 June 2019 04:11

Nice, please consider making a release at github as well, and thank you for putting it on github in the first place.

bwldrbst 20 June 2019 15:18

Quote:

Originally Posted by hth313 (Post 1328224)
Nice, please consider making a release at github as well

Done!

Quote:

Originally Posted by hth313 (Post 1328224)
and thank you for putting it on github in the first place.

You're welcome. The more source code available, the better :)

hth313 20 June 2019 21:47

I hope it is OK to request support here... :)

It will not start as it wants
parm.library
which is included in the
.lha
, but not installed into
libs:
or the place it installs DockBot, it seems.

Fixing that (assignd add
libs:
) and it does not start for me, but that might be due to my setup. I use AROS and do not launch any workbench (replacement), there is a screen called Workbench without anything particular on it and a shell window. What I want to do is to use DockBot as part of a desktop setup without any WB replacement, to get a useful and lightweight setup.

Launching
DockBotPrefs
results in a "Couldn't load config." requester and termination. There is a
DockBot.prefs
file in both
ENV:
and
ENVARC:
.

Regarding the icon library, I tried both the one that comes with AROS and the one in icon library 46 (I just copied the icon.library for 68020 and renamed it). Maybe it is my environment here and I do not know how to debug this in a good way.

hth313 20 June 2019 21:50

Quote:

Originally Posted by bwldrbst (Post 1328278)
You're welcome. The more source code available, the better :)

:great

bwldrbst 21 June 2019 00:38

Quote:

Originally Posted by hth313 (Post 1328357)
I hope it is OK to request support here... :)

That's fine. I knew it wouldn't work!

Quote:

Originally Posted by hth313 (Post 1328357)
It will not start as it wants
parm.library
which is included in the
.lha
, but not installed into
libs:
or the place it installs DockBot, it seems.

Doh.

Quote:

Originally Posted by hth313 (Post 1328357)
Fixing that (assignd add
libs:
) and it does not start for me, but that might be due to my setup. I use AROS and do not launch any workbench (replacement), there is a screen called Workbench without anything particular on it and a shell window. What I want to do is to use DockBot as part of a desktop setup without any WB replacement, to get a useful and lightweight setup.

I've not tried it on AROS at all.

Quote:

Originally Posted by hth313 (Post 1328357)
Launching
DockBotPrefs
results in a "Couldn't load config." requester and termination. There is a
DockBot.prefs
file in both
ENV:
and
ENVARC:
.

Strange. It might be masking the real error.

Quote:

Originally Posted by hth313 (Post 1328357)
Regarding the icon library, I tried both the one that comes with AROS and the one in icon library 46 (I just copied the icon.library for 68020 and renamed it). Maybe it is my environment here and I do not know how to debug this in a good way.

Can you see if the v46 icon library is being loaded and used?

Thanks,

Andrew

hth313 21 June 2019 01:59

I used SnoopDos on DockBotPrefs with the following result
Code:

Count Process Name      Action    Target Name                Options Res.                                                                                                                    ?·························
----- ------------      ------    -----------                ------- ----                                                                                                                    ?·························
1    [1] DockBotPrefs  OpenLib    intuition.library          Ver 0  OK                                                                                                                      ?·························
2    [1] DockBotPrefs  OpenLib    PROGDIR:dockbot.library    Ver 1  OK                                                                                                                      ?·························
3    [1] DockBotPrefs  OpenLib    triton.library              Ver 2  OK                                                                                                                      ?·························
4    [1] DockBotPrefs  Open      env:Triton/DockBotPrefs.app Write  OK                                                                                                                      ?·························
5    [1] DockBotPrefs  Open      env:Triton/DockBotPrefs.tri Read    Fail                                                                                                                    ?·························
6    [1] DockBotPrefs  Open      env:Triton/__GLOBAL__.tri  Read    Fail                                                                                                                    ?·························
7    [1] DockBotPrefs  OpenLib    utility.library            Ver 37  OK                                                                                                                      ?·························
8    [1] DockBotPrefs  Open      env:Triton/DockBotPrefs.win Read    OK                                                                                                                      ?·························
9    [1] DockBotPrefs  OpenFont  topaz.font                  Size 8  OK                                                                                                                      ?·························
....                                                                                                                                                                                            ?·························
43    [1] DockBotPrefs  OpenFont  topaz.font                  Size 8  OK                                                                                                                      ?·························
44    [1] DockBotPrefs  Open      ENV:DockBot.prefs          Read    OK                                                                                                                      ?·························
45    [1] DockBotPrefs  OpenLib    PROGDIR:Gadgets/DockClock.c Ver 1  OK                                                                                                                      ?·························
46    [1] DockBotPrefs  OpenLib    PROGDIR:Gadgets/DockMem.cla Ver 1  OK                                                                                                                      ?·························
47    [1] DockBotPrefs  OpenLib    PROGDIR:Gadgets/DockButton. Ver 1  Fail                                                                                                                    ?·························

Starting DockBot itself gives the following output:

Code:

Count Process Name      Action    Target Name                Options Res.                                                                                                                    ?·························
----- ------------      ------    -----------                ------- ----                                                                                                                    ?·························
1    [1] execute        Open      DockBotStart                Read    OK                                                                                                                      ?·························
2    [1] AROS:Tools/Doc OpenLib    parm.library                Ver 9  OK                                                                                                                      ?·························
3    [1] AROS:Tools/Doc OpenLib    locale.library              Ver 38  OK                                                                                                                      ?·························
4    [1] AROS:Tools/Doc ChangeDir  AROS:Tools/DockBot                                                                                                                                          ?·························
5    [1] AROS:Tools/Doc Open      DockBot.info                Read    OK                                                                                                                      ?·························
6    [1] AROS:Tools/Doc ToolType  CLI                                Fail                                                                                                                    ?·························
7    [1] AROS:Tools/Doc ToolType  TOOLPRI                            Fail                                                                                                                    ?·························
8    [1] AROS:Tools/Doc ChangeDir  AROS:Tools/DockBot                                                                                                                                          ?·························
9    [1] AROS:Tools/Doc ChangeDir  AROS:Tools/DockBot                                                                                                                                          ?·························
10    [1] AROS:Tools/Doc Load      DockBot                            OK                                                                                                                      ?·························
11    [1] AROS:Tools/Doc ChangeDir  AROS:Tools/DockBot                                                                                                                                          ?·························
12    DockBot            ChangeDir  AROS:Tools/DockBot                                                                                                                                          ?·························
13    DockBot            OpenLib    icon.library                Ver 0  OK                                                                                                                      ?·························
14    DockBot            Open      con:10/10/320/80/DockBot/au Write  OK                                                                                                                      ?·························
15    DockBot            Open      *                          Read    OK                                                                                                                      ?·························
16    DockBot            FindPort  DockBot                            Fail                                                                                                                    ?·························
17    DockBot            OpenLib    PROGDIR:dockbot.library    Ver 1  OK                                                                                                                      ?·························
18    DockBot            OpenLib    graphics.library            Ver 39  OK                                                                                                                      ?·························
19    DockBot            OpenLib    layers.library              Ver 39  OK                                                                                                                      ?·························
20    DockBot            OpenLib    intuition.library          Ver 39  OK                                                                                                                      ?·························
21    DockBot            OpenLib    gadtools.library            Ver 39  OK                                                                                                                      ?·························
22    DockBot            OpenLib    workbench.library          Ver 39  OK                                                                                                                      ?·························
23    DockBot            OpenLib    commodities.library        Ver 39  OK                                                                                                                      ?·························
24    DockBot            OpenDev    timer.device                Unit 1  OK                                                                                                                      ?·························
25    DockBot            Open      ENV:DockBot.prefs          Read    OK                                                                                                                      ?·························
26    DockBot            OpenLib    PROGDIR:Gadgets/DockClock.c Ver 1  OK                                                                                                                      ?·························
27    DockBot            OpenLib    PROGDIR:Gadgets/DockMem.cla Ver 1  OK                                                                                                                      ?·························
28    Lib & Dev Loader D OpenLib    intuition.library          Ver 39  OK                                                                                                                      ?·························
29    Lib & Dev Loader D OpenLib    dockbot.library            Ver 1  OK                                                                                                                      ?·························
30    Lib & Dev Loader D OpenLib    graphics.library            Ver 37  OK                                                                                                                      ?·························
31    DockBot            OpenLib    PROGDIR:Gadgets/DockButton. Ver 1  Fail                                                                                                                    ?·························
32    Intuition menu han OpenFont  topaz.font                  Size 8  OK                                                                                                                      ?·························
33    Intuition menu han OpenFont  topaz.font                  Size 8  OK


hth313 21 June 2019 08:05

So it turns out that I did not have the correct icon library. AROS provides version 44 and the button gadget class requires 45, so it stops without saying anything.

I tried LoadResource on the v45 icon library, but it was a no go. Instead I built a new kickstart without icon.library, to allow it to load the v45 one from
libs:
.

This made the prefs tool work. DockBot itself does not start as it expects to find
System:
and I do not have that. It think it should be
SYS:
?

I added an assignment to solve that and then it crashes randomly. Sometimes the dock comes up, but trying to start a shell causes a "Corrupt memory list detected" error, but the shell comes up. Sometimes it just crashes when starting DockBot itself.

That prefs tool look quite tidy, I think this Triton is good?

bwldrbst 21 June 2019 11:04

Awesome, thanks for your help.

The reference to "System:" is actually in the default prefs file. I'll change it to SYS:. It's a text file so you can edit it yourself.

The corrupt memory list bit is a worry. I wonder if I'm doing something dumb that hasn't affected me but AROS doesn't like.

Triton seems pretty neat. It's kind of MUIish wrapper around Gadtools and existing BOOPSI classes, I think. It's certainly much lighter than some of the alternatives.

bwldrbst 21 June 2019 17:02

I've created a new release and actually tried running it on a fresh 3.1 install with just icon.library.

I still can't promise it will work on AROS but if you can get me a minimal setup of it that I can run in fs-uae I can try to work out what's going on.

Cheers,

Andrew

hth313 21 June 2019 19:01

The new release works great. No crashes here as I played around with it. Many thanks!

I will see how I can incorporate it into my setup here as I am just starting out to create a custom work environment (to replace the Workbench). I am developing a tool to allow me to open and handle multiple public screens dynamically. Do you think it would be simple to extend DockBot to exist on multiple (public) screens?

In the source
DB_METHOD_DM(EDITORUPDATE, DockMessageEditorUpdate)
allocates memory chunks for strings without checking that it got a valid pointer back.

bwldrbst 22 June 2019 01:51

That's good to hear, I'm glad it works for someone other than me!

Thanks for pointing out the potentially dangerous allocations. I've had a quick look and there's a couple more scattered about the place.


All times are GMT +2. The time now is 15:42.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.08339 seconds with 11 queries