AddGadgetItem()...What??
Posted: Wed Jan 17, 2007 9:41 pm
Good Afternoon,
I'm back with a crazy question.
If I open a window -
add an editor gadget -
add the read only attribute -
open a text file -
then try to display the text file in the editor gadget -
with the '-1' parameter, the file appears proper without scrollbars &
with the '0' parameter, the file appears backwards (last line first) with scrollbars
[code]
If OpenWindow(0, 132, 152, 650, 350, "Officer Phone List")
If CreateGadgetList(WindowID(0)) And LoadFont(0, "Arial", 11)
EditorGadget(0, 8, 8, 635, 335)
SetGadgetAttribute(0, #PB_Editor_ReadOnly, 1)
If ReadFile(0, "Text.txt")
While Eof(0) = 0
AddGadgetItem(0, -1, ReadString(0))
Wend
CloseFile(0)
Else
MessageRequester("Information","Couldn't open the file!")
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
CloseWindow (0)
EndIf
End
[/code]
Why does the text file appear in the gadget backwards?
Help!!
Enjoy the day,
Earl
I'm back with a crazy question.
If I open a window -
add an editor gadget -
add the read only attribute -
open a text file -
then try to display the text file in the editor gadget -
with the '-1' parameter, the file appears proper without scrollbars &
with the '0' parameter, the file appears backwards (last line first) with scrollbars
[code]
If OpenWindow(0, 132, 152, 650, 350, "Officer Phone List")
If CreateGadgetList(WindowID(0)) And LoadFont(0, "Arial", 11)
EditorGadget(0, 8, 8, 635, 335)
SetGadgetAttribute(0, #PB_Editor_ReadOnly, 1)
If ReadFile(0, "Text.txt")
While Eof(0) = 0
AddGadgetItem(0, -1, ReadString(0))
Wend
CloseFile(0)
Else
MessageRequester("Information","Couldn't open the file!")
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
CloseWindow (0)
EndIf
End
[/code]
Why does the text file appear in the gadget backwards?
Help!!
Enjoy the day,
Earl