Big Question

Started by wadmixfm, May 08, 2023, 15:23:23

Previous topic - Next topic

Midimaster

ok.. i understand

You need to combine them before sending to the gadget


Local AllLyr:String
For local i:int=0 to 39
    AllLyr = AllLyr + "~n" + lyr[i]
next
SetGadgetText textarea, AllLyr

This "~n" is a special string command for "new line". It brings every lyric item into a new line in the textbox. An alternativ would be to use: CHR(10) + Chr(13)

AllLyr = AllLyr + CHR(10) + Chr(13) + lyr[i]
...back from North Pole.

wadmixfm

ahhhhh i see

thanks for that

i am slowly (very slowly ) getting to grips with maxgui :)

thanks again
Yes its really me :)

wadmixfm

So i take it the setgadgettext is a kind of flip

To update the screen in maxgui

Lee
Yes its really me :)

wadmixfm

But thanks midimaster it works a treat now

Just what i needed ,now the singer has NO EXCUSE

Lol

Lee
Yes its really me :)

Midimaster

Quote from: wadmixfm on May 15, 2023, 13:07:15...the setgadgettext is a kind of flip to update the screen in maxgui...

No! The Gadget has a Text-Field, which can contain one string only. So if you want to add several lines or elements or what ever inside this field you need to do it in one take or add the content

When you call again SetGadgetText() this will always clear the complete text field, before receiving new text.

This has nothing to do with FLIP or MaxGui. It is the same, what would happen to any other string:


Container:String
For local i:int=0 to 9
    Container = "this is " + i
Next

Also this would only contain the last line "This is 9"

Also here you would have to do it this way:

Container:String
For local i:int=0 to 9
    Container = Container + "this is " + i
Next

now the result would be:
"This is 1This is 2This is 3This is ....This is 9"


Analog to this you fill the text field:

For local i:int=0 to 9
    SetGadgetText textarea,  GetGadgetText(textarea) + "~n" + "this is line " + i
Next


Or with help of a local STRING:

Local content:String
For local i:int=0 to 9
    content = content + "~n" + "this is line " + i
Next
SetGadgetText textarea, content
...back from North Pole.

wadmixfm

Ahhh i see ,so how does the screen get updated then if there are no commands to draw the screen

Like

Drawtext "lee",10,10

Flip

For example

Lee
Yes its really me :)

Midimaster

There is no "Screen" when you work with MaxGui. This old-school window needs now also a gadget called: Canvas

The use of Canvas needs a little more overhead, the code looks a little bit strange... but in the end it works as expected. Enter the command CreateCanvas() in the IDE  and press twice F1 to see an example.

Feel free to ask if you don not immediately understand how it works now under MaxGui.
...back from North Pole.

wadmixfm

Thanks Peter , very intuitive

:)

its very pleasing that people like you are willing to help newbies

and please others that read this , its not a direct attack at you but just asking me to search .........

search what to a newbie , thats like looking for a needle in a haystack :)

lee
Yes its really me :)

Sinjin

#23
There is also: AddTextAreaText( textarea:TGadget,Text$ )
So you dont need to get the full string and add something to it, then set the full string back.
Also, to your inital question. My idea was like to get the physical memory address, save that to a file and read it back in the second program, but all my tries failed so far. Im not sure if programs kinda protected by the OS. If that would be possible you would have direct access to the array in your 1st program. But thats kinda hacky ^^

Derron

Of course the memory of program 1 is not readable that easily by program 2 - else it would be a breeze to tamper data or do faulty things.

Thing something like this is of use there.
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory

Also check "post 2" as the question was already placed here on SB ... and suggestions were given.


bye
Ron

wadmixfm

thanks for the input

but the solution has been sorted what i was after has now been added and working a treat

i did not need 2 programs in the end all i needed to do was create a window with maxgui and everything is great

thanks everyone

Yes its really me :)