You are not logged in.

#1 2017-03-14 17:32

JimW
Member
Registered: 2015-12-08
Posts: 400

Gambas

Many years ago, when I was a young lad, I used to do some personal programming with Visual Basic 5 and 6. I have now forgotten almost everything I knew at that time.
I decided to download Gambas and try my hand at doing some programming with it. Noting professional, just some small utilities and games for my personal use, but I'm having difficulty even getting started. So far I haven't even been able to run one of the example programs. Is there some trick that I am over looking?
And, does anyone know of a "Learning Gambas" download or video? Most of what I have found are in foreign languages or are just a "Hello World" type video. Altho the "Hello World" may be a starting point it isn't what I'm looking for.

Offline

#2 2017-03-14 21:26

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Gambas

A quick google gave me this page although it's not so much a tutorial as (to my reading) a reason not to use it.

From a personal view I have found python to be extremely easy to learn as there is soooo much learning information available and whenever i get stuck a quick search on stack overflow usually gives me the answer I needed. I would definitely recommend python to anyone starting out (or over) in programming as it is very structured has huge resources and you can create working programs pretty quickly. I am not (and never have been) into serious programming but I like to be able to create something to manage repetitive tasks quickly and easily and also use a lot of bash scripts to achieve the same goal.

With that said there are also many tutorials and learning sites for most other languages but gambas seems to be somewhat lacking and my guess would be the reasons laid out in the article I linked to, but if you persevere and find it useful please let me know and I might look further into it myself when I have more free time. smile

Offline

#3 2017-03-15 02:19

MC
Member
Registered: 2015-12-23
Posts: 182

Re: Gambas

Hi JimW.

Did you try the Wikipedia page? There are about 10 links at the bottom of the page under "Further Reading" and "External Links".

https://en.wikipedia.org/wiki/Gambas#External_links

Hope this helps.


Q4OS running Xfce

Offline

#4 2017-03-15 03:26

JimW
Member
Registered: 2015-12-08
Posts: 400

Re: Gambas

Thanks Dia and MC,
I'll keep looking at Gambas for a while. I may decide to give Python a try like Dia recommends tho I'm not planning on doing anything spectacular or for production. I also don't plan on devoting a lot of time to making  a short utility program! smile
I do some things in bash with scripts, but some things I know I can do in basic that are rather difficult to do in a script (or at least for me and what I remember).
One thing I want to do is make a large digital clock, easy to do in basic, but haven't figured out how in a script! (my old eyes are getting tired of straining to see that darned clock in the lower right corner!).

Offline

#5 2017-03-15 10:05

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Gambas

JimW wrote:

One thing I want to do is make a large digital clock, easy to do in basic, but haven't figured out how in a script! (my old eyes are getting tired of straining to see that darned clock in the lower right corner!).

I use a conky for this as I usually keep my lower panel quite thin and the clock is not easily visible to me either, It uses a couple of graphics and displays in a readable font size. It may need a tweak or two to get it configured and positioned correctly for your display but might help.

.conkyrc (new style syntax)

conky.config = {
	update_interval = 1,
	total_run_times = 0,
	net_avg_samples = 1,
	cpu_avg_samples = 1,
	imlib_cache_size = 0,
	double_buffer = true,
	no_buffers = true,
	use_xft = true,
	font = "Century Schoolbook:bold:size=40",
	text_buffer_size = 2048,
	own_window = true,
	own_window_transparent = true,
	own_window_type = "override",
	own_window_hints = "undecorated,below,sticky,skip_taskbar,skip_pager",
	alignment = "top_middle",
	gap_x = 0,
	gap_y = 0,
	minimum_width = 292,
	minimum_height = 100,
	maximum_width = 292,
	draw_shades = false,
	default_color = "080808",
	default_shade_color = "1d1d1d",
	color0 = "ffffff",
	color1 = "ffffff",
	color2 = "ffffff",
	short_units = true
}

conky.text = [[
${voffset 18} ${goto 26}${time %H} ${goto 110}${time %M}${goto 221}${time %d}
${font Century Schoolbook:size=9}${voffset -116}${alignc -100}${time %b}
${voffset 38}${alignc -99}${font Century Schoolbook:size=9}${time %A}
${image ~/conky/img/time.png -p 0,10 -s 188x100}${image ~/conky/img/date.png -p 200,10 -s 93x100}]]

