Search found 1642 matches

by Shardik
Tue Jul 29, 2025 9:24 am
Forum: Coding Questions
Topic: Scrolling two (or more) ListViewGadgets synchron
Replies: 9
Views: 308

Re: Scrolling two (or more) ListViewGadgets synchron

Are you looking for examples in Windows? If yes you may try these 2 examples:
- al90
- Fluid Byte
by Shardik
Fri Jul 18, 2025 9:12 am
Forum: General Discussion
Topic: Version of PCRE that PureBasic uses?
Replies: 9
Views: 707

Re: Version of PCRE that PureBasic uses?

idle's example was already posted by Fred about 9 years ago... :wink:
by Shardik
Sun May 18, 2025 7:59 am
Forum: Coding Questions
Topic: ListIconGadget Events
Replies: 12
Views: 1312

Re: ListIconGadget Events

I already posted this cross-platform example to get row and column of a clicked cell more than 10 years ago. That example also contains the function GetSelectedColumn() to get the clicked column.

A cross-platform example from this year to get the clicked header column I posted here . In that ...
by Shardik
Sat May 10, 2025 10:00 am
Forum: Coding Questions
Topic: EditorGadget Context Menu
Replies: 3
Views: 550

Re: EditorGadget Context Menu

mk-soft wrote: Fri May 09, 2025 7:00 pm I don't know if that's a bug.

But I miss the standard context menu (copy, cut, paste, etc) as there is with Linux or macOS.
You may take a look into this 10 year old example in which I had taken RASHAD's Windows code and put it into a cross-platform example.
by Shardik
Mon May 05, 2025 10:53 am
Forum: Windows
Topic: (Solved) Set the header of one ListIconGadget column only to bold?
Replies: 10
Views: 1977

Re: Set the header of one ListIconGadget column only to bold?

Only for Windows:

EnableExplicit

Define BoldFont.I

Procedure ChangeHeaderTextToBold(ListIconID.I)
Shared BoldFont.I
Protected Header.I

Header = SendMessage_(GadgetID(ListIconID), #LVM_GETHEADER, 0, 0)
SendMessage_(Header, #WM_SETFONT, FontID(BoldFont), #True)
EndProcedure

OpenWindow(0 ...
by Shardik
Sun May 04, 2025 8:37 pm
Forum: Bugs - Linux
Topic: [Done] OnErrorGoto() doesn't work
Replies: 3
Views: 1494

Re: OnErrorGoto() doesn't work

The OnErrorGoto() example also doesn't work in PB 5.46 x64 and 5.73 x64.

But on Debian 12 'Bookworm' x86 in PB 6.10 x86 the example works like a charm. So it appears to be a problem of the 64-bit version of PureBasic!
by Shardik
Sun May 04, 2025 5:01 pm
Forum: Bugs - Linux
Topic: [Done] OnErrorGoto() doesn't work
Replies: 3
Views: 1494

[Done] OnErrorGoto() doesn't work

The help example for OnErrorGoto() doesn't work (tested on Linux Mint 21.3 x64 'Virginia' with Cinnamon and PB 6.20, it works like a charm on MacOS and Windows 10). The jump to the ErrorHandler is not executed and the program is terminated without any message (with Debugger turned off):

CompilerIf ...
by Shardik
Fri May 02, 2025 6:01 pm
Forum: Coding Questions
Topic: Counting Items in the DataSection?
Replies: 30
Views: 3011

Re: Counting Items in the DataSection?

You may use an end marker like for example ETX (end of text):

Procedure CountFruits()
Count = 0
Restore FruitList
Repeat
Read.S Fruit$

If Fruit$ <> #ETX$
Count + 1
EndIf
Until Fruit$ = #ETX$

ProcedureReturn Count
EndProcedure

DataSection
FruitList:
Data.s "Apple", "Orange"
Data.s ...
by Shardik
Tue Apr 29, 2025 10:58 am
Forum: Feature Requests and Wishlists
Topic: UseMP3SoundDecoder()
Replies: 11
Views: 2034

Re: UseMP3SoundDecoder()



... native MP3 decoder command would still be much nicer :D

I don't think this will ever happen because MP3 decoder/encoder has a proprietary license and I don't think Fantaisie Software will pay for that to be included in the Purebasic installation.


The basic MP3 decoding and encoding ...
by Shardik
Sat Apr 19, 2025 10:36 am
Forum: Linux
Topic: ExplorerListGadget
Replies: 8
Views: 5115

Re: ExplorerListGadget


Then it does not show folders and files!?

I have modified TI-994A's example to remove the title row of the ExplorerListGadget (cross-platform; successfully tested in MacOS 'Ventura', Linux Mint 21.3 x64 'Virginia' and Windows 10 23H2 with PB 6.20 x86 and x64):

If OpenWindow(0, 0, 0, 500, 300 ...
by Shardik
Tue Apr 15, 2025 9:36 am
Forum: Coding Questions
Topic: Force vertical scrollbar to bottom on EditorGadget
Replies: 12
Views: 5025

Re: Force vertical scrollbar to bottom on EditorGadget


To show that the function does not work when adding a large piece of text!

With

txt=txt+txt

in a loop you are simply blowing the capacity of the EditorGadget. When setting #MaxLines = 23, your txt string contains already more than 3 GB of characters!

See for yourself:

#MaxLines = 23 ...
by Shardik
Mon Apr 14, 2025 8:58 pm
Forum: Coding Questions
Topic: Force vertical scrollbar to bottom on EditorGadget
Replies: 12
Views: 5025

Re: Force vertical scrollbar to bottom on EditorGadget

If you comment or delete the line

txt=txt+txt

in your code example it will work like a charm! The problem is caused by doubling the size of the string variable txt 50 times in succession (#MaxLines = 50). Take a look into this thread where Fred explained:
The editor gadget is not meant to have ...
by Shardik
Wed Apr 09, 2025 11:19 am
Forum: Coding Questions
Topic: Force vertical scrollbar to bottom on EditorGadget
Replies: 12
Views: 5025

Re: Force vertical scrollbar to bottom on EditorGadget


Tell me, if I use, ResizeGadget (), then this stops working under Linux!?

Do you have an example code where it doesn't work after ResizeGadget() ? I have taken my multi-platform example, removed all non-Linux stuff and resize the EditorGadget after the 10th displayed line. It works like a charm ...
by Shardik
Mon Mar 24, 2025 9:41 pm
Forum: Coding Questions
Topic: How to place a StringGadget on the Toolbar?
Replies: 5
Views: 360

Re: How to place a StringGadget on the Toolbar?


Great, but I need it for Linux! :D

I have modified Kiffi's example to also work on Linux and MacOS. I have tested it successfully with PB 6.20 x64 on these operating systems:
- Linux Mint 21.3 'Virginia' with Cinnamon
- MacOS 13.7.4 'Ventura'
- RaspberryPi OS 64-Bit (Debian 12.9 'Bookworm ...
by Shardik
Sat Mar 22, 2025 7:20 pm
Forum: General Discussion
Topic: [Video] - How I optimised the Forbidden Solitaire FMV code by Jake Birkett
Replies: 5
Views: 1441

Re: [Video] - How I optimised the Forbidden Solitaire FMV code by Jake Birkett


As interesting as this video is, I was amazed at how he optimised by reshuffling existing code and did not first perform any analysis of whether the algorithms used could be improved upon.
Basically, he did what a good compiler would be able to do, but nothing more.

Here you can read Jake ...