I have several commands added to an overflow menu.
When running the app, the overflow menu is scrollableY and has a scrollbar on the right. The effect looks kind of odd in my app.
I have tried to access the menu via hi.getToolbar(). ..., but there seems to be no method to get the overflow menu directly.
How can I turn the scroll effect and the scrollbar off in the overflow menu?
Thanks in advance for any kind help.
That sounds like something we should fix. We already did a similar fix for the side menu with the theme constant sideMenuScrollVisibleBool. We should probably disable the visibility of the scroll here by default too. This should be easy but due to the code freeze I can't do this right now.
Please file an issue and we'll try to address it after the release: http://github.com/codenameone/CodenameOne/issues/new
Related
A GTK Toolbar can display an overflow menu when the toolbar is not wide enough to show its contents.
It seems that this feature doesn't work if the toolbar contains ComboBoxes wrapped by ToolItems.
Here is an example code that demonstrates the issue. It's written in Haskell but I guess it shouldn't be too difficult to translate it into other languages.
The instructions to build the repo is written in the README.md.
The last command opens a small GTK window. If you make it bigger you'll see two ComboBoxes in the window. The problem is that if you make the window narrower a bit, the right ComboBox disappears and no overflow menu appears even though toolbarShowArrow is enabled.
(Unfortunately I don't have enough reputation on SO to post two screenshots here so I uploaded them on the repo.)
Interestingly if I change the contents of the Toolbar from ToolItems to ToolButtons for example, I get the overflow menu.
Also I tested this with 3 packages: gtk for GTK2, gtk3 for GTK3, and gi-gtk for GTK3 with gobject introspection. All of them have the same issue.
So the question is: is there any workaround for this issue?
The documentation states this about gtk_toolbar_set_show_arrow():
Sets whether to show an overflow menu when toolbar doesn’t have room for all items on it. If TRUE, items that there are not room are available through an overflow menu.
So, it's an "overflow menu". I won't bore you with a detour into the GTK+ source, but suffice it to say: the items you add to the Toolbar need to provide menu items to appear in its overflow menu. Sounds logical now, right? :D
ToolButtons work because they call set_proxy_menu_item() with a MenuItem they create specifically for this purpose.
And that's what Toolbar looks for when deciding whether items can overflow: proxy MenuItems, which it can put into the overflow menu - and only if it finds at least one is there any point in giving the arrow to open that menu.
So, if you have other widgets, you can to get them into the overflow menu by setting a proxy menu item on your ToolItem, by either of:
simply calling gtk_tool_item_set_proxy_menu_item() to set a specific item
connecting to the ::create-menu-proxy signal on your ToolItem, and deciding during each emission whether or not to set (or clear) the proxy item
You'd also, of course, connect ::activate on that MenuItem to do something appropriate relating to the original ToolItem.
...though whether you can do anything useful from a MenuItem if the ultimate ToolItem child is a ComboBox is a different question. It doesn't expose its popup menu as something you can use. I guess you could just add a duplicate of the ComboBox to a MenuItem and use that as your proxy... But in that case, likely you're outwith the scope of what the overflow menu is meant for, and should instead just ensure your Toolbar doesn't get small enough to lose such controls.
Or maybe not! Try it and see how it goes.
Is there any way to hide menu and search buttons from Kindle Fire? This (Kindle Fire Customize Soft Key menu) says there's no way to do that, but i hope something has changed since then.
Thanks!
The overflow menu is automatic and controlled by the OS (similar to the Action menu on devices based on the default Android experience). The search icon is fixed and will either take the user to the platform search or you can override it following the instructions here.
You may also be able to achieve the effect you are looking for with one of the Full Screen Modes available to Kindle developers.
Do you have a sample of the code that is failing to hide the overflow menu appropriately?
I am working on a Haskell application using gtk2hs. This application has a toolbar which consists of several GtkToggleToolButton, GtkToolButton and GtkToolItem elements. For being able to resize the applications window, I set the ShowArrow attribute to True, so that elements, that would be outside the window, are listed in an overflow menu.
This works fine for GtkToggleToolButton and GtkToolButton elements, but GtkToolItem elements do not show up in the menu. This would not be such a big problem, but if those elements are not inside the window frame, the menu arrow does not show up only for them. So that you have no indication that the toolbar has actually more elements.
The GtkToolItem contains a GtkTable which contains a label and two GtkToolButton elements. Can I tell GTK that it should display a label in the overflow menu for my GtkToolItem elements?
Thank you in advance!
Tobias
GtkToolButton itself is a GtkToolItem (and you can add that table to it)! Then why you are using GtkToolItem directly?
And I think you should use GtkToolButton.set_stock_id (or set_icon_widget) aditional to set_label, instead of createing a table...
ToolItem has a method toolItemSetProxyMenuItem which allows you to specify the menu item that is displayed in the overflow menu:
http://hackage.haskell.org/packages/archive/gtk/0.11.0/doc/html/Graphics-UI-Gtk-MenuComboToolbar-ToolItem.html#v:toolItemSetProxyMenuItem
I'm currently working on a flash project, which will use multiple scroll areas.
I'm trying to find out how to create a scroll area like I see on stackoverflow, and make it function similarly.
Whenever someone posts their lines of code to stackoverflow, the scroll area scrollbar looks exactly like the scrollbar in the web browser, and is able to be scrolled with the mousewheel smoothly, without affecting the webpage scrolling.
Example: disable mouse wheel scrolling while cursor over flex app?
Could anyone please explain to me how I can do this in my flash project?
Thanks!!
You wouldn't need flash to do this... This is accomplished using CSS. You would just need to put the portion you wanted to function like that in a div (or any HTML container for that matter) and then define such properties as min-height, max-height, min-width, max-width, overflow, etc. I think there's one that determines the presence of the scroll bars but I don't remember what it is for sure. Very easy to do this and flash would be a bit of overkill.
Whenever I show a ModalPopupExtender on my Sharepoint site, the popup shown creates both horizontal and vertical scrollbars. If you scroll all the way to the end of the page, the scrollbar refreshes, and there is more page to scroll through. Basically, I think the popup is setting its bounds beyond the end of the page. Has anyone run into this? Searching Google, it seems this may be a known problem, but I haven't found a good solution that doesn't include recompiling AJAX, which my boss will not allow.
Hacky answer would be to grab the IE Developer Toolbar, find the tag that has the scrollbar, and alter your CSS file to add the overflow:hidden property to it.
I assume the TargetControl is of sufficient size to hold everything you put in it? If so, try:
Set CSS overflow:hidden;
If the target control is a Panel, set scrollbars="none". Otherwise, put it in a panel and try it.