event style gui programming?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Shadowblitz16
Prole
Posts: 42
Joined: Wed Oct 28, 2015 11:18 pm

event style gui programming?

Post by Shadowblitz16 » Mon Mar 12, 2018 3:05 am

can someone explain to me how to go about making a event style gui library in love2d?
I kinda like the way winforms works with its events but I'm not really looking for something that complicated

something that would work something like this..

Code: Select all

function love.load()
	menubar    = ui:create_menubar()
	menugroup1 = menubar:addGroup("file")
	menuitem1  = menubar:addItem(menugroup1, "new")
	menuitem1:addEvent(ENV_ONCLICK, onFileMenuBarItem)
	
	window    = ui:create_window(nil, "some window", 0, 0, 256, 240)
	window.addMenuBar(menubar);
end

function love.update()
	ui:update()
end

function.draw()
	ui:render()
end

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests