Wanna Make Myself a "Widget"... but (OXT Lite)

A forum to share your demonstrations stacks, fun stacks, games, etc.
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

So I wanna slap together the smallest widget that I can that's got the weather, the news, maybe the stock market, possibly Gemini-esque junk (sounds like I can get an API key) and... that's the problem. If this thing interfaces with the Web, which it'd need to do, is the Web bit of OXT Lite (specifically, I am guessing is what I'll use) up for it? Up to date and Chromium and all that jazz?

I seem to remember talk of OXT Lite either going to another simpler lib, or something. Maybe Paul's edition would be the better idea.

So, instead of having 20 "apps" that all do one thing, I wanna make one that does them all. But it has to be able to fetch info from the Web, securely.

Hopefully that makes sense :lol:

Input from tperry2x and OpenXTalkPaul would be appreciated!
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
tperry2x
Posts: 1991
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by tperry2x »

As long as you aren't expecting linux users to use the browser widget, then I'd say you should be fine to use either OXT or OXT Lite.

This is only because, on OXT and OXT Lite, you'd have problems...
(or rather, users opening the stack / standalone produced with OXT & OXT Lite) would have problems in Linux.

You should be all good on Windows and MacOS though as far as I'm aware.
I'd very much appreciate a tutorial / walkthrough of how to actually do this too.
User avatar
OpenXTalkPaul
Posts: 1872
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by OpenXTalkPaul »

overclockedmind wrote: Tue Mar 26, 2024 7:52 am So I wanna slap together the smallest widget that I can that's got the weather, the news, maybe the stock market, possibly Gemini-esque junk (sounds like I can get an API key) and... that's the problem. If this thing interfaces with the Web, which it'd need to do, is the Web bit of OXT Lite (specifically, I am guessing is what I'll use) up for it? Up to date and Chromium and all that jazz?

I seem to remember talk of OXT Lite either going to another simpler lib, or something. Maybe Paul's edition would be the better idea.

So, instead of having 20 "apps" that all do one thing, I wanna make one that does them all. But it has to be able to fetch info from the Web, securely.

Hopefully that makes sense :lol:

Input from tperry2x and OpenXTalkPaul would be appreciated!
By 'Widget', I'm guessing you mean using the Browser Widget, and don't mean writing an Extension Builder Widget module?

I've had the Browser Widget work OK for me on some Linux, but it goes all nutty on others.
User avatar
tperry2x
Posts: 1991
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by tperry2x »

I might have the wrong end of the stick here.

I thought of a way to maybe achieve a floating weather forecast stack (if that's what you wanted).

You could have this as a regular stack, with a custom window shape - perhaps a mask PNG, with a subtle blur to fade it into your desktop.

It could read HTTPS data every x minutes from a site that contains open-source weather data.

You could then write some custom script to translate the data into a format you can use and store in variables etc.

Then, have weather graphics that position themselves via script, depending on the data received.

If that's not what you mean, and I've got the wrong idea - can I clarify as what you mean by a widget. Do you mean making a widget that appears in the tools palette instead, that users can drop into their stacks?

There's lots of ways you could get Https data, using commands through the shell function that are common to all OSs (or at least return identical data with slightly varying shell syntax).
That way, you don't have to use a browser widget at all. You can also set the hideconsolewindows to true to stop any terminal / shell command windows from popping up.

I wouldn't necessarily advise using the built in URL reading commands included in the IDE as timeouts and things need to be handled. Running the fetch data commands through the shell function takes care of all of that by the OS for you.
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

OpenXTalkPaul wrote: Tue Mar 26, 2024 9:42 pm
overclockedmind wrote: Tue Mar 26, 2024 7:52 am So I wanna slap together the smallest widget that I can that's got the weather, the news, maybe the stock market, possibly Gemini-esque junk (sounds like I can get an API key) and... that's the problem. If this thing interfaces with the Web, which it'd need to do, is the Web bit of OXT Lite (specifically, I am guessing is what I'll use) up for it? Up to date and Chromium and all that jazz?

