To get use to MaxGUI I've been porting some of the old BlitzPlus examples. I thought I'd just post my conversion of Beaker's Blitz Browse found in the archives.
SuperStrict 'BLITZBROWSE by Beaker 2004 (updated) 'Rewritten using MaxGUI by Khomy Prime 'SETUP WINDOW Global window:TGadget=CreateWindow( "Blitz Browse",0,0,800,600) SetMinWindowSize window,200,0 'SETUP MENUS Local filemenu:TGadget = CreateMenu (" &File ",0,WindowMenu(window)) Local openmenuitem:TGadget = CreateMenu ("&Open...",1,filemenu) CreateMenu ("",999,filemenu) Local exitmenuitem:TGadget = CreateMenu ("E&xit",9,filemenu) Local bookmenu:TGadget = CreateMenu (" &Bookmarks ",0,WindowMenu(window)) Local addbookmenuitem:TGadget = CreateMenu ("&Add bookmark",21,bookmenu) Local organisebookmenuitem:TGadget = CreateMenu ("&Organise bookmarks",22,bookmenu) DisableMenu organisebookmenuitem Local defaultmenuitem:TGadget = CreateMenu ("Set as &default homepage",23,bookmenu) CreateMenu ("",999,bookmenu) If FileType("bookmark.txt") <> 1 'Then create a bookmark file with default bookmarks Local bookfile:TStream = WriteFile("bookmark.txt") RestoreData bookdata Local bookname:String Local bookURL:String ReadData bookname ReadData bookURL While bookname$ <> "END" WriteLine bookfile,bookname$ WriteLine bookfile,bookURL$ ReadData bookname$ ReadData bookURL Wend CloseFile bookfile EndIf 'read the bookmarks into the bookmark menu Global bookf:Int=500 Local bookfile:TStream = ReadFile("bookmark.txt") While Not Eof(bookfile) Local bookname:String = ReadLine(bookfile) Local bookURL:String = ReadLine(bookfile) If bookURL<>"" CreateMenu (bookname,bookf,bookmenu) bookf = bookf +1 EndIf Wend CloseFile bookfile CreateMenu ("",999,bookmenu) Local helpmenu:TGadget = CreateMenu(" &Help ",0,WindowMenu(window)) Local aboutmenu:TGadget = CreateMenu("&About",1000,helpmenu) UpdateWindowMenu window If FileType("default.txt") <> 1 'Then create the default.txt file with the default homepage Local deffile:TStream = WriteFile("default.txt") WriteLine deffile,"http://www.blitzbasic.com" CloseFile deffile EndIf Local deffile:TStream = ReadFile("default.txt") Global defURL:String = ReadLine (deffile) CloseFile deffile 'SETUP BUTTONS Local panel:TGadget = CreatePanel (0,0,800,40,window,0) SetGadgetLayout panel,EDGE_ALIGNED,0,EDGE_ALIGNED,0 Local backbutt:TGadget = CreateButton ("Back",5,5,60,30,panel) Local forebutt:TGadget = CreateButton ("Forward",70,5,60,30,panel) Local refreshbutt:TGadget = CreateButton ("Refresh",135,5,60,30,panel) Local homebutt:TGadget = CreateButton ("Home",200,5,60,30,panel) Global URLfield:TGadget = CreateTextField (265,10,350,20,panel) Local URLgo:TGadget = CreateButton ("GO!",620,10,60,20,panel) 'SETUP HTML VIEW Global html:TGadget=CreateHTMLView( 0,45,ClientWidth(window),ClientHeight(window)-43,window ) SetGadgetLayout html,1,1,1,1 Global current:String GoURL(defURL) 'MAIN LOOP While WaitEvent() Select EventID() Case EVENT_MENUACTION 'MENU EVENTS Select EventData() Case 1 'Open local File Local localURL:String = RequestFile("Open local file","htm,html,jpg,gif,png") If FileType (localURL) = 1 GoURL(localURL) EndIf Case 9 'Close program End Case 21 'Add bookmark Local bookfile:TStream = OpenFile("bookmark.txt") Local found:Int = False While Not Eof(bookfile) Local bookname:String = ReadLine(bookfile) Local bookURL:String = ReadLine(bookfile) If bookURL = current Notify "URL already in bookmarks" found = True Exit EndIf Wend If found = False WriteLine bookfile,current WriteLine bookfile,current CreateMenu (current,bookf,bookmenu) bookf = bookf +1 UpdateWindowMenu window EndIf CloseFile bookfile Case 23 'Set as Default homepage Local deffile:TStream = WriteFile("default.txt") WriteLine deffile,current$ CloseFile deffile Case 1000 'About Notify "Blitz Browse by Beaker 2004~n(bookmarks are in the bookmark.txt file)" End Select If EventData() >= 500 'Jump to a specific bookmark Local f:Int = 0 Local bookfile:TStream = ReadFile("bookmark.txt") While Not Eof(bookfile) Local bookname:String = ReadLine (bookfile) Local bookURL:String = ReadLine (bookfile) If f = EventData()-500 Then GoURL(bookURL) Exit EndIf f = f +1 Wend EndIf Case EVENT_GADGETACTION Select EventSource() Case backbutt HtmlViewBack html Case forebutt HtmlViewForward html Case refreshbutt GoURL(HtmlViewCurrentURL(html)) Case homebutt Local deffile:TStream = ReadFile("default.txt") GoURL(ReadLine (deffile)) CloseFile deffile Case URLgo GoURL(TextFieldText(URLfield)) Case URLfield If EventData() = 13 GoURL(TextFieldText(URLfield)) EndIf Case html SetGadgetText URLfield ,HtmlViewCurrentURL(html) End Select Case EVENT_WINDOWCLOSE Select EventSource() Case window End End Select End Select Wend End Function GoURL(URL$) current = URL$ SetGadgetText URLfield,current HtmlViewGo html,current SetGadgetText window,"Blitz Browse - "+current End Function #bookdata DefData "Blitz Basic" DefData "http://www.blitzbasic.com" DefData "Blitz Coder" DefData "http://www.blitzcoder.com" DefData "FONText bitmap font creation" DefData "http://www.playerfactory.co.uk" DefData "Redflame Games and Tools" DefData "http://www.redflame.net" DefData "Blitz Base" DefData "http://www.blitzbase.de/" DefData "Game Making Tools forum" DefData "http://www.playerfactory.co.uk" DefData "END" DefData "END"