The clock
e8cq7dZ.png
time.png
s6Wp9Rs.png
date.png
p95GFeo.png

Last edited by Dai_trying (2017-03-15 10:15)

Offline

#6 2017-03-15 14:47

JimW
Member
Registered: 2015-12-08
Posts: 400

Re: Gambas

Ok, I haven't worked with conky before so I figure I did something wrong. Here is what I got after copy/paste of the above -

Conky: /home/adminq/.conkyrc: 1: no such configuration: 'config'
Conky: /home/adminq/.conkyrc: 4: config file error
Conky: /home/adminq/.conkyrc: 5: config file error
Conky: text_buffer_size must be >=256 bytes
Conky: /home/adminq/.conkyrc: 14: config file error
Conky: /home/adminq/.conkyrc: 15: config file error
Conky: /home/adminq/.conkyrc: 15: config file error
Conky: /home/adminq/.conkyrc: 16: config file error
Conky: /home/adminq/.conkyrc: 19: no such configuration: 'minimum_width'
Conky: /home/adminq/.conkyrc: 20: no such configuration: 'minimum_height'
Conky: /home/adminq/.conkyrc: 21: config file error
Conky: /home/adminq/.conkyrc: 29: no such configuration: '}'
Conky: /home/adminq/.conkyrc: 31: no such configuration: 'conky.text'
Conky: /home/adminq/.conkyrc: 32: no such configuration: '${voffset'
Conky: /home/adminq/.conkyrc: 33: no such configuration: '${font'
Conky: /home/adminq/.conkyrc: 34: no such configuration: '${voffset'
Conky: /home/adminq/.conkyrc: 35: no such configuration: '${image'
Conky: missing text block in configuration; exiting
***** Imlib2 Developer Warning ***** :
        This program is calling the Imlib call:

        imlib_context_free();

so - now what? smile

Offline

#7 2017-03-15 15:11

MC
Member
Registered: 2015-12-23
Posts: 182

Re: Gambas

Do you have conky installed?

sudo apt-get install conky-all

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

Here's another simple clock conky to try:

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_argb_value 0
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_shade_color 112422
short_units yes

override_utf8_locale yes
use_xft yes
xftfont Tall Films:size=10
xftalpha 1
uppercase yes

color1 00b200
color2 DD3946
color3 EDD077
color4 ca0202  # red
color5 9b9b9b
color6 000000
color7 578EEA

own_window_colour 000000

minimum_size 100 20
maximum_width 450

alignment tr
gap_x 28
gap_y 48

TEXT

${color6}${font sans:bold:size=48}${time %l:%M %p}

It will show up on the top right of your screen, like this, and can be adjusted to any size or position on your screen:

ba590a538354842.jpg


Q4OS running Xfce

Offline

#8 2017-03-15 15:26

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Gambas

Sorry, I posted using the new style syntax for conky as I mainly use Scorpion now, here is the old-style for you to try

update_interval 1
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1
imlib_cache_size 0
double_buffer yes
no_buffers yes
use_xft yes
xftfont Century Schoolbook:bold:size=40
text_buffer_size 2048
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
alignment top_middle
gap_x 0
gap_y 0
minimum_size 292,100
maximum_width 292
draw_shades no
default_color 080808
default_shade_color 1d1d1d
color0 ffffff
color1 ffffff
color2 ffffff
short_units yes


TEXT
${voffset 18} ${goto 26}${time %H} ${goto 110}${time %M}${goto 221}${time %d}
${font Century Schoolbook:size=9}${voffset -116}${alignc -100}${time %b}
${voffset 38}${alignc -99}${font Century Schoolbook:size=9}${time %A}
${image ~/conky/img/time.png -p 0,10 -s 188x100}${image ~/conky/img/date.png -p 200,10 -s 93x100}

And you will notice the images should be located in ~/conky/img/ if you want to change the location just adjust it in the last line of the conky.

Offline

#9 2017-03-15 15:57

JimW
Member
Registered: 2015-12-08
Posts: 400

Re: Gambas

Ok, the simple one does not work either - gets a sigterm and exits. But the last one works! Thanks. smile
Now I can see what time it is without straining my eyesight!

Offline

#10 2017-03-15 17:52

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Gambas

You're welcome smile

Offline

Board footer

Powered by FluxBB