I seem to remember talk of OXT Lite either going to another simpler lib, or something. Maybe Paul's edition would be the better idea.

So, instead of having 20 "apps" that all do one thing, I wanna make one that does them all. But it has to be able to fetch info from the Web, securely.

Hopefully that makes sense :lol:

Input from tperry2x and OpenXTalkPaul would be appreciated!
By 'Widget', I'm guessing you mean using the Browser Widget, and don't mean writing an Extension Builder Widget module?

I've had the Browser Widget work OK for me on some Linux, but it goes all nutty on others.
Think a weather forecast getter with a whole lot of other different tabs for notes, all the junk I mentioned... but with a minimalist UI (maybe a tab per thingy)

Like a 90's version that's UI minimalist that doesn't pop fade whiz bang bounce and etc.

But yes, I do mean the Browser Widget. What's the best way we have for a non-"nutty" Browser Widget? Could we at least update the one we've got?
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

tperry2x wrote: Tue Mar 26, 2024 10:25 pm I might have the wrong end of the stick here.

I thought of a way to maybe achieve a floating weather forecast stack (if that's what you wanted).

You could have this as a regular stack, with a custom window shape - perhaps a mask PNG, with a subtle blur to fade it into your desktop.

It could read HTTPS data every x minutes from a site that contains open-source weather data.

You could then write some custom script to translate the data into a format you can use and store in variables etc.

Then, have weather graphics that position themselves via script, depending on the data received.

If that's not what you mean, and I've got the wrong idea - can I clarify as what you mean by a widget. Do you mean making a widget that appears in the tools palette instead, that users can drop into their stacks?

There's lots of ways you could get Https data, using commands through the shell function that are common to all OSs (or at least return identical data with slightly varying shell syntax).
That way, you don't have to use a browser widget at all. You can also set the hideconsolewindows to true to stop any terminal / shell command windows from popping up.

I wouldn't necessarily advise using the built in URL reading commands included in the IDE as timeouts and things need to be handled. Running the fetch data commands through the shell function takes care of all of that by the OS for you.
Ooooh, see my post back to Paul, but there's some good stuff in here (do it on the command-line, not the Widget.)

I don't actually mind a bit of visual pizazz, but ALL THE THINGS drives me bonkers; just DO IT FOR CRIPE'S SAKE.

So we're thinking like wget/curl/something?
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1872
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by OpenXTalkPaul »

overclockedmind wrote: Wed Mar 27, 2024 12:57 am What's the best way we have for a non-"nutty" Browser Widget? Could we at least update the one we've got?
If using a Linux, use 64bit and used a distro that's known to work OK with the Browser Widget.
It works well enough for me use using Ubuntu Studio with KDE Plasma UI, it seems to work OK with XFCE Xubuntu builds too.
Other Linux distros, like ElementaryOS (which I like for its macOS like vibe, but they do a lot of things differently than other distros) it does weird things, seems to have trouble binding rendering to a stack's window. I think some of these problems may be with Wayland (versus the older X-win compositor). We need more testing to narrow these issues down.

I think Tom/OXT Lite may have updated something with the CEF Framework on Linux?

On macOS (since version 8 IIRC) the Browser Widget uses the macOS WebKit (Safari's engine).

Windows uses the Chromium CEF Framework just like the Linux build, but Windows version doesn't have any of the problems Linux version exhibits.

I don't use OXT for anything that needs to be secure or confidential, but for mixing some HTML /JS embedded within xTalk stack, and for just pulling some weather data available to general public from some site, even a two year old version of CEF Framework should be fine for that sort of thing.

Since you're mostly planning on just pulling data from Web APIs, probably JSON formatted, and then flowing the data into your own UI, you could and you might be better off using libURL or CURL CLI or similar instead of Browser Widget.
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

OpenXTalkPaul wrote: Wed Mar 27, 2024 1:36 am
overclockedmind wrote: Wed Mar 27, 2024 12:57 am What's the best way we have for a non-"nutty" Browser Widget? Could we at least update the one we've got?
If using a Linux, use 64bit and used a distro that's known to work OK with the Browser Widget.
It works well enough for me use using Ubuntu Studio with KDE Plasma UI, it seems to work OK with XFCE Xubuntu builds too.
Other Linux distros, like ElementaryOS (which I like for its macOS like vibe, but they do a lot of things differently than other distros) it does weird things, seems to have trouble binding rendering to a stack's window. I think some of these problems may be with Wayland (versus the older X-win compositor). We need more testing to narrow these issues down.

I think Tom/OXT Lite may have updated something with the CEF Framework on Linux?

On macOS (since version 8 IIRC) the Browser Widget uses the macOS WebKit (Safari's engine).

Windows uses the Chromium CEF Framework just like the Linux build, but Windows version doesn't have any of the problems Linux version exhibits.

I don't use OXT for anything that needs to be secure or confidential, but for mixing some HTML /JS embedded within xTalk stack, and for just pulling some weather data available to general public from some site, even a two year old version of CEF Framework should be fine for that sort of thing.

I mean, for right now, I'm thinking just for me, so there's little to worry over. But you never can be too sure.

Since you're mostly planning on just pulling data from Web APIs, probably JSON formatted, and then flowing the data into your own UI, you could and you might be better off using libURL or CURL CLI or similar instead of Browser Widget.
Mentioning secure and confidential, I don't roll that way either, but say we wanted to save the app state / prefs outside the app in something like an AES-256 file that's password protected (so we could get "more" sensitive.) Any ideas on that kinda nonsense?
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1872
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by OpenXTalkPaul »

overclockedmind wrote: Wed Mar 27, 2024 1:50 am Mentioning secure and confidential, I don't roll that way either, but say we wanted to save the app state / prefs outside the app in something like an AES-256 file that's password protected (so we could get "more" sensitive.) Any ideas on that kinda nonsense?
You can use OpenSSL from shell command, a quick search found this:

Code: Select all

openssl aes-256-cbc -d -md md5 -in /Users/Desktop/encrypted.txt.enc -out /Users/Desktop/decrypted.txt
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

OpenXTalkPaul wrote: Wed Mar 27, 2024 2:13 am
overclockedmind wrote: Wed Mar 27, 2024 1:50 am Mentioning secure and confidential, I don't roll that way either, but say we wanted to save the app state / prefs outside the app in something like an AES-256 file that's password protected (so we could get "more" sensitive.) Any ideas on that kinda nonsense?
You can use OpenSSL from shell command, a quick search found this:

Code: Select all

openssl aes-256-cbc -d -md md5 -in /Users/Desktop/encrypted.txt.enc -out /Users/Desktop/decrypted.txt
Thanks. I know my way around the command line enough for a home server kinda thing, but every command? Pfft.
Should've Googled with the idea "command line" in mind though, my bad.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1872
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by OpenXTalkPaul »

overclockedmind wrote: Wed Mar 27, 2024 2:36 am
OpenXTalkPaul wrote: Wed Mar 27, 2024 2:13 am
overclockedmind wrote: Wed Mar 27, 2024 1:50 am Mentioning secure and confidential, I don't roll that way either, but say we wanted to save the app state / prefs outside the app in something like an AES-256 file that's password protected (so we could get "more" sensitive.) Any ideas on that kinda nonsense?
You can use OpenSSL from shell command, a quick search found this:

Code: Select all

openssl aes-256-cbc -d -md md5 -in /Users/Desktop/encrypted.txt.enc -out /Users/Desktop/decrypted.txt
Thanks. I know my way around the command line enough for a home server kinda thing, but every command? Pfft.
Should've Googled with the idea "command line" in mind though, my bad.
Cool, glad to help. After 24+ years of dealing with Unix(es) (mostly the one underneath macOS) and some Linuxese, I'm still discovering new command lines things on a regular basis. I think I've looked at more command line stuff since getting involved with OXT project then ever before. It seems most things you might want a computer to do can be done from command line, which is great if you like typing lots of text at a command prompt (which I do not).
Further reading:
https://superuser.com/questions/1329658 ... th-openssl
User avatar
tperry2x
Posts: 1991
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by tperry2x »

I had an idea on how we can 'open up' making widgets possible for everyone.
Please see post https://www.openxtalk.org/forum/viewtop ... 7796#p7796
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

This isn't flat out *stopping me* from making what I'm thinking of, but I'd sure have it up and running faster. A LOT FASTER.

Re: the thread you sent me to, just so we don't get completely, er, cross-threaded?
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
tperry2x
Posts: 1991
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by tperry2x »

I think anything that can help or at least make the process of making widgets easier has to be a good thing. It's only a rough idea at the moment, and nothing may come of it - depends on what Paul thinks. I didn't / wasn't meaning to step on his toes - I mean, he's put pages of info together on LC builder that widgets seem to be constructed in, and I didn't like to say 'sorry, I don't get any of that' (I was trying to be polite, funny really - as I tend to upset people most of the time, unintentionally).

But not meaning to ruffle anyone's feathers, and I'm sure that LC builder info makes sense to someone. It's just that I was investigating a potential easier / simpler way of doing things.
User avatar
richmond62
Posts: 3275
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by richmond62 »

On another forum, there was talk about setting up a way to make 'widgers' using ONLY xTalk, and NOT lcb . . .

Of course, at that point one could stop using the slightly ambiguous term 'widget' and simply call them 'new objects'.


Edit by moderator: made some edits to your post, removing a few phrases that we need to be mindful of.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1872
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by OpenXTalkPaul »

richmond62 wrote: Sat Apr 06, 2024 1:51 pm On another forum, there was talk about setting up a way to make 'widgers' using ONLY xTalk, and NOT lcb . . .

Of course, at that point one could stop using the slightly ambiguous term 'widget' and simply call them 'new objects'.


Edit by moderator: made some edits to your post, removing a few phrases that we need to be mindful of.
I'm not against the idea of script-object-based 'Widgets' at all, Extension Builder is not the answer to everything and everyone. Most of the widgets I've made, like the Piano Widget, I had previously implemented in regular xTalk (I even had a HyperCard version of the Piano).
But we can already make custom controls 'widgets' with just regular xTalk/Grouped Controls, which is exactly what the DataGrid stuff is. I think all we really need to do is make the 'Object Library' into a 'Custom Objects'/User Tools palette so its functionality is more readily accessible.
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

OK. If on another forum...

... call it something else.

However, I don't think that in general, we should be comparing notes with... anyone really, unless they clash directly, then we want no such clash.

So yes, make it like XCMD/XFCN (I just spoke HyperCard 2.x) and give it the properly descriptive name, but not the same name.


*I* said widget. What I meant by it is a thing that gives you info you don't want to have to go obtain with a silly app, like Stocks, News, Weather, et al... to death.

I want to combine them all so I don't need twenty-something "apps" to tell me what I need to know for the day.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
richmond62
Posts: 3275
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by richmond62 »

Certainly the term 'widget' is ambiguous and show GO. 'Widget' is used by MacOS for silly on-screen things that distract you from your work.

here's a few fairly daft alternatives:

1. Strap-on.

2. Sidecar.

3. Enhancement Package.

4. Outrider.

5. Rinaldi.
https://richmondmathewson.owlstown.net/
User avatar
overclockedmind
Posts: 300
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by overclockedmind »

A widget was also used in the late 1980s and 1990s (in my locale) to describe the thing that a company spit out. Their product.

That means? OXT is our "widget."

Now, do we have to call it that? No, but it still is.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
tperry2x
Posts: 1991
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Wanna Make Myself a "Widget"... but (OXT Lite)

Post by tperry2x »

Whenever I hear the term widget, I think of the thing that went inside cans of beer (J. Smiths?).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests