Float Left
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Float Left
Im new to Live code and not sure how to do this.
i am generating a list of folders from my computer.
The process goes like this.
I choose a folder
then click a button
based on the list of folders i can create buttons
Right now the buttons show up in a list strait up and down.
What i am trying to is show the list of folder 4 across. instead of just in a list.
Iam including my code.
the reason i title this float left is becasuse in CSS thats what i would do. no idea how to do this in live code.
function filterDots pList
local tList
put pList into tList
filter tList without "."
filter tList without ".."
return tList
end filterDots
# Returns a filtered list of files in the current directory
function filteredFiles
return filterDots(the files)
end filteredFiles
# Returns a filtered list of folders in the current directory
function filteredFolders
return filterDots(the folders)
end filteredFolders
function makebuttons
local textf
put 70 into tMarge
put the loc of btn btnEndUse into tStartLoc
repeat for each line textf in field "textf"
set the label of the templateButton to textf
set the name of the templateButton to textf
set the style of the templateButton to opaque
set the width of the templateButton to 136
set the height of the templateButton to 70
set icon of the templateButton to 348
set textColor of the templateButton to "white"
set textStyle of the templateButton to "bold"
#set the backgroundColor of templateButton to "blue"
### set the width of templateButton to 50
# set the height of templateButton to 20
put item 1 of tStartLoc into tX
put item 2 of tStartLoc into tY
set the loc of the templateButton to tX,tY+tMarge
put the loc of the templateButton into tStartLoc
create button
end repeat
end makebuttons
## List Files button script
on mouseUp
local tFolder, tFileList, makebuttons
put field "Folder" into tFolder
set the defaultFolder to tFolder
put filteredFolders() into field "textf"
put makebuttons() into field "newlist"
end mouseUp
any help would be awesome i have only been working with livecode for a week now but love it.
i am generating a list of folders from my computer.
The process goes like this.
I choose a folder
then click a button
based on the list of folders i can create buttons
Right now the buttons show up in a list strait up and down.
What i am trying to is show the list of folder 4 across. instead of just in a list.
Iam including my code.
the reason i title this float left is becasuse in CSS thats what i would do. no idea how to do this in live code.
function filterDots pList
local tList
put pList into tList
filter tList without "."
filter tList without ".."
return tList
end filterDots
# Returns a filtered list of files in the current directory
function filteredFiles
return filterDots(the files)
end filteredFiles
# Returns a filtered list of folders in the current directory
function filteredFolders
return filterDots(the folders)
end filteredFolders
function makebuttons
local textf
put 70 into tMarge
put the loc of btn btnEndUse into tStartLoc
repeat for each line textf in field "textf"
set the label of the templateButton to textf
set the name of the templateButton to textf
set the style of the templateButton to opaque
set the width of the templateButton to 136
set the height of the templateButton to 70
set icon of the templateButton to 348
set textColor of the templateButton to "white"
set textStyle of the templateButton to "bold"
#set the backgroundColor of templateButton to "blue"
### set the width of templateButton to 50
# set the height of templateButton to 20
put item 1 of tStartLoc into tX
put item 2 of tStartLoc into tY
set the loc of the templateButton to tX,tY+tMarge
put the loc of the templateButton into tStartLoc
create button
end repeat
end makebuttons
## List Files button script
on mouseUp
local tFolder, tFileList, makebuttons
put field "Folder" into tFolder
set the defaultFolder to tFolder
put filteredFolders() into field "textf"
put makebuttons() into field "newlist"
end mouseUp
any help would be awesome i have only been working with livecode for a week now but love it.
Re: Float Left
Hi anrob,
Welcome to the forum
I'm not seeing how they are even ending up in a column, but never mind.
To simplify some things check out "rectangle" in the dictionary.
Oh and what the heck, I'll attach a stack.
This uses graphics but buttons would work the same.
Maybe I didn't even understand the question.
Simon
Welcome to the forum

