Comments (4)
Could you create SSCCE? Looks like creating MenuItem with that text and shortcut is not enough to reproduce or it was somehow already fixed in latest VisUI.
from vis-ui.
Very odd. Still happening here even with the simplified application.
This is built with VisUI 0.9.0-SNAPSHOT and libGDX 1.6.5.
package com.codedisaster.demo;
import com.badlogic.gdx.*;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.kotcrab.vis.ui.VisUI;
import com.kotcrab.vis.ui.widget.*;
public class MenuItemDemo extends ApplicationAdapter {
OrthographicCamera screenCamera;
Stage ui;
InputMultiplexer input;
@Override
public void create () {
VisUI.load();
}
@Override
public void dispose() {
ui.dispose();
VisUI.dispose();
}
@Override
public void resize(int width, int height) {
if (ui != null) {
ui.dispose();
}
screenCamera = new OrthographicCamera(width, height);
ui = new Stage(new ScreenViewport(screenCamera));
setupUI();
input = new InputMultiplexer();
input.addProcessor(ui);
Gdx.input.setInputProcessor(input);
}
@Override
public void render () {
ui.act(Gdx.graphics.getRawDeltaTime());
ui.draw();
}
private void setupUI() {
Table root = new Table();
MenuBar menuBar = new MenuBar();
root.add(menuBar.getTable()).top().fillX().expandX().row();
Menu viewMenu = new Menu("View");
menuBar.addMenu(viewMenu);
MenuItem showDebugGridItem = new MenuItem("Toggle tile grid");
viewMenu.addItem(showDebugGridItem);
showDebugGridItem.setShortcut(Input.Keys.SYM, Input.Keys.G);
root.left().top().pad(8).setFillParent(true);
ui.addActor(root);
}
}
from vis-ui.
Ah! I found it! I need to call MenuItem.setShortcut() before Menu.addItem().
from vis-ui.
Guess it should call invalidateHierarchy
after setting shortcut, I'll add that. setShorcut
returns MenuItem so you can chain it with item creation.
Btw since 0.8.2 setShorcut(int... keycodes)
is OS dependent, if you call it with setShortcut(Input.Keys.CONTROL_LEFT, Input.Keys.G)
, it will be Ctrl+G on Win and Linux, and ⌘G on Mac.
from vis-ui.
Related Issues (20)
- Crash when trying to select in VisTextArea when libGDX color marckup is enabled HOT 3
- Tab and ScrollPane visual bug HOT 3
- IllegalArgumentException application crash when typing name in FileChooser "Open" dialog HOT 2
- Update to LibGDX 1.9.14 HOT 1
- VisUI Tixel Skin, where'd it go? HOT 3
- VisImageButton getImage().setColor(color) does not work. HOT 4
- VisUI Draggable on Grid HOT 3
- Add rich text HOT 2
- Tree node is removed but the container remains HOT 3
- Build issue default startup LibGDX project with GWT and VisUI HOT 3
- Tooltip Issue HOT 3
- Illegal reflective access operation with FileChooser
- Enhance VisWindow HOT 2
- Window close should have an close callback listener HOT 1
- [VisUI Request] Set text orientation in VisImageTextButton HOT 1
- Support 'center' alignments in ToastManager
- TabbedPane clicking a tab makes it invisible HOT 3
- VisUI 1.5.2 release HOT 2
- VisUI 1.5.3 release
- Some enhanced suggestions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vis-ui.