Search found 13 matches

by Borstensohn
Sun Jun 01, 2025 6:09 pm
Forum: Coding Questions
Topic: Compiler Options...
Replies: 2
Views: 1080

Re: Compiler Options...

Thank you, Danilo, this helped me still 11 years after your post. :)
by Borstensohn
Sat Aug 17, 2024 6:08 pm
Forum: Coding Questions
Topic: Setting the program's icon in Linux
Replies: 13
Views: 5185

Re: Setting the program's icon in Linux


Try this, I'm on Win so not tested.



UsePNGImageDecoder()

DataSection
LINUXICON:
IncludeBinary "S48.png"
EndDataSection

OpenWindow(0,100,100,300,200,"SOFTWARE",#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)

icon = CatchImage(#PB_Any, ?LINUXICON)

gtk_window_set_icon_(WindowID(0 ...
by Borstensohn
Tue Jan 04, 2022 4:49 pm
Forum: Linux
Topic: WebGadget Extensions (PB v6.xx GTK3)
Replies: 34
Views: 15605

Re: WebGadget Extension (PB v6.00 GTK3)

I use Xubuntu 21.10 and PureBasic 5.73 LTS, your test program refuses to run, and this is the error message I get:

/usr/bin/ld: purebasic.o: in function `PB_DEBUGGER_ModuleBank':
(.data+0x15d8): undefined reference to `webkit_web_view_get_main_resource'
/usr/bin/ld: (.data+0x15e0): undefined ...
by Borstensohn
Wed Dec 29, 2021 10:20 pm
Forum: Coding Questions
Topic: Scintilla Text Alignment
Replies: 4
Views: 1589

Re: Scintilla Text Alignment

I tried the whole day to initialize a font, without any success, and lucky me found the answer in this thread:


*font = UTF8("Consolas")
ScintillaSendMessage(0, #SCI_STYLESETFONT, 32, *font)
FreeMemory(*font)


That did the trick. I had not known about the UTF8 thing.
So, thank you so much for ...
by Borstensohn
Thu Dec 19, 2019 4:34 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

firace wrote: I had the same issue and solved it with the following:

Code: Select all

SendMessage_(GadgetID(gadget), #WM_VSCROLL, #SB_BOTTOM, #Null)
SendMessage only works under Windows, not Linux, which I am using. Anyway, your code might help other users, so thank you for sharing.
by Borstensohn
Thu Dec 19, 2019 3:05 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

Well, on large texts it only works correctly with compiler option Library Subsystem: gtk2, otherwise (default GTK 3) the scrollbar stops after 24 lines or so. But that’s okay so far, I can use GTK 2.
by Borstensohn
Wed Dec 18, 2019 8:55 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

Wow, fantastic, #NULL, it works like a charm, thank you so much!
And the code of your procedure separates the beginners (like me) from the geniuses (like you). :)
by Borstensohn
Tue Dec 17, 2019 4:43 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

Does not work for me, @IdeasVacuum. I tried with GTK3 and GTK2 (compiler options > library subsystem > gtk2).
Maybe I’ll try under Windows, but not today, I think.

Thanks for your help to all of you, guys, much appreciated!

Oh, by the way: I have PureBasic 5.71 LTS (x64).
by Borstensohn
Tue Dec 17, 2019 4:06 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

Thanks, #NULL, but this example simulates adding of text lines. When a real user adds text, the scrollbar moves accordingly, so that’s not my point actually. What I am looking for is: After loading text into the Gadget editor, the scrollbar should scroll to the end of the text, without user ...
by Borstensohn
Tue Dec 17, 2019 3:31 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

Thanks, Shardik, your example Set cursor is the most interesting for me. I changed the editor’s content like this (see below), so that a scrollbar appears:

SetGadgetText(#Editor, "The" + #LF$ + "quick" + #LF$ + "brown" + #LF$ + "fox" + #LF$ + "jumps" + #LF$ + "over" + #LF$ + "the" + #LF$ + "lazy ...
by Borstensohn
Tue Dec 17, 2019 2:24 pm
Forum: Coding Questions
Topic: Move scrollbar to top of EditorGadget
Replies: 15
Views: 3652

Re: Move scrollbar to top of EditorGadget

I have a similar question, and that is: How can the scrollbar in the EditorGadget scroll down automatically under Linux?

To explain more detailed: When a text from a file is loaded into the EditorGadget, I’d love the gadget’s scrollbar to scroll down, without the need for the user to push the PgDn ...
by Borstensohn
Tue Feb 19, 2019 2:23 pm
Forum: Linux
Topic: SetWindowcolor
Replies: 6
Views: 3458

Re: SetWindowcolor

You could use a ContainerGadget instead, which wraps around all the other gadgets, and set a backgorund color for it. This works perfectly with GTK3 (which looks much prettier than GTK2). In this case you have to leave the field for the Lbrary Subsystem in the Compiler Options blank. At least this ...
by Borstensohn
Mon Jun 06, 2005 1:33 pm
Forum: Coding Questions
Topic: Files
Replies: 9
Views: 2894

Re: Kind of Stupid Question

If I want to open a file. What code do I use to have the file open :?:

You'll find the answer in PureBasic's online help. Look for topic "ReadFile". This opens a file for reading only. If you want to open a file for reading and writing, use "OpenFile".

I'm not sure if this will answer your ...