gtkd

Handling key presses in GTK+ (gtkD)

半世苍凉 提交于 2019-12-24 04:48:10
问题 I'm playing around with gtkD (a D binding for GTK+) I have a window object, instance of gtk.MainWindow . I want to handle keypresses on it. How? How do I deal with special keys (e.g. arrow keys, pgup/pgdn etc)? PS I know these kinds of questions can be answered with google and stuff, but I've seen much "simpler" questions on stackoverflow, so I figured asking doesn't hurt. Plus, sometimes, basic things tend to be burried under pages of documentation. 回答1: Here is sample code which may help

Gtk/GtkD Detect release of mouse button on window resize?

微笑、不失礼 提交于 2019-12-23 18:48:38
问题 I'm trying to improve a plotting library that I wrote with GtkD (the D bindings for Gtk). Scatter plots with a lot of points take a long time to resize. I want to rescale the image, allowing pixelation, while the user is dragging the window edge to resize, and only re-render it when the mouse button is released. Is there an API to detect whether the user is still holding down the mouse button to drag the window edge when a window is being resized? If you are not familiar with GtkD, a response

GtkD with D lang on Fedora

风格不统一 提交于 2019-12-12 11:35:24
问题 I use Fedora20 and I install gtkd via sudo yum install gtkd How to compile gtk this code ? import gtk.MainWindow; import gtk.Label; import gtk.Main; void main(string[] args) { Main.init(args); MainWindow win = new MainWindow("Hello World"); win.setDefaultSize(200, 100); win.add(new Label("Hello World")); win.showAll(); Main.run(); } but i get this error ➜ /tmp dmd -L-lgtkd -L-ldl main.d main.d(1): Error: module MainWindow is in file 'gtk/MainWindow.d' which cannot be read import path[0] =

GtkD undefined reference

試著忘記壹切 提交于 2019-12-11 05:16:59
问题 My code: import gtk.MainWindow; import gtk.Main; void main(string[] args) { Main.init(args); auto win=new MainWindow("Hello World"); win.setDefaultSize(200,100); win.showAll(); Main.run(); } When I try to compile with DMD (or gdc), I get the errors: dmd ./test.d -L-L/usr/local/include/d/gtkd-2/lib test.o:(.data+0x10): undefined reference to `_D3gtk10MainWindow12__ModuleInfoZ' test.o:(.data+0x18): undefined reference to `_D3gtk4Main12__ModuleInfoZ' test.o: In function `_Dmain': ./test.d:(.text

Setting up a working D2.x toolchain (with gtkd) on Ubuntu 10.04

青春壹個敷衍的年華 提交于 2019-12-09 03:34:22
问题 I've been playing around with D for a few days and was getting quite excited about it until, that is, I tried to get gtkd working. I've now wasted the best part of 3 days trying to get a working setup and am beginning to get (read; long ago got) a bit demoralised. I was wondering if anyone can help before I give up. A lot of the information I can find online is outdated so I'm not sure if I'm even right in thinking this is even possible. The rest of this is just about what I've tried so far

GtkD (the Gtk+bindings for the D language) why compile it?

吃可爱长大的小学妹 提交于 2019-12-08 02:53:53
问题 I've recently been using GtkD with the D programming language to create native applications. I've downloaded all the necessary files and got everything running so i can now compile and produce sample apps. My question is that in some of the guides it tells you to compile GtkD on the platform you are using but what is the point? Once compiled you end up with a single lib file on Windows (GtkD.lib) and three lib files on Linux (ending in *.a). What are these files for and how are they used?