![]() The interesting stuff starts to happen here. SortStructuredList( Files(), #PB_Sort_Ascending, OffsetOf(FILEITEM\Name), #PB_String) FinishDirectory(0)ĮndIf Sort the list into ascending alphabetical order of file name. ![]() Files()\Name = DirectoryEntryName(0)įiles()\Attributes = DirectoryEntryAttributes(0)įiles()\DateCreated = DirectoryEntryDate(0, #PB_Date_Created)įiles()\DateAccessed = DirectoryEntryDate(0, #PB_Date_Accessed)įiles()\DateModified = DirectoryEntryDate(0, #PB_Date_Modified)ĮndIf Wend Close the directory. And populate it with the properties of the file. If DirectoryEntryType(0) = #PB_DirectoryEntry_File Add a new element to the list. If the directory entry is a file, not a folder. Loop through until NextDirectoryEntry(0) becomes zero - indicating that there are no more entries. If this is ok, begin enumeration of entries. Result = ExamineDirectory(0, Folder, "*.*") Open the directory to enumerate its contents. This function gets the home directory for the logged on user. Define.l Event, EventWindow, EventGadget, EventType, EventMenu These variables will receive details of GUI events as they occur in the program. Define.s Access, Attrib, Create, Folder, Modify, Msg, Num, Size And some working variables to make things happen. Enumeration #Folder #Files EndEnumeration Now we define a list of files using the structure previously specified. Enumeration #WindowFiles EndEnumeration This is an enumeration to identify controls which will appear on the window. Structure FILEITEMĮndStructure This is a constant to identify the window. The structure for file information as before. Managing GUI elements, using that gadget would defeat this object a bit. Note that PureBasic provides a far easier way of getting this particular job doneĪlready - the ExplorerListGadget() but, as the example is intended to introduce So let's revisit the file propertiesĮxample from previous items again and turn it into a GUI application. ![]() The creation of graphical user interfaces (GUI) too. ![]() In addition to the console window, PureBasic supports UserGuide - Building a graphical user interface (GUI) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |