Search found 28 matches

by Comfort
Tue Jul 09, 2024 7:45 pm
Forum: Coding Questions
Topic: Question about the dimensions of an image.
Replies: 12
Views: 1762

Re: Question about the dimensions of an image.

God... enough of this!
by Comfort
Tue Jul 09, 2024 7:19 pm
Forum: Coding Questions
Topic: Question about the dimensions of an image.
Replies: 12
Views: 1762

Re: Question about the dimensions of an image.

The problem is the window the user has opened is only 480 wide.
Then he needs to change the Image width to 480.
by Comfort
Tue Jul 09, 2024 6:37 pm
Forum: Coding Questions
Topic: Question about the dimensions of an image.
Replies: 12
Views: 1762

Re: Question about the dimensions of an image.

Try changing the size of the Image... the ImageGadget Width and Height will change with it.
by Comfort
Sat Jun 29, 2024 3:56 pm
Forum: Coding Questions
Topic: File modification date
Replies: 14
Views: 2302

Re: File modification date

That be the ExamineDirectory() example.
by Comfort
Wed Jun 12, 2024 10:20 am
Forum: Coding Questions
Topic: MessageRequester triggers itself
Replies: 3
Views: 525

Re: MessageRequester triggers itself

This is constantly being triggered by a Focus event type. Maybe add tooltip instead.

Code: Select all

  Case #STRING_INPUT2
    MessageRequester("Uyarı", "Buraya yazamazsın",#PB_MessageRequester_Warning) 
by Comfort
Wed Jun 05, 2024 7:51 pm
Forum: Coding Questions
Topic: Loop ? The behavior not working
Replies: 23
Views: 3944

Re: Loop ? The behavior not working

Code: Select all

For n=0 To 2
  n=10
Next
Debug n
It's not broken... it's just quirky.
by Comfort
Wed Jun 05, 2024 2:29 am
Forum: Coding Questions
Topic: Resize canvas slow on large monitor
Replies: 9
Views: 1280

Re: Resize canvas slow on large monitor


Procedure GetEvents(Array events.EventStructure(1), *numEvents.Integer)
Protected event.i
*numEvents\i = 0
event = WindowEvent()
While event And *numEvents\i < #MAX_EVENTS
events(*numEvents\i)\event = event
events(*numEvents\i)\eventGadget = EventGadget()
events(*numEvents\i)\eventType ...
by Comfort
Tue May 28, 2024 9:50 pm
Forum: Coding Questions
Topic: after doing a DatabaseUpdate program shuts down
Replies: 11
Views: 2928

Re: after doing a DatabaseUpdate program shuts down

Code: Select all

If i < 0:Break:EndIf
txt$ = GetGadgetItemText(GadgetNumber,i)
If ProcDb(txt$) < 0:Continue:EndIf
Recode this, removing Break and maybe losing that Continue.
by Comfort
Sun May 05, 2024 6:40 pm
Forum: Applications - Feedback and Discussion
Topic: simple oil paint simulator
Replies: 26
Views: 11266

Re: simple oil paint simulator

Very nice... thanks for sharing.
by Comfort
Sun Apr 16, 2023 3:09 am
Forum: Coding Questions
Topic: What parameters does PB use internally to create windows?
Replies: 27
Views: 6679

Re: What parameters does PB use internally to create windows?


Sparkie's code here doesn't work anymore (illegal memory access) -> https://www.purebasic.fr/english/viewtopic.php?p=171031#p171031

Anyone know how to fix it? Thanks.


A couple of variables need to be integers for it to work with C backend compiler... there could be more.

Line 10 :

Global ...
by Comfort
Mon Apr 10, 2023 4:44 pm
Forum: Coding Questions
Topic: restore window & give it focus.
Replies: 4
Views: 703

Re: restore window & give it focus.

Replacing line #27 = ShowWindow() with...

Code: Select all

            SendMessage_(WindowID(0), #WM_SYSCOMMAND, #SC_HOTKEY, WindowID(0))
should work.
by Comfort
Tue Feb 28, 2023 10:38 am
Forum: Coding Questions
Topic: Unexpected BindGadgetEvent() callback
Replies: 3
Views: 566

Re: Unexpected BindGadgetEvent() callback

So, not a feature then.

Thanks.
by Comfort
Tue Feb 28, 2023 6:27 am
Forum: Coding Questions
Topic: Unexpected BindGadgetEvent() callback
Replies: 3
Views: 566

Unexpected BindGadgetEvent() callback

Is this a feature or an annoyance?

Procedure Test()
If GetGadgetText(EventGadget()) = "Binded Button"
MessageRequester("Button Test","As it should be!")
FreeGadget(0)
UnbindedButton = ButtonGadget(0, 10, 10, 200, 20, "Unbinded Button")
Else
MessageRequester("Button Test","Not expected."+Chr ...
by Comfort
Thu Nov 10, 2022 6:38 am
Forum: Coding Questions
Topic: User input example printing 2-3 times in debug
Replies: 8
Views: 975

Re: User input example printing 2-3 times in debug

With or without a keyboard shortcut, it needs a test for key repeat.

Something like this (without shortcut):

; output PlayerName variable to debug
Global PlayerName.s

If OpenWindow(0, 0, 0, 322, 50, "StringGadget example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
InitSprite ...
by Comfort
Wed Nov 24, 2021 8:53 pm
Forum: Coding Questions
Topic: Best way to return pointer to allocated memory inside procedure?
Replies: 7
Views: 2426

Re: Best way to return pointer to allocated memory inside procedure?

Pokes and Peeks drive me crazy, when there is a far elegant method available.