In order to learn GTK programming, I am building a simple GTK application that reads files in a directory and displays them as icons. I am trying to build something like the Nautilus icon view file explorer. I know the right pane uses GTK IconView but what does the left pane use to display list of places?
Also I have looked at the Nautilus source code but find it pretty complex for me, can anybody give me a simple example of using GTK IconView in C++?
thanks.
I'm guessing that the left pane uses the following:
Places - gtk.TreeView
Information - Custom layout made up of gtk.Image and gtk.Label widgets
Tree - gtk.TreeView
History - gtk.TreeView
Notes - gtk.TextView
Emblems - gtk.Layout with gtk.Image widgets positioned on it
As for the Nautilus window, I've heard that when showing in Icon View and Compact View modes, it uses a custom surface as the gtk.IconView was not deemed good enough. The List View mode most likely uses a gtk.TreeView.
Related
In qtcreator, when i highlight the qml file, i can select the design tab. How do i add more qt widgets to it?
I've installed qml-module-qtquick-controls from the repos and any qml-module-* named packages that i can, but in the qml types of qtcreator, no extra qml types appear in the pane. I was looking for widgets like buttons, etc but nothing seems to work
What should i install from the repo to get buttons that i can drag and drop into the form editor? I base this on having seen pictures of others having a paneful of widgets. On the other hand when i click on a *.ui file, the design tab reveals a different editor with all kinds of widgets. What is the difference between a *.qml file and a *.ui file?
first question : "getting more controls in QML file"
when you are in Design mode you have three tabs on top:
QML Types, Resources and Imports.
The last one is what you need. Click on the button with "Add Import" and a list with all possible qml imports is shown.
fi. choosing QtQuick.Controls 2.13 will add buttons, check boxes, radio buttons and others...which you will see now on tab "QML Types"
second question:"What is the difference between a *.qml file and a *.ui file?"
qml files are meant to be used in Qt Quick applications and ui. files for Widget based applications. You will find the basic introduction to them in the Qt Creator manual topic "Designing User Interfaces"
I am quite new in JavaFX and I have a question about the design. I am creating my main menu in FXML using Scene Builder. I have various menu buttons and each of these have a sub-menu. These sub-menu options will open new windows. Is it possible to declare these submenu choices so they do not dissapear after I click on them? If so, can I declare it in my fxml or I have to do it programatically?
Also, is it possible to detach it from the menu button? I would like to have my menu choices around 1 cm away from the menu button itself.
Thank you
Suggested Alternate Solution
If you want more flexibility in positioning a popup menu after a button click as well as fine control over when the menu shows and hides, try using a Button + a ContextMenu rather than a MenuButton.
The relevant methods are:
contextMenu.show(anchorNode, side, dx, dy)
contextMenu.hide()
There is sample code for triggering a context menu on a button press button in the ContextMenu javadoc.
You might also need to monitor the context menu's showingProperty and in a listener show the menu again if the JavaFX system has decided to try and hide it after some user action and you still want the menu visible.
Answers to additional unrelated comments
OK It sounds logical, yet since Im not really good in JavaFX yet, your Idea is quite challenging.
It's not that hard to implement, but from your subsequent comments it sounds like it's probably not the user interface you want for your users anyway (which makes sense to me because the interface you describe in your question seems a little strange).
I thought If it would be easier to have a static xml that have various menu choices, lets say aligned to the right and then whenever I click one of the choices, a new FXML would be loaded in the middle of the screen holding buttons for a submenu?
That seems logical. Sounds like a JavaFX version of a traditional web page layout with a navigation menu on the side controlling a content pane in the center.
A Java only version of that is: How to have menus in java desktop application. You could adapt that to a FXML based version without too much difficulty.
You might also be interested in Managing Multiple Screens in JavaFX.
Also, any tutorial for beginners would be greatly appreciated. These Oracle ones dont make too much sense for me
If you are beginning JavaFX, I recommend using just the Java API portions of JavaFX until you become familiar with them, and then use FXML only after you are comfortable with the Java API.
Personally, I think the Oracle JavaFX Tutorials are excellent. The difficulty for beginners is that the tutorials are also part reference material, which complicates portions of them (especially the deployment related pieces).
If you prefer a different tutorial style see:
Makery JavaFX tutorial (good for beginners)
zenjava tutorials (more advanced)
I got a menu in an existing MFC application that has a standard MFC main menu.
But I would like to change its background colour so that it appears to more seamlessly belong to the rest of the application.
First picture: An MFC main menu. The application is skinned blue, as seen in the toolbar, but the menu is still standard grey background colour.
Second Picture: Spotify's menu, skinned to fit into the rest of the
colors.
I have not found any examples on anything similar. Could you please point me towards how to achieve this?
Approaches I thought of:
Subclassing CMenu to my own SkinnedMenu, but it is not created by our code but by a GetMenu() call in a mainframe class deriving from CFrameWnd. The only thing I can find here is its method signature, defined in afxwin.h so then how could I make use my own subclassed menu?
Removing the entire menu and add my own custom menu buttons, in a row, making it look like a menu. Maybe this is what spotify have done, as they have also removed the Windows window frame.
Editing the existing CMenu in some way, but the only customization I am able to find right now is modifying its MENUINFO. For example if I set info.hbrBack = skin.GetSysColorBrush(COLOR_MENU) the only colour that changes is the background of the dropdown, not the main menu itself.
Other :)
I want to change the position of the application menu in an Eclipse RCP application. This is what my UI designer wants it to look like:
Note that you have the menubar on the left and a tab-bar on the right, thus saving a line of vertical space. I want the menu to still be the application menu, and work with all the other Eclipse extensions for controlling it. I just want it in a different place. Can this be done in Eclipse/SWT?
Not by default, certainly not in Eclipse 3.x or even Eclipse 4.2 using the Workbench. RCP applications fill in the main menu bar using their subclass of org.eclipse.ui.application.ActionBarAdvisor, filling in org.eclipse.jface.action.MenuManagers. All of the default extensions in 3.x are also based on interacting with MenuManagers. The SWT Menu used in the menu bar doesn't allow that kind of overlay, AFAIK.
In Eclipse 4 the menus are described in a model, and then a variety of renderers (defaults provided by org.eclipse.e4.ui.workbench.renderers.swt.WorkbenchRendererFactory) are responsible for creating the SWT widgets. In theory it's possible to replace some or most of those renderers (in effect implementing your own menu system using SWT composites or buttons or canveses) but that sounds like a lot of work.
im not too well versed in flash, i have a c#, java, c++ background so coding comes a little naturally
as of right now i have three soundslides projects playing in my flash project. The project has three buttons which load each different soundslide.
when classmates and my professor open my program the default size it too small, right now when i click ctrl+enter the bottom and bottom right portion of the screen are cut off...so i have to maximize the window maximize so i can see the play buttons?
stage["displayState"]="fullScreen";
This will make the SWF go fullscreen, if you put this in your document class constructor it will happen as the swf loads.