I'm not seeing how they are even ending up in a column, but never mind.
To simplify some things check out "rectangle" in the dictionary.
Oh and what the heck, I'll attach a stack.
This uses graphics but buttons would work the same.
Maybe I didn't even understand the question.
Simon
- Attachments
-
- grid_maker.zip
- LC 6.1
- (992 Bytes) Downloaded 346 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Float Left
Thank you for getting back to me. i think you have it right. but since i am new at this it didnt really help - YET i am attaching the stack that i have in order for it to make clearer.Simon wrote:Hi anrob,
Maybe I didn't even understand the question.
Simon
thanks again.
i will look at the stack that you sent and see if i can make it make sense
When i open the stack i then click choose folder an then click List files.
you will see how it works then . what i really need to to list the folders in a scrollerable field. but this is just a start.
- Attachments
-
- Folder.livecode.zip
- Folder sorter
- (4.27 KiB) Downloaded 305 times
Re: Float Left
Dear anrob,
Thank you for your request.
If you want the field that contains the list of folders to be scrollable, all you need to do is enable the vertical scroll bars from within the fields property inspector.
Once you do this you will see a scroll bar appear like in the attached screenshot.
You can also make each item selectable in the list by enabling the "list Behaviour" property of the field.
I hope this gives you some leads.
Kind Regards,
Neil Roger
-----
RunRev Support Team ~ http://www.runrev.com
------
Thank you for your request.
If you want the field that contains the list of folders to be scrollable, all you need to do is enable the vertical scroll bars from within the fields property inspector.
Once you do this you will see a scroll bar appear like in the attached screenshot.
You can also make each item selectable in the list by enabling the "list Behaviour" property of the field.
I hope this gives you some leads.
Kind Regards,
Neil Roger
-----
RunRev Support Team ~ http://www.runrev.com
------
Re: Float Left
Hi anrob,
OK, I think I have what you wanted.
In the attached stack there are still plenty of problems (just details for you to work out) but the part I think you want has been implemented.
My understanding was that you want the folders to show up 4 across, which is what I did but you will have to adjust the script for a changing width of the "Scroll" group. You should expect it's width to change.
The most important command that you were looking for is "start editing..." this allows for the vertical scroll bar to actually do something when needed.
Any more questions just ask.
Simon
OK, I think I have what you wanted.
In the attached stack there are still plenty of problems (just details for you to work out) but the part I think you want has been implemented.
My understanding was that you want the folders to show up 4 across, which is what I did but you will have to adjust the script for a changing width of the "Scroll" group. You should expect it's width to change.
The most important command that you were looking for is "start editing..." this allows for the vertical scroll bar to actually do something when needed.
Any more questions just ask.
Simon
- Attachments
-
- Folder_simon.zip
- LC 6.1
- (3.01 KiB) Downloaded 292 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Float Left
Simon,
Thank you - That is excatly what i wanted.
you said ther are still problems. im sure i can figure that part out.
but the foolders post 4 across is what i was looking for.
Awesome.
Thank you much
Thank you - That is excatly what i wanted.
you said ther are still problems. im sure i can figure that part out.
but the foolders post 4 across is what i was looking for.
Awesome.
Thank you much
Re: Float Left
Dear RunRev Support Team,

Best
Klaus
that was not the question, good luck for the future!runrevneil wrote:Dear anrob,
Thank you for your request.
If you want the field that contains the list of folders to be scrollable, all you need to do is enable the vertical scroll bars from within the fields property inspector.
Once you do this you will see a scroll bar appear like in the attached screenshot.
You can also make each item selectable in the list by enabling the "list Behaviour" property of the field.
I hope this gives you some leads.
Kind Regards,
Neil Roger

