The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

6

Emmanuele's position seems to be that there are better alternatives to Vala, so you should use them instead; based on his tweet about LLVM-based languages, I'm guessing he is a fan of Rust. I've played with Rust a bit, and while I prefer it to JS and Python, I like Vala much better… For me, Rust isn't a better alternative, it's an worse alternative (though ...


6

You should check the elementary Development Guide. In the section "Developer SDK" we cover grabbing essential development libraries, including the Vala compiler. For development tasks, you're going to be spending a lot of time in Terminal. The command we recommend for grabbing these development essentials is: sudo apt-get build-dep granite-demo The build-...


6

You just load the icon using the name. Gtk will select the one appropriate for the current theme. In your case, you would use something like: var icon = Gtk.Image.from_icon_name("view-refresh", Gtk.IconSize.SMALL_TOOLBAR); See valadoc for more information.


5

The about dialog is part of granite http://valadoc.org/#!api=granite/Granite.Widgets.AboutDialog The content is filled in the class that is subclassing Granite.Application http://bazaar.launchpad.net/~elementary-apps/noise/freya/view/head:/src/Noise.vala Then the about dialog can be launched with "name of you binary" --about http://bazaar.launchpad.net/~...


4

I believe that you are looking for Granite.Widgets.AboutDialog. You can find everything about it here : Valadoc Granite.Widgets.AboutDialog If you can't recognize a widget in a particular application, try using the new GTK+ Inspector, its really handy in situations like this. Hope I helped :)


3

You can associate the popover creation with a button event, like in the following example: var button = new Gtk.Button (); var imag = new Gtk.Image.from_icon_name ("help-info", Gtk.IconSize.MENU); button.add (imag); button.clicked.connect (() => { var pop = new Gtk.Popover (); //set popover content pop.set_parent_pop (window); pop....


3

Granite is written in Vala, so it provides a C API which you can use from C++. Using it should be fairly straightforward; just #include <granite.h> in your code, and build with something like g++ -o test test.cpp `pkg-config --libs --cflags granite` Then, you should be able to use Granite: #include <granite.h> void do_stuff (int w, int h) { ...


3

One of these windows is using client-side decorations and the other is using sever-side decorations. There is a bug right now where client-side decorations include the shadow as part of the window geometry. Which technically it is, but the toolkit should compensate. Starting in Loki (because of the newer libmutter version), all windows will be drawn with ...


3

After change, how can I see the output of changed code? Do I have to build each time? Yes, that's how compiled languages work. Note, however, that the build system will skip a lot of work it doesn't have to do; only generated C code that changes between compilations needs to be recompiled. Also, you can parallelize the build by running make -j instead of ...


2

Just add at the end of the .desktop file something like [Desktop Action Screen] Name=Take a Screenshot of the Whole Screen Exec=gnome-screenshot See this for more information https://wiki.ubuntu.com/Unity/LauncherAPI#Quicklists


2

take a look at this commit for a possible solution. http://bazaar.launchpad.net/~elementary-apps/screenshot-tool/trunk/revision/147


2

This issue was due to a line in the code pointing at a wrong place for the translations: Intl.bindtextdomain(GETTEXT_PACKAGE, "./locale"); Many thanks to Corentin Noel for spotting the issue.


2

This is one of those things where you probably want to use a build system to handle everything for you. First you need an XML file to describe your resources. Something like <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/com/foo/bar"> <file compressed="true" preprocess="xml-stripblanks">sample.ui</...


2

People keep pushing code upstream so I suggest continuing the use of Vala for your app if you already have started on it. Otherwise, choose any language you personally prefer be it C, Javascript, or Vala. Language wars are as nonsensical to religious wars. As @daniel-foré has mentioned on a reddit post Every month some new person declares that x language ...


2

What you're looking at here is an interface with an abstract method. Virtually all OOP languages have a similar concept to interfaces, but since you didn't specify which language(s) you do know I can't really draw a parallel to something you're already familiar with. Explaining the concept from scratch is really beyond the scope of a SO answer; you might ...


2

I'm still on Loki, but it seems like the required FindVala.cmake file would come from cmake-elementary: $ dpkg-query -L cmake-elementary ... /usr/share/cmake-3.5/Modules/FindVala.cmake ... which is recommended by elementary-sdk.


2

All feature requests must be written to the proper GitHub page, they do not belong here. I believe that in your case gala is a good starting point. https://github.com/elementary/gala Good luck


1

The Gtk.HeaderBar provides special styling for Gtk.Button's so that they look good inside it. The solution: In your case the solution is easy: remove the image-button style class from the info_button: info_button.get_style_context ().remove_class ("image-button"); If you have any problems with Gtk styling further on, I recommend to enable Gtk Inspector (...


1

Instead of CUSTOM_VAPIS I had to use --vapidir option. vala_precompile(VALA_C ${EXEC_NAME} ... PACKAGES ... # CUSTOM_VAPIS # ../vapi/libgtop-2.0.vapi OPTIONS --vapidir=${CMAKE_SOURCE_DIR}/vapi/ ... )


1

For this kind of errors I always search in the AUR for missing dependencies, when I install all the dependencies the problem, most of times fixes, if not you should read the oficial git/webpage because maybe it can have bugs. So check out if you have installed this packages: clutter-gtk gdk-pixbuf2 gdl glade glib2 gtksourceview3 intltool libgee webkit2gtk ...


1

Found it: sudo apt-get build-dep pantheon-mail installs all dev dependencies.


1

I've found a solution in the official code of the elementary settings app. [DBus (name = "org.freedesktop.Accounts.User")] interface AccountsServiceUser : Object { public abstract void set_background_file (string filename) throws IOError; } Define Dbus and declare the private member on your class //Instance of the AccountsServices-Interface for ...


1

This is actually a recently closed issue in our system stylesheet. See this issue report on GitHub. An update containing this fix should be available relatively soon.


1

In Files, view switch use Gtk.STYLE_CLASS_FLAT instead Gtk.STYLE_CLASS_LINKED. However , you can use Granite.Widgets.ModeButton You can see the code at : Files on Launchpad: linked Files on Launchpad: ModeButton


1

GtkStatusIcon is deprecated since GTK 3.14. It is more for Windows and KDE and not supported on elementary OS or Gnome 3.


1

What makes you think it's not possible to adjust brightness on a desktop? It may not be possible on your desktop, but that doesn't mean it isn't possible on someone else's… You're also going to run into the problem of how you define a laptop vs. desktop (and, to take it further, a tablet). It's common to find laptop parts in desktop computers, especially ...


1

Those two errors are pretty self-explanatory. Granite.Widgets.StorageBar.with_total_usage and Granite.Widgets.StorageBar.ItemDescription.FILES don't exist in the version of granite you have installed. You probably need a newer version of granite (quite possibly from git or whatever they use for revision control, if that's where you got files).


1

As @lemonslice said - the answer is to install the SDK package in a terminal window: sudo apt install elementary-sdk Did you get your app working? I'm just going through unanswered questions, and some of them are answered in comments, such as this.


1

Sounds like you want Gtk.Overlay. That said, a better design would probably be to put both the Gtk.TreeView and Gtk.Entry an a Gtk.Box so the entry doesn't occlude the tree view…


Only top voted, non community-wiki answers of a minimum length are eligible