Vala

How to make a column with a string and pixbuf in GtkTreeview?

眉间皱痕 提交于 2021-01-27 07:45:33
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

让人想犯罪 __ 提交于 2021-01-27 07:44:57
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

How to make a column with a string and pixbuf in GtkTreeview?

我是研究僧i 提交于 2021-01-27 07:44:53
问题 I'm working in a app with Gtk+2 and i need to implement a File treeview. the actual code it's: public FileTree() { store = new TreeStore(2,typeof(string),typeof(string)); this.change_dir( "/dir/path" ); set_model( store ); // File icon var pixbuf = new Gtk.CellRendererPixbuf(); var column = new Gtk.TreeViewColumn(); column.set_title(""); column.pack_start(pixbuf, false); column.add_attribute(pixbuf,"stock-id",0); column.set_alignment(1.0f); append_column (column); // File name Gtk

一个微软不认的0day

限于喜欢 提交于 2020-10-23 07:24:46
进内部交流群,领黑客资料 扫文末二维码 最近,我们向Microsoft报告了50多个EOP和信息泄漏漏洞。 但是微软不认为这是漏洞,因此,在这里,我们发布了两个非常稳定的信息泄漏漏洞,这些漏洞是我们上个月发现的,Microsoft拒绝修复它们。 漏洞1:usosvc.dll中的信息泄漏 服务中的堆地址泄漏错误usosvc,usosvc.dll!UsoSettingsUtil::GetSetting导致特权升级。 此错误的根本原因如下代码所示 : __int64 __fastcall UsoSettingsUtil::GetSetting(const unsigned __int16 *a1, VARTYPE a2, struct tagVARIANT *a3) { /* ... */ pvargDest.vt = 8; pvargDest.llVal = (LONGLONG)v11; v12 = VariantChangeType(&pvargDest, &pvargDest, 0, a2); v7 = v12; if ( v12 >= 0 ) { v12 = VariantCopy(return_val, &pvargDest); /* ... */ } a2是一个用户可以控制的int值,此代码段的功能将VARTYPE更改为您可以指定的类型,然后复制到并返回给调用方。

Fedora 32

故事扮演 提交于 2020-10-03 00:27:12
找到一个gnome-shell农历扩展, Lunar Calendar 农历 。直接安装会出现错误,因为缺失依赖。作者让我手动编译安装 lunar-date 。 安装指南就三条命令: meson build --prefix /usr -Denable_gtk_doc=true -Dwith_introspection=true -Dwith_vala=true -Denable_tests=true ninja -C build/ sudo ninja -C build install 我的步骤: # 安装meson和ninja sudo dnf install meson ninja-build # 多次运行指南中的meson命令,查看日志,然后安装缺失的依赖 sudo dnf cmake glib2-devel gobject-introspection-devel vala gtk-doc # 最后运行后两条ninja命令 注意点: 1. 如果不解决meson提示的依赖缺失,第二条命令会报如下错误: loading 'build.ninja': No such file or directory 2. meson提示缺失的依赖名称不能直接用在dnf安装命令中,需要自行 搜索 。我的步骤中列出的依赖不一定是你缺失的依赖。 最后重新安装扩展,效果如下: 最后的最后

How does GObject style construction work?

你离开我真会死。 提交于 2020-02-05 03:22:26
问题 I'm new to Vala and trying to understand how the language works. I usually use script languages like Python or JavaScript. So, my question is why are there three ways of class constructor definition and how does the GObject style constructor work? For the best understanding lets make an analogy with python: Python class definition class Car(object): speed: int def __init__(self, speed): # default constructor self.speed = speed # property And Vala class Car : GLib.Object { public int speed {

How do you suppress the console window on Windows?

ⅰ亾dé卋堺 提交于 2020-02-02 10:11:04
问题 Take the basic example Gtk+ app and calll it main.vala : using Gtk; int main (string[] args) { Gtk.init (ref args); var window = new Window (); window.title = "First GTK+ Program"; window.border_width = 10; window.window_position = WindowPosition.CENTER; window.set_default_size (350, 70); window.destroy.connect (Gtk.main_quit); var button = new Button.with_label ("Click me!"); button.clicked.connect (() => { button.label = "Thank you"; }); window.add (button); window.show_all (); Gtk.main ();

How to resize a Gtk.Image in vala

╄→гoц情女王★ 提交于 2020-01-14 19:30:27
问题 I'm trying to resize a Image in vala. So I read valadoc and end up writing this code var img = new Gtk.Image.from_file ("fire.png"); var pix_buf = img.get_pixbuf (); pix_buf.scale_simple (50, 50, InterpType.BILINEAR); window.add (img); But it has no effect. If there is a way to dynamically scale the image so that it fill his container it would be awesome, but just scaling it would be fine. 回答1: Pixbuf.scale_simple does not modify the image. It returns a new Pixbuf that has been scaled. Use