Questions tagged [vala]

Questions related to the Vala programming language.

Filter by
Sorted by
Tagged with
0 votes
2 answers
224 views

How to get user home folder in Vala?

I am trying to make a Elementary OS app that I need to get user home folder. I tried GLib.Environment.get_home_dir () and Granite.Services.Paths.home_folder.get_path () but they both return null. What ...
0 votes
0 answers
8 views

Network Icon not showing in the setting menu (network and wireless)

Functionality-wise The network manager is working fine, also the wifi icon is showing on the top menu. But the network icon is not showing in the settings tab. PS: Recently reinstalled NetworkManager ...
0 votes
1 answer
18 views

How do I set up a Vala project with multiple namespaces in Meson?

I realize this is a bit beyond the scope of elementary OS, per se, but all y'all seem to be the main users of Vala, and I'm not sure where else to ask this. I am working on a project with a large ...
0 votes
1 answer
64 views

error: The type name `var' could not be found

I'm trying to build a fresh clone of Granite's master branch, on elementary OS 5.1.7 Hera, but I'm getting these errors: ../lib/Widgets/SwitchModelButton.vala:65.9-65.19: error: The type name `var' ...
0 votes
1 answer
46 views

Unable to move Hdy.ApplicationWindow by dragging Hdy.HeaderBar in Vala

Trying to use libhandy and Hdy.ApplicationWindow instead of Gtk.ApplicationWindow in my vala based application made for elementary OS. My Problem While using Hdy.ApplicationWindow and Hdy.HeaderBar ...
0 votes
1 answer
37 views

How to gain access to the serialized contents of a Gtk.TextBuffer including all Gtk.TextTags?

If this isn't the appropriate forum for this question, I apologize. Please remove it if that's the case. I know that Elementary OS developers use Vala for their development and I'm unaware of a more ...
0 votes
1 answer
62 views

Can I upload an app which is not built using vala?

Is it necessary for a developer to upload an app written in vala only? Can't it be something c++ or python to be uploaded on Elementary's app store? I really want to contribute for them but don't want ...
2 votes
1 answer
270 views

Buttons' Look in a Gtk.MessageDialog

Elementary's human interface guidelines specify how dialogs should look: In Valadoc, there is a minimal example on how Gtk.MessageDialog is to be used: Gtk.MessageDialog msg = new Gtk.MessageDialog (...
2 votes
1 answer
44 views

How to store data from a ListModel?

Is there some sort of standard or commonly-used way to store data in elementary apps? I currently have a bunch of GObjects contained in a ListModel and would like to persist that to the disk and ...
0 votes
3 answers
2k views

Gnome Boxes won't create a VM

Running from the GUI I get "Box setup failed" -pretty sparse there Gnome team!! (I know this is the elementary forum, but just saying...) Running from Terminal, I get: (gnome-boxes:31127): Boxes-...
0 votes
0 answers
17 views

Is there any API to get the list of installed apps, all and available keyboard layouts?

I am working on an app for elementaryOS. I need some information and functionality from the OS, so I want to know if there any Vala/Glib/etc API to: Get a list of all the installed apps in the system ...
0 votes
0 answers
29 views

Error while building gala window switcher after upgrading to elementary os odin

I've upgraded to elementary os 6 yesterday , and when tried to compile a [gala window switcher][1] i was prompted with this error . >> cmake -DCMAKE_INSTALL_PREFIX=/usr .. -- The C compiler ...
0 votes
1 answer
130 views

How to install newer vala compiler?

I'm trying to contribute to Granite, but I'm still on elementary OS v5, which doesn't include the required vala computed version. Thanks to jeremypw I found the relevant ppa: https://launchpad.net/~...
0 votes
1 answer
30 views

Technical error while using Cairo