Best
Klaus
Re: Float Left
Hi anrob,
Thanks for taking the time to respond to my post, too often peeps just run away without thanking us volunteers.
Glad it's what you wanted. You should be prepared to have any number of folders across depending on the width of the users window. I'm pretty sure you can figure out how to do that.
Just to freak you out make sure you drop a breakpoint within the "start editing" to see all your UI disappear.
If you have any more questions just ask.
Simon
Thanks for taking the time to respond to my post, too often peeps just run away without thanking us volunteers.
Glad it's what you wanted. You should be prepared to have any number of folders across depending on the width of the users window. I'm pretty sure you can figure out how to do that.
Just to freak you out make sure you drop a breakpoint within the "start editing" to see all your UI disappear.
If you have any more questions just ask.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: Float Left
Klaus you beat me to it

RunRev people should not attempt to answer complicated questions unless they read what the question actually is. And only then if they can provide pertinent answers.
But don't give up trying

Cheers,
Dave


RunRev people should not attempt to answer complicated questions unless they read what the question actually is. And only then if they can provide pertinent answers.
But don't give up trying


Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: Float Left
Wow. After reading back my response...I can see it is completely off the mark.
I must have been in autopilot when trying to answer.
Thank you Dave and Klaus for pointing this out
Kind Regards,
Neil Roger,
--
RunRev Support Team ~ http://www.runrev.com
--
I must have been in autopilot when trying to answer.
Thank you Dave and Klaus for pointing this out

Kind Regards,
Neil Roger,
--
RunRev Support Team ~ http://www.runrev.com
--
Re: Float Left
You're SO mean, Dude!Simon wrote:...Just to freak you out make sure you drop a breakpoint within the "start editing" to see all your UI disappear...

Re: Float Left
Simon.
I set the break point and saw it all disapper. Am i doing sothing wrong that would cause that?
Like i said i am only a week into LiveCode. I signed up for the Summer School and cant wait for it to begin. im also going thru LC university. But im learning Fast.
Also, Klause. Thank you for jumping in an saying something. I didnt really know how to respond and felt kinda dumb, so i just said nothing.
RevRun Support. No big Deal. We are all humnan and life can be foggy sometimes. All Good. Thanks
Hope i got everybody. Thank you and this is fun being part of this.
Larry
I set the break point and saw it all disapper. Am i doing sothing wrong that would cause that?
Like i said i am only a week into LiveCode. I signed up for the Summer School and cant wait for it to begin. im also going thru LC university. But im learning Fast.
Also, Klause. Thank you for jumping in an saying something. I didnt really know how to respond and felt kinda dumb, so i just said nothing.
RevRun Support. No big Deal. We are all humnan and life can be foggy sometimes. All Good. Thanks
Hope i got everybody. Thank you and this is fun being part of this.
Larry
Re: Float Left
Hi anrob,
no, you did nothing wrong!
That's the way Livecode works, without a breakpoint you wouldn't even notice this
While waiting for the Academy to start, you might want to take a look at these stacks,
great learning resources to get started with the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
no, you did nothing wrong!
That's the way Livecode works, without a breakpoint you wouldn't even notice this

While waiting for the Academy to start, you might want to take a look at these stacks,
great learning resources to get started with the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Float Left
Klaus,
Thank you, what a great resource. Thanks for making my sunday more productive.
Best,
Larry
Thank you, what a great resource. Thanks for making my sunday more productive.
Best,
Larry
Re: Float Left
Hi Larry,
Keep asking questions, and remember the old adage:
"The only dumb question is the one I can't answer"
or something like that.
Simon
Nope this is how it works, it's the same if you select a group then hit "Edit Group".I set the break point and saw it all disapper. Am i doing sothing wrong that would cause that?
Actually you should have said something. As I mentioned before, people will just disappear once they get the answer they wanted. Had I not thought I understood the question better I would have assumed because you didn't reply that the answer given solved your problem.Also, Klause. Thank you for jumping in an saying something. I didnt really know how to respond and felt kinda dumb, so i just said nothing.
Keep asking questions, and remember the old adage:
"The only dumb question is the one I can't answer"

or something like that.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!