When will KDE SC 4.8.3 be available in the Kubuntu 12.04 official repositories?
LuisABOL's questions
I need to make an application in Vala, using Gtk, that supports keyboard accelerators that can be changed by the user.
First, I add an entry to the global Gtk.AccelMap and then set the accel_path for the Gtk.MenuItems. But, it doesn't work. The accels don't appear in the items of the menubar. To clear what I'm trying to do, here is a sample code:
// main.vala
public class MyWindow: Gtk.Window {
public MyWindow() {
this.set_default_size(500, 500);
var main_box = new Gtk.VBox(false, 0);
this.add(main_box);
// Menubar
var menubar = new Gtk.MenuBar();
main_box.pack_start(menubar, false, false, 0);
var file = new Gtk.MenuItem.with_label("File");
menubar.add(file);
var file_menu = new Gtk.Menu();
file.set_submenu(file_menu);
var quit_mi = new Gtk.MenuItem.with_label("Quit");
file_menu.append(quit_mi);
// Register a new accelerator with the global accelerator map
Gtk.AccelMap.add_entry("<MyWindow>/File/Quit", 'Q', Gdk.ModifierType.CONTROL_MASK);
quit_mi.set_accel_path("<MyWindow>/File/Quit");
// Connect signals
quit_mi.activate.connect(Gtk.main_quit);
// Label
var label = new Gtk.Label("My Window");
main_box.pack_start(label, true, true, 0);
this.destroy.connect(Gtk.main_quit);
}
}
int main(string[] args) {
Gtk.init(ref args);
var win = new MyWindow();
win.show_all();
Gtk.main();
return 0;
}
I use:
valac main.vala -o main --pkg gtk+-3.0
to compile the source code.
So, the question is: what's missing in the code? I think I need to do something else, but I don't know what.
I'm making a text editor using GTK3 in Vala. I need to drag a file and, when I drop it into the application window, the application opens that file. I'm using a Gtk.Notebook
that contains the Gtk.SourceView
's. It works when I drop a file into an empty Gtk.Notebook
, but when there is at least one Gtk.SourceView
appended on it, the SourceView
grabs the URI of the file, shows it and the window can't handle the opening of the file.
In this case, what can I do to prevent a Gtk.SourceView
from grabbing the URI of a file when I drop a file into a Gtk.SourceView
.
PS: I tried to use the drag_dest_unset()
inside the SourceView
derived class. It worked, the SourceView
didn't grab the URI and the window could open the file, but the application showed a message like this, in runtime:
Gtk-WARNING **: Can't set a target list on a widget until you've called gtk_drag_dest_set() to make the widget into a drag destination