using Cairo ; using Gtk ; using GLib ; public class ClockWidget : DrawingArea { private Time time ; private int minute_offset ; private bool dragging ; public signal void ...
0 votes
0 answers
85 views

write an IDE for vala

I wnated to know Why elementary os does not have a decent IDE for vala language? vala is their programming language but unfortunately there is not a good IDE for it I think they should have a IDE for ...
1 vote
1 answer
39 views

StackSIdebar is not visible

I used Gtk.StackSidebar to create a sidebar for an app that I am making. https://github.com/Suzie97/Project_X97, this is the link to my github repo. The sidebar is not correctly visible on the window. ...
1 vote
1 answer
38 views

Window position and size not saved when app is closed

I made this simple application and made it so that the window position and size is saved on closing the app, so that the next time the user opens the app, he can resume his work directly. https://...
0 votes
1 answer
102 views

gsettings schema isnt installed

I am learning to make apps for Elementary OS. I wrote my app it compiles well without any errors. But when I try to open the application, it displays a message stating gsettings schema isnt installed. ...
0 votes
1 answer
68 views

How to add granite package

What package do I need to add to my project in order to use granite? All I get is "The name `Granite' does not exist in the context of..." I tried libgranite-dev but it isn't found. Also, ...
1 vote
1 answer
64 views

Do I have to use Vala to build my app to get it on the App Store?

I notice they have Vala shown front and center, but I'd much rather use electron with React so I don't have to learn a whole new language. Would they accept a submission in React? Found this: Your ...
0 votes
1 answer
120 views

How to send message headers with libsoup in Vala?

I cannot for the life of me figure out how to append the headers to my get request. var session = new Soup.Session (); var msg = new Soup.Message ( "GET", "...
2 votes
1 answer
98 views

Debugging applications during development

I wanted to start working on issue https://github.com/elementary/calendar/issues/419 but I encountered a bug. So I wanted to debug the application code I added. I found this tutorial on debugging ...
2 votes
1 answer
52 views

Symbol lookup error

Trying to compile this simple example, but having this error when trying to run exec: ~/projects/vala-snippets/Fast-Examples/DazzleChart(master ✔) meson build The Meson build system Version: 0.49.2 ...
4 votes
2 answers
118 views

I want to add the listbox scroll fade effect in my app - how?

I am referring to the effect eg. the session indicator has or the keyboard language adder has. I'd prefer it with the responsiveness the session listbox has.
0 votes
1 answer
102 views

Can't make Gtk.TextView () fill whole parent Gtk.Box

Can't make Gtk.TextView () hexpand. Only expands to like 2/3 of parent and wraps words too early. Source: https://github.com/stsdc/monitor/blob/d3685a314712e263987da942724432c3469108e6/src/Widgets/...
1 vote
2 answers
25 views

Can't change value in struct property inside class

io = {}; io.wchar = 111111; debug((string)io.wchar); // (null) So the problem here is that io.wchar is still null. You can look at the whole class here: https://github.com/stsdc/monitor/blob/dev/src/...
6 votes
5 answers
3k views

Concern about the future of vala

I'm prototyping an application using Vala, in hope of targeting elementary OS. It was actually the elementary website at Build for elementary OS that first steered me towards Vala. Now, Gnome is ...
1 vote
1 answer
624 views

Can't find gtk header file for vala-code compilation

I am trying to run the first sample code on this site. Unfortunately I got the following error message: Package gobject-2.0 was not found in the pkg-config search path. Perhaps you should add the ...
2 votes
1 answer
34 views

Delete Applications - Self Made With Gtk Tutorial

I've been playing around with Gtk and vala and I love it; however, I've created two simple apps that I don't know how to delete from my system.
0 votes
1 answer
100 views

VALA GTK Header Bar with switch distorted

I'm trying to create a Window with a HeaderBar, and in the HeaderBar there will be a Switch. But, the switch gets sized vertically, and gets distorted (non proportional), is there some fix?
1 vote
1 answer
133 views

Code don't work

I made this code, but it doesn't work correctly. The window is created, but the button does not appear. I do not receive any error reports. Would anyone know why? public class MyApp : Gtk.Application ...
0 votes
0 answers
134 views

Missing title in GTK+ 3 Dialog

I'm writing a vala GTK+ application and want to add a modal dialog like this: var dialog = new Gtk.Dialog.with_buttons (_("My title"), this, Gtk.DialogFlags.MODAL | Gtk.DialogFlags....
3 votes
1 answer
438 views

Setting up a development environment for elementaryOS apps?

what's the best tool chain for building elementary applications these days? I've been playing with an existing project that contains a lot of other magic (such as meson, ninja and the like), and while ...
2 votes
1 answer
75 views

XHTML with WebKit

I am working on an ebook application with WebKit 3 (webkitgtk-3.0) on Elementaty OS Freya. epubs which have html display fine, however the new epub 3 with XHTML comes garbled with multi columns ...
3 votes
1 answer
128 views

Gtk Granite : About Dialog not appearing properly

For some reason, the Gtk About Dialog is not appearing properly. My class is a subclass of Granite.Application. The About dialog which comes as part of the elementary desktop is also with the same ...
2 votes
1 answer
28 views

Elementary app feasibility: modify any current text input

I'm using a qwerty keyboard with english layout but as a french speaker I would like to access special chars without changing the layout. To do so, I'd like to create an app that mimic the android ...
0 votes
1 answer
97 views

Selecting text on WebKit2

What method is available to select text on webkit2gtk. I could not find anything on the API for Vala webkit2: https://valadoc.org/webkit2gtk-4.0/WebKit.WebView.html The requirement is to get the ...
1 vote
1 answer
178 views

Using cmake on Juno

I know elementary OS would like to move from cmake to meson, but cmake should still work: While CMake will continue to work, our official documentation and code examples will all be written around ...
0 votes
1 answer
239 views

Button CSS not working in Juno

I'm using this code to apply some dynamic css to button based on colours chosen by the user. This was working in Loki but not working in Juno Beta. Thanks in advance for any pointers. 1.Create a CSS ...
0 votes
1 answer
91 views

Left Align the secondary text on Widgets.Welcome

Is there a way to right align the secondary text on the welcome widget. I have a rather longish secondary text (attached screenshot) and the text will look better if the left margin is aligned rather ...
2 votes
1 answer
66 views

Customizing existing Vala app

I am planning to deep dive into vala language by reading the code that was/is developed by other developers as all the apps created for elementary os are openly coded on GitHub. But, I am Vala newbie. ...
0 votes
1 answer
39 views

Can not able to get exact value of `%u` in Vala program

Vala newbie here. Learning Vala as programming language and stuck with following program int main() { string first_name; string last_name; uint age; stdout.printf("Enter your first ...
0 votes
1 answer
144 views

Missing styles when building app using Gtk.CssProvider

I'm using cmake and following the instructions per Elementary OS site (https://elementary.io/docs/code/getting-started#building-and-installing-with-cmake). Everything looks good when compiling the ...
0 votes
1 answer
80 views

How to add command line dependencies using CMake

I'm building a Vala app that uses youtube-dl command line. How do I make sure that it is installed when someone installs the app? In other words: Looking at the CMake build documentation, what is the ...
5 votes
1 answer
226 views

Can't build package from developer getting started doc

I'm following the developer getting started document, and have worked my way here: http://elementary.io/docs/code/getting-started#launchpad-recipes I'm able to build the hello-packaging application ...
0 votes
1 answer
270 views

Linked style doesn't work for buttons

Only button with label has linked style. var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); button_box.get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED); info_button = new Gtk....
-1 votes
1 answer
45 views

Compiling with custom vapi leads to error

Added CUSTOM_VAPIS with vapi/libgtop-2.0.vapi to vala_precompile() in CmakeLists.txt and got this error: No rules for target '../src/vapi/libgtop-2.0.vapi' ... How to add vapi files properly?
1 vote
1 answer
39 views

Language Translations not working in Bookworm

I have followed the instructions at the Elementary Getting Started (Translations) to set up the translations and I have a few translated languages including French in the po directory (fr.po). I can ...
0 votes
2 answers
118 views

Missing Library

I'm trying to get into developing for Elementary using Vala. I have been unsuccessfully trying to build Valama (an IDE for Vala) for ages but keep hitting hurdles. Currently when I try to make Valama ...
3 votes
1 answer
880 views

Proper way to include assets when compiling a Vala GUI program

First of all, your official tutorial on getting started with Vala GUI development is excellent. I am wanting to move away from hand-coding my window layouts and I want to use Glade XML files. I have ...