which container to use for this and how

Post Reply
neve
Posts: 7
Joined: Thu Apr 21, 2022 6:17 pm

which container to use for this and how

Post by neve »

I'd like to put some UI elements inside a sidebar-type container but it's not obvious to me which one best fits what I want:

- fixed position
- a set width relative to mudlet window. eg user can't resize the sidebar but it does smoothly resize when the main window does
- outside of and to the right of the main window scroll bar. how the mapper works basically.

UserWindow seems to be pretty much what I want, except it seems like you can either control the width, or have it docked, but not both. Is that correct? Is there a configuration option I've missed, or a workaround?

AdjustableContainer also seems close but I can't figure out how to position it outside of the main window, to the right of the sidebar. It also has a lot of extra features and complexity that I don't need and would prefer to avoid. And finally I can't figure out how to set a general style for the container itself, only the elements within.

How can I wrangle one of these to my needs? Or is there some other thing I should be using? Just a raw container, vbox? something else?

newbie
Posts: 15
Joined: Thu Jan 26, 2012 10:56 am

Re: which container to use for this and how

Post by newbie »

nobody have a posible answer?

Drevarr
Posts: 43
Joined: Tue Aug 06, 2013 12:07 am
Location: GA, USA

Re: which container to use for this and how

Post by Drevarr »

something like this? assuming 25% for sidebar.

Code: Select all

myBorderSize = (WindowWidth*.25)

rightSideBar = Geyser.Container:new({
name = "rightSideBar",
x = -myBorderSize, y = 0,
width = myBorderSize,
height = "100%",
})



function resizeMapContainer()
	local getWidth, getHeight = getMainWindowSize()
	maxWidth = getWidth*0.25
  maxHeight = getHeight*1.00
		
	rightSideBar:resize(maxWidth, maxHeight)
  setBorderRight(maxWidth)
end

registerAnonymousEventHandler("sysWindowResizeEvent", "resizeMapContainer")


Post Reply