Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / my basic set up code for bluegui the free version

Author
Message
hexeg0n
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 28th Jan 2013 22:07
Rem Project: GameEngineTest1
Rem Created: Monday, January 28, 2013

Rem ***** Main Source File *****

//
#Constant MENU_EXIT 1

//
Type Application
dbwindow as integer
mainmenu as integer
filemenu as integer
statusbar as integer
Endtype

//
Global myApp As Application

//
CreateUi()

//
Do

//
ProcessEvents()

Loop
End

//
Function ProcessEvents()

//
GetEvent

//
_EventType = EventType()
_EventData = EventData()
_EventDataEx = EventDataEx()
_EventSource = EventSource()

//
If _EventType = WINDOW_CLOSE || ( _EventType = MENU_CLICK && _EventData = MENU_EXIT )
DeleteGadget myApp.dbwindow
End
Endif

EndFunction

//
Function CreateUi()

// grab dark basic pro window
myApp.dbwindow = CreateGadgetFromWindow( MainWindow( ) )

// attach a menu bar
myApp.mainmenu = CreateMenu( myApp.dbwindow )

// add main menu items
AddMenuItem myApp.mainmenu, "&File", MENU_EXIT

// create file sub menu & attach it to the main menu
myApp.filemenu = CreateSubMenu( myApp.mainmenu, MENU_EXIT )

// add sub items to file menu
AddMenuItem myApp.filemenu, "&Exit", MENU_EXIT

EndFunction

hexeg0n
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Jan 2013 22:31
Didn't you post this a while back?
hexeg0n
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location:
Posted: 7th Feb 2013 16:16
yeah sort of the same but that code was diff for a editor im working on

hexeg0n

Login to post a reply

Server time is: 2026-07-07 00:29:59
Your offset time is: 2026-07-07 00:29:59