Re: How to convert PDF to PNG using DMagick?
On 25-09-2021 15:21, tastyminerals wrote: When I need to convert a PDF image in console, I use ImageMagick: `convert doc.pdf doc.png` command. Today I found ImageMagick D bindings -- DMagick https://github.com/MikeWey/DMagick. I would like to script this operation using DMagick. However, I couldn't find any code samples and was not able to find anything about image conversion in official ImageMagick C API docs either (maybe I need to spend more time though). But maybe someone has code samples of how to convert PDF? It's been awhile since i used it myself, but if imagemagick supports reading PDF's this might work: ``` Image pdf = new Image("./test.pdf") pdf.write("./test.png") ``` DMagick hasn't been updated in a while so it will probably not work with newer versions of ImageMagick. -- Mike Wey
Re: Surprise - New Post on the GtkD Coding Blog
On 03-09-2021 20:42, M.M. wrote: I just recently visited your blog, and was wandering whether it's over now... I also visited gtkd website, and was wandering whether it's over now (the website still shows a wrapper for GTK 3.24). Happy to see you are back and well. I wonder where did you learn about a new gtkD release? Anyway, on the long run, I guess covering GTK 4 will be very welcome. The GTK 4 version still needs work and isn't released yet. I currently don't have the time to work on it, but i hope i am able to resume working on it later this year. -- Mike Wey
Re: gtkd , addondraw is deprecated
On 21-05-2021 12:35, Alain De Vos wrote: What is the advised function to use instead of gtk.Widget.Widget.addOnDraw ? ``` this() { addOnDraw();} ``` Change the `Context` passed to the drawCallback to a `Scoped!Context` only the non scoped overload is deprecated. ``` bool drawCallback(Scoped!Context cr, Widget widget) ``` -- Mike Wey
Re: GtkD - how to list 0..100K strings
On 26-04-2020 10:06, mark wrote: I'm trying to develop an application in GtkD. I need a widget to display a list of strings: there could be anything from 0 to 100K strings, but typically a few hundred or thousand. Using the DemoCustomList as a model I have created this code: ... When populateNames() is called the treeview expands horizontally but shows nothing, so I'm stuck. Can anyone help? Note that I don't have to use a tree widget if there's a better one for this use case. I did see ListBox but that seemed to be a list of widgets which would be a bit heavy for 100K strings? The code looks correct, do you have something that compiles so that we can test where things go wrong? -- Mike Wey
Re: How to compile with GtkD
On 09-02-2020 12:52, mark wrote: I am trying to build a simple "hello world" app (from the gtkDcoding blog) in $HOME/app/d/gtktest (which is a dub init created directory) and have this dub.sdl: name "gtktest" description "Gtk Test" authors "Mark" targetType "executable" dependency "gtk-d:gtkd" version=">=3.9.0" importPaths "$HOME/opt/GtkD3" libs "libgtkd-3" Libraries should be passed to dub / ld without the lib prefix, so that last line would become: libs "gtkd-3" Since dub will build a copy of the libraries listed as dependencies, you can either remove the dependency line, or the importPaths and libs lines. Since now you are linking against both the library build by dub and the one on your system. -- Mike Wey
Re: Running GtkD programs on macOS
On 29-11-2019 04:40, Joel wrote: Oh, I used 'brew install gtk+3', and the test program worked, but (see below) I don't know about all that installing - is that alright? They all look like GTK+ dependencies so that would be alright/ -- Mike Wey
Re: Gtkd and libgtksourceview
On 31-10-2019 12:16, Ron Tarrant wrote: On Wednesday, 30 October 2019 at 22:26:41 UTC, Mike Wey wrote: --- girtod -i src --use-runtime-linker --use-bind-dir --- Hmmm... I'll need more information, I'm afraid. I Googled, but I'm not finding any instructions for building these DLLs. girtod can be found here: https://github.com/gtkd-developers/gir-to-d It's a tool that generates a D Binding from GObject Introspection files, if you use the GTK installer from the gtkd website or msys2 the needed introspection (.gir) files should be installed on your system. Running the command above in the root of the GtkD project, will regenerate the source based on the gir files found on your system. The last two options passed to girtod are for backwards compatibility with older version of GtkD, and aren't needed for new bindings. And technically you could also run: "girtod -i GSource-3.0.gir" and it will create a "out" directory with a GtkSourceview binding that should be fairly complete. -- Mike Wey
Re: Gtkd and libgtksourceview
On 30-10-2019 20:17, Ron Tarrant wrote: On Wednesday, 30 October 2019 at 18:00:24 UTC, Mike Wey wrote: GtkSourceview was updated to 4.x in GtkD version 3.9.0, so any older version should work with GtkSourceview 3. Welcome back, Mike... Thanks. The latest Windows runtime available on the GtkD downloads page installs libgtksourceview-3.0-1.dll, not the 4.0 version, so I suspect the Linux libraries may be out of step, too. The installer could use an update, Sourceview 4 is available for windows. If you need Sourceview 3 in the newer version of GtkD you could replace `file: GtkSource-4.gir` with `file: GtkSource-3.0.gir` in `src/APILookupSourceView.txt` and then run `make generate` (requires girtod) and you should have a up to date binding for Sourceview 3. Just for the record, this doesn't work on Windows. I made the change in APILookupSourceView.txt and re-ran Build.d, but sourceview/gsv/c/functions.d still shows: version (Windows) static immutable LIBRARY_GSV = ["libgtksourceview-4-0.dll"]; else version (OSX) static immutable LIBRARY_GSV = ["libgtksourceview-4.0.dylib"]; else static immutable LIBRARY_GSV = ["libgtksourceview-4.so.0"]; For windows there isn't an easy command to regenerate the source, but running this command should work (Its been a while since i tried it on windows): --- girtod -i src --use-runtime-linker --use-bind-dir --- -- Mike Wey
Re: Gtkd and libgtksourceview
On 30-10-2019 15:48, bioinfornatics wrote: Dear, I tried the latest gtkd release and it try to open dynamically libgtksourceview-4.so.0 however I have only libgtksourceview-3.so.1 so which version should I used to be compatible with libgtksourceview-3 (I use centos 7) GtkSourceview was updated to 4.x in GtkD version 3.9.0, so any older version should work with GtkSourceview 3. If you need Sourceview 3 in the newer version of GtkD you could replace `file: GtkSource-4.gir` with `file: GtkSource-3.0.gir` in `src/APILookupSourceView.txt` and then run `make generate` (requires girtod) and you should have a up to date binding for Sourceview 3. -- Mike Wey
Re: gtkDcoding Facelift Launch
On 09-07-2019 11:53, Ron Tarrant wrote: Last week, gtkDcoding saw its 50th regularly-scheduled post. Today marks the launch of stage two of the facelift we've been working toward for the last month. The new features are: Looks great, and a big thanks for putting all the effort in. -- Mike Wey
Re: Options for unit testing in D?
On 21-06-2019 06:08, Mike Brockus wrote: If you never herd about Meson before: 樂. https://mesonbuild.com/ I am wondering as to what options are available for a Meson build user when unit testing? What I am trying todo is simply rewrite my C17 project reference templates to D versions so I may show other developers the basic structure of my project if I have a question about something or to influence the idea of Meson with D projects. Excuse the Conan file. As reference: C17 https://github.com/squidfarts/c-example.git https://github.com/squidfarts/c-project.git Dlang https://github.com/squidfarts/d-example.git If you are using the D unittests in your source you can recompile the same source with `d_unittest: true`, the appstream-generator project does this: https://github.com/ximion/appstream-generator/blob/master/src/asgen/meson.build#L108 Or you can keep the tests separate and compile these test separately like you are doing in your C project. I use this option in the GlibD project: https://github.com/gtkd-developers/GlibD/blob/master/tests/gobject/meson.build -- Mike Wey
Re: GtkD 3.9.0, A GTK+ D binding.
On 02-06-2019 22:19, Adam D. Ruppe wrote: On Wednesday, 29 May 2019 at 22:07:14 UTC, Mike Wey wrote: I was already using that I see you fixed that, but I introduced a regression with my public import thing. So for a while, I had modules with a single class just go straight to that class e.g. https://api.gtkd.org/gdk.Color.html would just automatically go to here: https://api.gtkd.org/gdk.Color.Color.html and I accidentally broke that by making it list public imports as "members" so it bypassed that logic. Do you feel it is good to go straight to the classes? Or do you see value in having it still list the modules and classes separately? A list of publicly imported modules could be useful, and you would lose that if you go straight to the class. -- Mike Wey
Re: GtkD 3.9.0, A GTK+ D binding.
On 30-05-2019 11:18, Ron Tarrant wrote: On Wednesday, 29 May 2019 at 20:30:03 UTC, Mike Wey wrote: GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. At this point it feels long overdue, but finally there is an GtkD release that is updated for the latest GTK+ libraries. So... This is compliant with GTK 3.96? The latest stable version: 3.24.8. -- Mike Wey
Re: GtkD 3.9.0, A GTK+ D binding.
On 29-05-2019 23:37, Adam D. Ruppe wrote: On Wednesday, 29 May 2019 at 20:30:03 UTC, Mike Wey wrote: And i finally took the time to change the documentation on the website from candydoc to one generated by Adam's adrdox. https://api.gtkd.org A tip: when you generate the code with adrdox, use --special-preprocessor=gtk I was already using that, but looking a bit closer it only works when also passing `--jobs=1`. (Or changing `string specialPreprocessor` in doc2.d to `__gshared'). Should be updated soon. BTW nice work on teh css! It obviously needs to match the website ;) -- Mike Wey
Re: GtkD 3.9.0, A GTK+ D binding.
On 29-05-2019 22:38, M.M. wrote: So cool! I guess it will be a lot of work to get the bindings and wrapper to the upcoming GTK 4... Hopefully the generator can handle most of it without intervention. -- Mike Wey
GtkD 3.9.0, A GTK+ D binding.
GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. At this point it feels long overdue, but finally there is an GtkD release that is updated for the latest GTK+ libraries. And i finally took the time to change the documentation on the website from candydoc to one generated by Adam's adrdox. https://api.gtkd.org Full changelog: https://gtkd.org/changelog.html Download: https://gtkd.org/download.html -- Mike Wey
Re: GtkD slows down visual D keyboard
On 26-04-2019 10:31, Amex wrote: When debugging under visual D, the keyboard response is slowed down to the extreme. This is a Gtk issue I believe. It only has to do with the keyboard. For example, if I hit F10 to step, it takes the ide about 10 seconds to "respond" and move to the next line... yet the mouse can access stuff instantaneous. I believe Gtk or GtkD is slowing down the keyboard input somehow and for some reason making debugging apps a nightmare since it literally takes about 100 times longer to debug than it should. searching google reveals: https://github.com/Microsoft/vcpkg/issues/4529 https://developercommunity.visualstudio.com/content/problem/42018/debugging-with-keyboard-very-slow.html "You somehow break keyboard shortcuts during debugging in VS if the application you're debugging is registering a callback with "SetWindowsHookEx" from user32.dll with hook ID "WH_KEYBOARD_LL". Don't call it in debug builds or add "if (!Debugger.IsAttached)" in front of the call to "SetWindowsHookEx" if the debugger is attached before the function is called. This brings debugging with keyboard back to the same speed as with the UI buttons for our application." This seems to be an issue with Gtk. I'm not sure if GtkD can do anything about it. Maybe somehow reroute the keyboard handler(first remove it from the hook then call it manually or reduce the number of calls to it). I can confirm that gtk call "SetWindowsHookEx" with the "WH_KEYBOARD_LL" ID upon initialization. As far as i can tell it doesn't provide a way to skip this. -- Mike Wey
Re: GTK Scale/Volume Buttons Show Muted Icon on Startup
On 25-04-2019 15:19, Ron Tarrant wrote: On Thursday, 25 April 2019 at 12:40:00 UTC, number wrote: On Thursday, 25 April 2019 at 11:36:26 UTC, Ron Tarrant wrote: When running this example of a VolumeButton, ... When using `setValue(initialValue)` after `setAdjustment()` the scale seems have the correct value. If in addition the Adjustment is created with an initial value different from the `initialValue` used with `setValue()` then the icons are also correct on startup. Though I don't know why that is. The loading issue doesn't happen here (on linux). Must be a Windows thing, then. And even explicitly setting it with setValue() doesn't help. The icon is still wrong on startup. This looks like an issue with GTK, the icon is not updated when changing the Adjustment, only when the value changes. Using setValue after setting the ajustment should work, only you have to use a different value than the initial value of the adjustment or GTK doesn't see it as a change. -- Mike Wey
Re: Retrieving Column Data from a ListStore?
On 24-04-2019 16:38, Ron Tarrant wrote: Another thing I've been struggling with is fetching data from a TreeIter. Getting the iter itself is no problem, but when it comes to getting the contents of a specific column within the iter, none of the methods I've tried have worked. In fact, it almost seems like none of them are implemented. I've written a callback function named onChanged() in the MyComboBox class that gets the TreeIter, but that's all I can get working. If anyone knows how to grab data from column 2 of the iter (see the MyListStore class at the bottom for the structure of the store) I'd be ever so grateful if you could fill in whatever else would be needed in that callback. Here's the code: ``` ... ``` The ListStore/TreeModel provides functions to retrieve the data, `gtk.TreeModelIF.TreeModelIF.getValue`. A TreeIter indicates the row these kind of function apply to. -- Mike Wey
Re: D threading and shared variables
On 07-04-2019 16:49, Archie Allison wrote: The codebase is a reasonable size so too big (and proprietary) to share. It's always run with a GUI (GTKD), it's just the difference in linking so launching (a)GUI + attached console for stdout.writeln vs. (b)just the GUI window. There's nothing I'd expect to cause races or deadlocks. How are you using the GUI, GTK is not thread safe, all gui function calls should be made from the GUI thread. Last time i checked threadsEnter and threadsLeave didn't work properly on windows. -- Mike Wey
Re: gtkDcoding Blog Post for 2019-03-29 - Grid
On 02-04-2019 17:48, Ron Tarrant wrote: On Tuesday, 2 April 2019 at 14:13:09 UTC, number wrote: Can somebody explain why getRgba() (apparently inherited from ColorChooser) does take an out parameter instead of returning an Gdk.RGBA? My understanding is this: Returning an object (as opposed to a single value) means returning a pointer rather than the entire object. And the object will cease to exist once the function returns because the scope no longer exists. So, it follows that an out variable passed in will preserve the object itself once program control returns to the caller. While that would be true for things that live on the stack, this is not the case for RGBA. The C version of getRgba uses the "out" parameter so you can pass in a existing GdkRgba, even tough that would make it more like ref. This doesn't make sense for the d binding since you will always get a new RGBA passed through the out parameter. -- Mike Wey
Re: Request some GtkD Assistance
On 27-03-2019 11:01, Andrew Edwards wrote: This would is already included in dlang.conf no? Yes furnishing an explicit path works. dmd -de -w -L/Users/edwarac/dlang/dmd-2.085.0/osx/lib/libgtkd-3.a nufsaid But why do I need to do that if it's sitting right next to phobos and DMD is already searching that directory for libraries? That because of the way the dmd and the linker interpret the arguments. -L tell dmd to pass the command that follows to the linker. To tell the linker to link with a library in a known location you would use the -l flag. For the value passed to -l the linker will prefix `lib` and postfix `.so` `.a`. So the following should work properly: `dmd -de -w -L-lgtkd-3 nufsaid' -- Mike Wey
Re: gtkD: How to paint to screen for animation
On 19-03-2019 01:54, Michelle Long wrote: I've added a function to addOnDraw for a DrawingArea and it paints using the code I have when I resize. I added a queueDraw in threadsAddIdle and it seems to draws the screen immediately but it does not seem to be called again. If I put queueDraw inside the addOnDraw routine then the animation works but it is quite slow, about 1 fps and cpu usage is 100% without it, it is 0%. You will probably want to use glib.Timeout to make the time between redraws consistent. The callBack for treadsAddIdle or glib.Idle is only called when the mainloop has nothing else to do. The cairo clock demo is a good example: https://github.com/gtkd-developers/GtkD/blob/master/demos/cairo/cairo_clock/clock.d If performance is an issue one option would be to save your context in a cairo surface and only redraw the parts that have changed. -- Mike Wey
Re: GtkD Blog Now Up and Running
On 31-01-2019 21:33, Ron Tarrant wrote: On Wednesday, 30 January 2019 at 21:21:24 UTC, Mike Wey wrote: This is whats going on: https://issues.dlang.org/show_bug.cgi?id=15418 To work around this you can either build things with "--arch=x86mscoff" or tell dub not to build the debug version with "--build=plain". Ah! Thanks, Mike. Does the lack of an answer to the last question there mean that this is an on-going issue? Yes, the issue is still open / on-going. -- Mike Wey
Re: GtkD Blog Now Up and Running
On 30-01-2019 21:07, Jacob Carlborg wrote: On 2019-01-30 11:35, Ron Tarrant wrote: You said you're on OSX, right? Is it possible that dub just isn't as cooperative on Windows 10? Of course, if you can see something in this output that hints at a fix, please let me know. It's Optlink being stupid as always. If you want to figure out what's wrong you can invoke Dub with the "--verbose" flag to have it print the commands it's running, i.e. how it's invoking the compiler and the linker. You can do the same thing when invoking the compiler manually by adding "-v" to see how it links the application and compare that with Dub. Or, you can try compiling as COFF instead of OMF which will not use Optlink. Add the flag "--arch=x86mscoff" when invoking Dub. This is whats going on: https://issues.dlang.org/show_bug.cgi?id=15418 To work around this you can either build things with "--arch=x86mscoff" or tell dub not to build the debug version with "--build=plain". -- Mike Wey
Re: problem extracting data from GtkSourceView using Gtkd
On 17-01-2019 00:31, Chris Bare wrote: Are the widgets destroyed before onShutdown? The onShutdown callback is run after the GTK main loop terminates, so most objects would be finalized. -- Mike Wey
Re: problem extracting data from GtkSourceView using Gtkd
On 14-01-2019 23:52, Chris Bare wrote: I would have posted this in the Gtkd forum, but it has been down for a while. I'm porting a GTK2/C program to Gtkd. I'm trying to read the data from a GtkSourceView, but when I try to get the bounds, it's always zero. Here's the c version that works: GtkSourceBuffer *bf; GtkTextIter start, end; int len; bf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w.mainTxt)); gtk_text_buffer_get_bounds (GTK_TEXT_BUFFER(bf), , ); data = gtk_text_buffer_get_text (GTK_TEXT_BUFFER(bf), , , FALSE); Here's what I tried in D: SourceBuffer bf; auto start = new TextIter(); auto end = new TextIter(); bf = this.mainTxt.getBuffer (); bf.getBounds (start, end); string str = bf.getText (start, end, false); getBounds is defined as: getBounds(out TextIter start, out TextIter end) Is there something I'm doing wrong? Any suggestions on what else to try? Your code looks correct, and when copying it into the GtkD sourceview demo str does indeed hold the text displayed in the GtkSourceview. Do you have a more complete example we could look at? -- Mike Wey
Re: Blog post: What D got wrong
On 18-12-2018 19:52, Russel Winder wrote: On Tue, 2018-12-18 at 16:50 +, Neia Neutuladh via Digitalmars-d-announce wrote: Is there a video link for that talk? I'd be interested in hearing it. The videos are here: https://gstconf.ubicast.tv/channels/#gstreamer-conference-2018 I think they recorded the lightning talks as a single video, so you'll have to fast forward to my little bit. If you are only interested in the MeTV part, this is the start of that lighting talk: https://gstconf.ubicast.tv/permalink/v125ac3127116gnuo89h/#start=2561 -- Mike Wey
Re: Blog post: What D got wrong
On 11-12-2018 12:10, Atila Neves wrote: On Tuesday, 11 December 2018 at 11:08:29 UTC, user1234 wrote: On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote: A few things that have annoyed me about writing D lately: https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/ I agree about template lambdas. But is something that misses really an error ? It's debatable. I thought it was funny that it was an oversight given the fact that D had lambdas to avoid the problems that C++ used to have, then went and made the "same" mistake again. It isn't as bad as the example in the blog post, this also works: ``` range.map!(fun).filter!(gun).join; ``` -- Mike Wey
Re: DMD32 compiling gtkd out of memory on 32bit Windows 7 machine
On 9/14/18 4:02 AM, dangbinghoo wrote: thanks timoses , singleFile mode works for building, but when linking, I got this: -- OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 9: Unknown Option : LLIB OPTLINK : Warning 9: Unknown Option : WIN32 C:\Users\Administrator.USER-20180912OL\AppData\Local\dub\packages\gtk-d-3.8.3\gtk-d\.dub\build\library-debug-windows-x86-dmd_2082-9C5C1D99F672708E9D6D6FE9E60296B4\gtkd-3.lib Warning 178: .LIB pagesize exceeds 512 C:\Users\Administrator.USER-20180912OL\AppData\Local\dub\packages\gtk-d-3.8.3\gtk-d\.dub\build\library-debug-windows-x86-dmd_2082-9C5C1D99F672708E9D6D6FE9E60296B4\gtkd-3.lib Error 7: Out of Memory Error: linker exited with status 1 dmd failed with exit code 1. --- I think that DMD should give up it's DMC linkers, using MinGW ld instead. DMC linker is not even a working linker. You will also have to pass `--build=plain` to dub because of a optlink bug. https://issues.dlang.org/show_bug.cgi?id=15418 -- Mike Wey
Re: Load D shared library on windows x64
On 18-08-18 02:31, Tofu Ninja wrote: On Friday, 17 August 2018 at 20:27:05 UTC, Tofu Ninja wrote: Its this part that fails... always returns null HMODULE h = cast(HMODULE) Runtime.loadLibrary(dllName); if (h is null) { writeln("error loading"); return; } I there any way to see why Runtime.loadLibrary is failing? It just returns null on error which is not very helpful. You can probably use: core.sys.windows.winbase.GetLastError -- Mike Wey
Re: Dub support was added to Meson
On 07-08-18 22:33, Atila Neves wrote: How does it track dependencies given that ninja needs functionality akin to gcc's to do that? Or does it always compile everything if any file changes? It currently only tracks dependencies when using gdc, for dmd and ldc dmd pull 6961[1] would have to be merged so that support can be extended to the other compilers. So when using ldc or dmd you will currently have to call 'ninja clean && ninja' to compile everything. [1] https://github.com/dlang/dmd/pull/6961 -- Mike Wey
Re: GDB + ddemangle
On 20-04-18 12:36, drug wrote: 20.04.2018 13:03, Joakim пишет: You are aware that gdb has built-in support for demangling D for 3-4 years now? But how to enable it? It doesn't work out of box at least for me. It should be automatic when the executable is build with debugging info. `-g` -- Mike Wey
Re: Gtk-D API Documentation now on dpldocs.info
On 08-03-18 02:27, Adam D. Ruppe wrote: GtkD is a D wrapper to the GTK library. It has plenty of doc comments attached... but they are in a special GTK syntax and all the cross references refer to C structs and functions instead of to D classes and methods. Well, adrdox got some special-case code to handle this and do the translations for us! I'd say I got it about 95% handled automatically... and I like the result a lot more than the official docs for either D or C. Take a look! http://gtk-d.dpldocs.info/index.html Well, I made a mistake generating these and there's a broken image and link in the header... but the text body looks pretty good! You can navigate around there and even go to the root and see all the various packages included in gtkd: http://gtk-d.dpldocs.info/gtk.html Any Gtk-D users here who can give me some practical feedback? Unlike most dub packages, gtkd is just too big to automatically generate on the server, so I have to do it on my computer and copy the (almost 26,000!!!) files up to the 'net. So I won't update it frequently, but I will keep improving if I hear good ideas. It looks great. Only glib (http://gtk-d.dpldocs.info/glib.html) seems to be broken / missing. -- Mike Wey
Re: Elegant way to use dynamic bindings
On 09-02-18 15:04, Dennis wrote: I read the Derelict documentation a while ago, I didn't grasp all of it. Reading it again, I can now make sense of it though. :) On Friday, 9 February 2018 at 12:53:44 UTC, Mike Parker wrote: Did you link with the library you created with implib? That linker error suggests you didn't. I added `pragma(lib, "mupen64plus.lib");` above the extern(C) block. Adding `libs "mupen64plus"` to dub.sdl doesn't make a difference. The thing that confuses me is that the import lib has symbols without underscore prefix (I see them when running `libunres -p mupen64plus.lib`), but when I change the function pointer declaration into a function declaration it tries to link "_CoreGetAPIVersions" and can't find it. I put the .dll's in the root of the project directory by the way. Does that count as a "system library search path"? You may need to pass `/s` to implib so it will add the underscore to the symbol in the import library. If it's actually needed depends on what the dll uses. -- Mike Wey
Re: Bootstrap D template
On 01-02-18 22:53, Tony wrote: On Monday, 29 January 2018 at 11:04:19 UTC, Seb wrote: https://github.com/wilzbach/d-bootstrap Happy bootstrapping! What does "|" do in a makefile? The target depends on `bin` but don't rebuild the target if `bin` is newer than the target. https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html#Prerequisite-Types -- Mike Wey
Re: Blog post: using dynamic libraries in dub
On 19-12-17 18:58, Neia Neutuladh wrote: From the "it's a hacky workaround but it's what we've got" department: how to use dynamic libraries in dub, with GtkD as the example. GtkD takes about 45MB on its own, and that means it can take a fair bit of time to build anything that depends on it -- even if it only uses a handful of symbols. Building it as a dynamic library can shrink compile times significantly. https://blog.ikeran.org/?p=323 An example of this strategy in use: https://git.ikeran.org/dhasenan/resin-browser/src/master/dub.json And for GtkD, that is why it would make sense to relay on the packages supplied by your distribution. And just list "gtkd-3" in the "libs" section. Avoiding the need for the workaround to build a shared version. -- Mike Wey
Re: What's the proper way to use std.getopt?
On 12-12-17 00:35, Seb wrote: D style would be to use sth. like this (instead of try/catch): ``` scope(failure) { e.msg.writeln; 1.exit; } ``` I might have missed something, but where is `e` defined in this case? -- Mike Wey
Re: What's the proper way to use std.getopt?
On 11-12-17 21:58, Jordi Gutiérrez Hermoso wrote: but instead, the docstring from getopt is only generated if all arguments are valid, i.e. when it's the least needed because the user already knew what to input. What's the proper style, then? Can someone show me a good example of how to use getopt and the docstring it automatically generates? I would use something like this, print the help information for --help, print an error for invalid arguments: ``` try { auto helpInformation = getopt( args, "input|i", "The input", , "output|o", "The output", ); if (helpInformation.helpWanted) { defaultGetoptPrinter("Description", helpInformation.options); exit(0); } } catch (GetOptException e) { writeln(e.msg); exit(1); } ``` -- Mike Wey
Re: .LIB pagesize exceeds 512
On 10-12-17 16:57, user wrote: Could someone please list some workarounds? I am trying to compile a demo app from gtkd. I tried compiling gtkd using dub with --build=plain option and still got that error when compiling the demo app. Using the latest dmd. Thanks in advance. As far as i know the error is caused by the debug information, and using `--build=plain` for dub used to fix that, but that might have changed. You could try building gtkD with the windows build script: `rdmd Build.d` Or if possible build the 64bit version witch doesn't use optlink. https://issues.dlang.org/show_bug.cgi?id=15418 -- Mike Wey
Re: Email validation
On 28-11-17 20:32, Vino wrote: On Tuesday, 28 November 2017 at 18:51:50 UTC, Rene Zwanenburg wrote: On Tuesday, 28 November 2017 at 18:47:06 UTC, Vino wrote: Hi All, You can do this easily using the std.net.isemail module: https://dlang.org/phobos/std_net_isemail.html Hi Rene, Can you provide me a example, as the link does not have any examples. From, Vino.B isEmail returns a struct with the status of the check. You can use the valid and domainPart to check if it's a valid email address for the hotmail domain. isMail only checks the formatting of the email address and optionally if the domain has a MX record. ``` auto e = isEmail("vino.bhee...@hotmail.com"); if ( e.valid && e.domainPart == "hotmail.com" ) ... ``` -- Mike Wey
Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)
On 21-11-17 11:19, PECman wrote: On Sunday, 19 November 2017 at 13:39:39 UTC, Mike Wey wrote: On 19-11-17 08:35, PECman wrote: I complied the D application with gtkD successfully.However,I cant run it successfully.My settings are OK.I dunno why it happened to me:-( Who can help me? That line usually includes the error returned from LoadLibrary which should give an indication of why it failed. I assume you installed the GTK runtime for the architecture you are building for ( 32 or 64 bit ). But the error is the messy code. I have already installed the GTK runtime 32 bit(on Windows 7 32 bit) What shall I do next? That's unfortunate, usually there is some info on why it fails after the `(libgio-2.0-0.dll)`. First check if the `bin` directory of the GTK installation is on the PATH, and if there are any other GTK installs on the PATH, GtkD should try to detect the correct runtime to use but that might have failed. -- Mike Wey
Re: GtkD help
On 18-11-17 22:57, Ivan Trombley wrote: I have this small application for viewing select log data from a certain game that I originally wrote in C++/Qt. For various reasons, I decided to rewrite this app in D using gtk-d. First, I have to say that the documentation for gtk-d is atrocious! However, I managed to cobble together enough information to get 80% of it done. I would like to be able to controll how the cells in a TreeView are rendered (ie the text color used) but I'm not able to find any information about how to do this. Does any one have experience here? If so, can you please give me a clue? To change how a cell is rendered you will need to add a CellRenderer to the column, a CellRendererText would be used for rendering text and it has a foreground property to change the text color. A small example on using CellRenderers can be found here: https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/DemoMultiCellRenderer/DemoMultiCellRenderer.d If the color needs to differ between the different rows you can use TreeViewColumn.addAttribute to map a property of an renderer to a value on the TreeModel. If the color depends on the value of the cell TreeViewColumn.setCellDataFunc() is also an option. -- Mike Wey
Re: object.Exception@generated\gtkd\gtkd\Loader.d(125):Library load failed(libgio-2.0.0.dll)
On 19-11-17 08:35, PECman wrote: I complied the D application with gtkD successfully.However,I cant run it successfully.My settings are OK.I dunno why it happened to me:-( Who can help me? That line usually includes the error returned from LoadLibrary which should give an indication of why it failed. I assume you installed the GTK runtime for the architecture you are building for ( 32 or 64 bit ). -- Mike Wey
Re: Unable to compile GtkD on windows
On 15-11-17 20:25, user wrote: I tried compiling GtkD, I get the error message: rdmd Build.d Error: more than 32767 symbols in object file 1. How to work around this? 2. Is D still unfriendly to newbies? I am disappoint :-( Using: DMD 2.077 GtkD 3.7.1 gtk3-runtime_3.22.24-1, 32bit It looks like dmd 2.077 generates more symbols than 2.076. I've updated the build script to work around this by splitting the largest package even more than before: https://github.com/gtkd-developers/GtkD/commit/9ac582dc0a7fa1ce958a15048b6bcc3ddbcad858 A work around would be to use dmd 2.076.1 or build with dub. Tough with dub you will need to pass `--build=plain` because of dmd issue: https://issues.dlang.org/show_bug.cgi?id=15418 -- Mike Wey
Re: opCast fails when this is null.
On 28-10-17 16:22, Nicholas Wilson wrote: On Saturday, 28 October 2017 at 14:19:01 UTC, Nicholas Wilson wrote: As Basile mentioned, this is compiler sticking checks in behind your back. The reason it works on new LDC is because #6982 was cherry picked to LDC (1.3?) before it was merged into dmd (not sure what version, I though it was 2.076, but it might have been one of the betas of 2.077) because I needed it for DCompute to build without -release. The only course is to use recent compilers. Erm, 2.077 is not a thing yet. Does it work with 2.076.1? No, it does work with the 2.077 beta tough. -- Mike Wey
opCast fails when this is null.
The following code runs correctly when compiled with ldc (1.4.0) but fails with an assert error when compiled with dmd (2.076 and ldc 1.2.0) ``` class A { } class B { T opCast(T)() { return this; } } void main() { A a = null; B b = null; auto c = cast(Object)a; auto d = cast(Object)b; // Fails with: core.exception.AssertError@test.d(8): null this } ``` How would you write an opCast that would handle this case correctly? Testing if this is null at the start of the opCast doesn't help since the assert is thrown before that happens. Making the opCast static leaves us without access to this, which would be needed in my use case. We can't relay on ufcs since the rewrite to opCast doesn't happen when it's not a member function. -- Mike Wey
GtkD 3.7.0 released, GTK+ with D.
GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL license. Apart form the biannual update to the latest glib/gtk version, this release adds bindings for Gstreamer Mpegts and Gstreamer AppSink. Full changelog: http://gtkd.org/changelog.html Download: http://gtkd.org/Downloads/sources/GtkD-3.7.0.zip -- Mike Wey
Re: Best way to display images with GTKD
On 01-10-17 01:56, Psychological Cleanup wrote: I have to display images with a few controls: alpha channel, rotation, scaling, cropping. Generally it should be png but I want to be able to handle many images. The images will be memory based(I'll load the file in to memory then) and will be displayed in a drawing area. Any ideas how to go about this correctly? For displaying an image you can use gtk.Image. Rotating, scaling and cropping should be doable by loading the image into a cairo surface and then applying the transformations. But that doesn't support things like changing the alpha channel. -- Mike Wey
Re: Creating a dynamic library
On 30-09-17 03:27, Tony wrote: One thing I picked up from SCons is creating dynamic object files with a .os extension and static object files with the standard .o extension. That way they can be compiled in the same directory in the same build step. But dmd rejects the files that are named *.os. Is there an extension besides .o that dmd would accept for the dynamic object files? I've been using .pic.o so it still ends with .o for dmd. -- Mike Wey
Re: how to build project with locally compiled phobos
On 23-09-17 13:58, Mengu wrote: hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full path to new libphobos.so with -defaultlib to dflags - full path to new libphobos.so to lflags i checked with ldd and saw the original libphobos.so was used. my current workaround is copying mine to /usr/lib. thanks in advanced. While you are linking with the phobos you compiled yourself with -defaultlib, ldd (and your binary) will pickup the one available in one of the paths configured for the run-time shared library loader. To actually make use of the phobos you compiled you also need to set the rpath. ``` -L-rpath=/path/to/phobos ``` Or use phobos as a static library. -- Mike Wey
Re: Gtk toArray List funkiness
On 16-09-17 23:08, Joseph wrote: On Saturday, 16 September 2017 at 20:54:21 UTC, Mike Wey wrote: On 16-09-17 20:58, Joseph wrote: https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d has the code foreach ( int i, string selection ; fs.getSelections()) { writeln("File(s) selected [%d] %s",i,selection); } which is invalid for the demo, but foreach ( int i, string selection ; fd.getFilenames().toArray!(string,?)) { writeln("File(s) selected [%d] %s",i,selection); } results in some funky code. Gives errors in ObjectG about uint when setting ? to string, string* or void* or even uint: GtkD\generated\gtkd\gobject\ObjectG.d(172): Error: incompatible types for ((obj) is (null)): 'uint' and 'typeof(null)' GtkD\generated\gtkd\glib\ListSG.d(98): Error: template instance gobject.ObjectG.ObjectG.getDObject!(string, string, uint) error instantiating test.d(91): instantiated from here: toArray!(string, uint) test.d(93): Error: invalid foreach aggregate `fd.getFilenames()`, define opApply(), range primitives, or use .tupleof without specifying ? it assumes it's a tuple, which seems wrong? public T[] toArray(T, TC = typeof(T.tupleof[0]))() { T[] arr = new T[length()]; ListSG list = this; size_t count; while(list !is null && count < arr.length) { arr[count] = ObjectG.getDObject!(T)(cast(TC)list.data); list = list.next(); count++; } return arr; } foreach ( int i, Value selection ; fd.getFilenames().toArray!(Value)()) { writeln("File(s) selected [%d] %s",i,selection.getString); } crashes ;/ I'm not sure what types are what and it changes depending on the input. I think Value is the wrong type to use but string doesn't work so... ListG and ListSG are missing an toArray overload for string. And getFilenames returns a list of strings. I've added a string overload for toArray: https://github.com/gtkd-developers/GtkD/commit/ba20490b38e502a4d281226572c83c662a700858 public ListSG getFilenames() { auto p = gtk_file_chooser_get_filenames(getFileChooserStruct()); if(p is null) { return null; } return new ListSG(cast(GSList*) p, true); } Doesn't return a list of strings? That was the first thing I tried and the foreach loop wouldn't work over it because it was a ListSG. Thanks. getFilenames returns a singly linked list of C strings, ie the data member is a char*. With the changes in master you can use toArray!string() to get an array of strings out of it. Or you can loop over the list: ``` auto list = fd.getFilenames(); string[] files; while ( list.next !is null ) { files ~= to!string(cast(char*)list.data); list = list.next; } ``` -- Mike Wey
Re: Gtk toArray List funkiness
On 16-09-17 20:58, Joseph wrote: https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d has the code foreach ( int i, string selection ; fs.getSelections()) { writeln("File(s) selected [%d] %s",i,selection); } which is invalid for the demo, but foreach ( int i, string selection ; fd.getFilenames().toArray!(string,?)) { writeln("File(s) selected [%d] %s",i,selection); } results in some funky code. Gives errors in ObjectG about uint when setting ? to string, string* or void* or even uint: GtkD\generated\gtkd\gobject\ObjectG.d(172): Error: incompatible types for ((obj) is (null)): 'uint' and 'typeof(null)' GtkD\generated\gtkd\glib\ListSG.d(98): Error: template instance gobject.ObjectG.ObjectG.getDObject!(string, string, uint) error instantiating test.d(91): instantiated from here: toArray!(string, uint) test.d(93): Error: invalid foreach aggregate `fd.getFilenames()`, define opApply(), range primitives, or use .tupleof without specifying ? it assumes it's a tuple, which seems wrong? public T[] toArray(T, TC = typeof(T.tupleof[0]))() { T[] arr = new T[length()]; ListSG list = this; size_t count; while(list !is null && count < arr.length) { arr[count] = ObjectG.getDObject!(T)(cast(TC)list.data); list = list.next(); count++; } return arr; } foreach ( int i, Value selection ; fd.getFilenames().toArray!(Value)()) { writeln("File(s) selected [%d] %s",i,selection.getString); } crashes ;/ I'm not sure what types are what and it changes depending on the input. I think Value is the wrong type to use but string doesn't work so... ListG and ListSG are missing an toArray overload for string. And getFilenames returns a list of strings. I've added a string overload for toArray: https://github.com/gtkd-developers/GtkD/commit/ba20490b38e502a4d281226572c83c662a700858 -- Mike Wey
Re: How to get DnD to work in GTKD?
On 16-09-17 06:33, Joseph wrote: I've used null in place of [te]. I'm not sure what target entry is for and if that is the problem or what. I am trying to drag files from windows explorer to a grid or label(I duplicated the code above for the label) and none the callbacks are ever called. I only need the filename of the file being dragged. I will eventually also need to drag one list element to another(virtually so, I just need to know the index that was dragged). Thanks. You will also need to set an TargetList to tell gtk that you want to receive text: ``` TargetList lst = new TargetList([]); lst.addTextTargets(0); w..dragDestSetTargetList(lst); ``` for simple cases only `addOnDragDataReceived` will be needed, `addOnDragDataGet` is only used for the source and `addOnDragDrop` can be used to filter the things that can be droped. List and Treeviews there are funtions like `getDragDestRow` available with the TreeView widget. -- Mike Wey
Re: GtkD mouse latency issues
On 11-09-17 06:29, Joseph wrote: I have a GTK paned element and when I click to drag the handler, it does not respond immediately. I have to hold the left mouse button down for about 1 second and not move it before it "catches" and lets me drag, else I does not move. I'm using Glade and the most simple example of a paned widget. Any ideas what could be causing this? Is GtkD introducing any type of UI response latency for the paned handle? In my app I have an icon/image that responds immediately. Is polling being used by any chance for handling some of these events? I'm trying to determine if this is a Gtk or GtkD issue. The delay makes it pretty frustrating to use because it is an unnaturally long wait. Users will just want to click and immediately drag rather than wait a second to drag. As far as I can tell, this only seems to be a problem with the paned handle, but I'm not 100% sure. It doesn't seem to be a UI update issue or it would eventually "catch up" with the movement of the mouse, which it doesn't. I can't seem to reproduce the issue, at least not on linux. If you haven't connected any signals everything should be handled by GTK. If you have some signals connected to the pane or other widgets, that might cause the issue. -- Mike Wey
Re: vibed services stop response after several days of work
On 01-09-17 10:01, Suliman wrote: I got same problem on Windows Server 2016 and on Linux Debian 8.5. I have few very simple backend based on vibed 0.8.1, compiler dmd 2.075.1. nginx servise is do port forwarding. Nothing more is used. After several days of working I am begining to get "502 Bad Gateway" error. The service is not down, it's continue to working, but on Windows task manager I seen very low memory usage (0.4MB) and on Linux I see next: https://snag.gy/ban3jX.jpg (i am not familiar with Linux and do not sure if process is alive or not because htop do not show it) The code is *very* simple https://github.com/bubnenkoff/dlang.ru Is there any ideas how to diagnostic the problem? For the linux screenshot ps also includes the grep process you are pipping the ps output to. So your vibe.d instance isn't running. Are you running an release build? If so you might get a better idea of whats going on when using a plain or debug build. -- Mike Wey
Re: Symbols missing, unmangle!
On 30-08-17 23:51, Moritz Maxeiner wrote: 2) Try to get demangling of D symbols into upstream of the currently common linkers (GNU linker, gold, lld, etc.) The GNU linker and gold support demangling D symbols, so if you are on linux try adding `-L--demangle=dlang` to the dmd commandline. -- Mike Wey
Re: Building (and including libraries) without dub
On 26-08-17 12:02, drug wrote: 26.08.2017 12:03, Hasen Judy пишет: Building simple programs without dub is easy, just pass a list of .d source files to `dmd` or `ldc2`. What if I want to include a 3rd party library? Surely before dub existed, people were incorporating other libraries in their projects. I want to learn how this works from first principles. I've been working with dynamic/interpreted languages for too long, I forgot what it's like to build native programs without a dependency manager. Any help would be appreciated! It's like C++. If you use Linux then: ``` dmd -L/path/to/lib -llibrarynamewithoutlibprefix ``` or example ``` dmd myapp.d -L../otherproject/lib -lcool ``` line above compiles `myapp.d` file and links it with library `libcool` that is place in directory `../otherproject/lib` You will need an extra `-L` to pass things to the linker with dmd. ``` dmd myapp.d -L-L../otherproject/lib -L-lcool ``` -- Mike Wey
Re: GStreamer issues.
On 22-08-17 02:13, Johnson wrote: I can't get the example to work(although slightly modified). The installed version of GStreamer is 1.12.2 The file is: D:\temp\test.ogg Loading Setting to PLAYING. Running. XError: Could not demultiplex stream. dbug: gstoggdemux.c(4418): gst_ogg_demux_find_chains (): /GstPipeline:audio-player/GstOggDemux:ogg-parser: can't get first chain Actually I was getting a much worse error before ;/ I can't remember it now. The installed version of GStreamer is 1.12.2 The file is: D:\temp\test2.wav Loading Setting to PLAYING. Running. XError: Internal data stream error. dbug: gstwavparse.c(2249): gst_wavparse_loop (): /GstPipeline:audio-player/GstWavParse:wav-parser: streaming stopped, reason not-linked (-1) Basically all I did was change the sink: sink = ElementFactory.make("autoaudiosink", "auto-output"); So it I could get past the error about alsa. I think the last name doesn't matter? I downloaded the gstreamer binaries from their site, had some issues with a few of the dll's complaining about gxx errors, I removed them(h264, soundtouch, tag). For the wav I changed //parser = ElementFactory.make("oggdemux", "ogg-parser"); //decoder = ElementFactory.make("vorbisdec", "vorbis-decoder"); parser = ElementFactory.make("wavparse", "wav-parser"); decoder = ElementFactory.make("audioconvert", "wav-decoder"); which, is all i could find on line, I don't know if it's right at all. Ultimately I want to be able to read somewhat arbitrary audio formats(most common at least), get the raw channel data(samples for each channel), play/pause/stop with good accuracy(no latency or low latency(<20ms), possibly do some pitch shifting and basic mixing(EQ, limiting, panning, etc), and eventually play some videos. Is GstreamerD going to be useful for this or so I look in to using ffmpeg directly and do some of the stuff(e.g., eq) myself? Thanks. The Gstreamer demo should use an `playbin` instead of explicitly setting the pipeline, Like this: https://github.com/gtkd-developers/GtkD/blob/master/demos/gstreamer/helloworld/gstreamer_helloworld.d This way gstreamer will detect the file type, i don't know if it helps with the errors. -- Mike Wey
Re: GtkD: New widget
On 22-08-17 01:38, Johnson wrote: On Monday, 21 August 2017 at 20:54:04 UTC, Mike Wey wrote: On 21-08-17 03:45, Johnson Jones wrote: [...] If you want gtk to know about the functions you override you could use gtkd.Implement.ImplementCLass. [...] Thanks, I'll test it out when I get a chance. I was able to work around the issue for now but I imagine I'll need the ability to implement my own container in the future. BTW, when I try to create a value I get an error about opCall Value handleSize = new Value(0); vs Value handleSize = Value(0); I'd rather not create a value on the heap when I only need it locally. Could you add a way to create the value with the right type to Value? Even static constructors would work(probably could templatize it). Although, I'm not sure how much it matters since value itself seems to allocate on the heap ;/ public this() { this(new GValue); } But it might help reduce some memory waste. `Value` is a class so you will need to use `new`. -- Mike Wey
Re: GtkD: New widget
On 21-08-17 03:45, Johnson Jones wrote: Hey Mike, I bet you can answer this! I'd like to extend a widget to add some functionality. class MyBox : Box { protected GtkBox* gtkBox; import std.typecons; _gtk.Box Wrapped; mixin Proxy!Wrapped; public this(Box b) { this.gtkBox = b.getBoxStruct(); super(gtkBox, false); } } Trying something like the above does extend the box, as far as allowing one to replace it, I think(using the code); auto b = new MyBox(W1); auto p = W1.getParent(); auto c = cast(Box)W4; c.remove(W1); c.add(b); So, W4 is the main boxx, W1 is the box inside the main box I replaced with the new box b. When running that code, nothing changes, which, assuming we are actually using the new box, then that is fine. But I'm pretty sure that gtk never has a clue about `MyBox`? I say this because I'd like to simply modify the reported sizes of the box. A gtkBox is not the same as a gtk.Box. It seems like the best I can do is use a gtk.Container and inherit from that. e.g., class FixableSizedBox : Container { protected GtkContainer* gtkContainer; import std.typecons; _gtk.Container Wrapped; mixin Proxy!Wrapped; public this(Container b) { this.gtkContainer = b.getContainerStruct(); super(gtkContainer, false); } } But even the GtkD container doesn't seem to contain any code to deal with handling the sizes. All I'm really looking to do is set the size of a container to whatever I want. If you want gtk to know about the functions you override you could use gtkd.Implement.ImplementCLass. It's only in master and not completely finished yet, but you could use it to for example overrride the getPreferredHeight and getPreferredWidth functions. I'm not completely clear on what you want to do with the size so they might not be the correct functions to override. ``` class MyBox : Box { import gtkd.Implement; import gobject.c.functions : g_object_newv; mixin ImplementClass!GtkBox; this() { //TODO: sort out the constructor. super(cast(GtkApplication*)g_object_newv(getType(), 0, null), true); } override public void getPreferredHeight(out int minimumHeight, out int naturalHeight) { //Set minimumHeight and naturalHeight. } override public void getPreferredWidth(out int minimumWidth, out int naturalWidth) { //Set minimumWidth and naturalWidth. } } ``` -- Mike Wey
Re: GtkD: Build script
On 20-08-17 20:41, Johnson Jones wrote: I guess I see why now you did what you did! ;) .LIB pagesize exceeds 512 https://issues.dlang.org/show_bug.cgi?id=15418 Wanna take bets on how many *years* this takes to get fixed?!? That one happens when GtkD is build with debug symbols. The main library is build by package because optlink or omf doesn't support more that 32767 symbols in one object file, and i hit that limit. -- Mike Wey
Re: Module Info error
On 19-08-17 04:07, Johnson Jones wrote: Still getting this! What I don't understand is why I can import certain libraries and they compile fine while others don't! So, moduleInfo is a "function" per module that is created at compilation, right? If one doesn't compile the module then the error results, just like standard extern functions. When I don't include the file in the project, it doesn't get compiled, even though it gets "imported"? Why? Why can't D just know, hey, module X imports module Y, module Y needs to be compiled to add moduleInfo? For example, I am trying to get ffmpeg to work. I downloaded from https://github.com/complistic-gaff/ffmpeg-d extracted, put that path in my includes(sc.ini). created a module to import the standard modules, tried to compile my project and I get a bunch of ModuleInfo errors relating to the imports I added. I use GtkD exactly the same, yet no errors. Now, the only difference is that I import the gtkD.lib. I'm assuming that all the moduleInfo's of the 1000+ gtk files are in that lib and so That is the reason I don't have the compile them all, is that correct? If so, how can I generate such a lib of moduleInfo's recursively for a directory so I can pick up all the files and just import it once? ffmpeg doesn't require compiling but I don't wanna have to include ever file in to my project just to be able to get it to work because of the moduleInfo's are missing. Looking at the build.d for gtkD, it looks like it builds a list of all the files to compile and does it recursively. I imagine it can be modified for ffmpeg too to create a utility to solve this problem. Dmd should have a mode to do this automatically, it's quite an annoying problem ;/ You need to either compile ffmpeg-d in to a library and include it when you are building your application, or pass all the ffmpeg-d source files to the compiler. It looks like ffmpeg-d only has a dub.json file for building so you will need to use dub to build it eg: `dub build` from the root of the project. -- Mike Wey
Re: GtkD on android
On 19-08-17 01:55, Johnson wrote: Hey Mike, have you put in thought or effort in to getting GtkD working on android? e.g., https://github.com/eugals/GTKAndroid/wiki/Building If I get around to it and no one has beating me before, I will try to compile something like the above and get the gtk libs required then use the new ldc to create an app for android. No, but it would be interesting to see if you can get things working. -- Mike Wey
Re: GtkD: How to respond to cell edit's?
On 18-08-17 02:30, Johnson Jones wrote: On Friday, 18 August 2017 at 00:27:05 UTC, Johnson Jones wrote: I should also mention that when I use an ID to do what I want(again, something I don't want to do), I also need to get the column that was edited. This is because I'm using one delegate for all the edits. auto cb = delegate(string index, string text, CellRendererText r) { // How to get the column of that we are editing? An index would be fine. writeln(index, " - ", text); }; RT1.addOnEdited(cb); RT2.addOnEdited(cb); RT2.addOnEdited(cb); Looks like I might have to use separate edit handlers ;/ I wonder if I can somehow template it so I can do something like RT1.addOnEdited(cb!1); RT2.addOnEdited(cb!2); RT2.addOnEdited(cb!3); without having to write a bunch of code to make it happen. Maybe there is a library function that can help? Obvious it is easy when you have ID's, but this is meant for the original case where I'm not using ID's. A far as i can tell using id's is the only option. You can use a templated function as a delegate: ``` void cb(int column)(string index, string text, CellRendererText r) { writeln(column, " - ", index, " - ", text); } RT1.addOnEdited(!1); RT2.addOnEdited(!2); RT2.addOnEdited(!3); ``` -- Mike Wey
Re: Named multi-imports
On 16-08-17 09:58, Gary Willoughby wrote: On Tuesday, 15 August 2017 at 03:37:39 UTC, rikki cattermole wrote: On 15/08/2017 2:59 AM, Johnson wrote: Not only that, but it requires adding more files to the command line. I currently have 3 import files to separate the gtk from gdk that and the only reason they exist is to combine them in to one named import ;/ Doesn't seem like much but that's 3 extra files that don't really need to exist. Hopefully D already implements a way to do what I'm asking. Or instead of a new language feature, the gtk-d guys could have package files ;) This! Just create a PR for Gtk-D to add packages. Wouldn't that just move the problem? You then get an package that imports gtk.Window and a other package that imports gdk.Window, and if you want to use both you still need to add a renamed import or a static import in your own file. -- Mike Wey
Re: Fix gtkD api display
On 10-08-17 15:57, Adam D. Ruppe wrote: On Saturday, 5 August 2017 at 14:02:09 UTC, Mike Wey wrote: One issue is the shear size of the generated documentation, though the current version of ddox no longer generates a ton of unused files bringing the size down from 15-20GB to a mere 2GB. what?! I'm not actually sure how much gtk alone takes, but my entire doc folder is 4 GB, including a good chunk of the dub repo, phobos, druntime, my stuff, search indexes, archives, etc. I guess it is possible the gtkd is 2 GB of that, but at least it isn't 20. The problem was that there are a few large classes at the start of the hierarchy, and with the old version of ddox the function pages would not only be generated for the base class, but also for all the derived classes. So when you have a base class with 264 functions, and you have 385 classes that are directly or indirectly derived from it. Things start to add up, That is 101_640 html pages just for this one case, and there are more. Luckily this is fixed, especially because ddox never actually linked to these pages. The need to go trough the empty module page when browsing the documentation. For a lot / most? functions the complete documentation is in the overview defeating the purpose of the one page per artifact. If you guys are interested, I can do a custom adrdox for gtk that: * reads more of the gtk syntax https://developer.gnome.org/gtk-doc-manual/stable/documenting_syntax.html.en * recognizes the one-item-per-module pattern and skips the empty pages * has a style more like https://gtkd.org/index.html * Maybe a few other little things? That would be great. And im not a big fan of the one page per artifact style of documentation. Oh, it is so much better in a lot of ways. I don't use the documentation myself so this isn't really a problem. -- Mike Wey
Re: gtkD window centering message up and no app on taskbar
On 09-08-17 23:54, Johnson Jones wrote: Ok, I added import core.sys.windows.winuser; __gshared extern(C) core.sys.windows.winuser.HANDLE function(GdkWindow*) gdk_win32_window_get_handle; Linker.link(gdk_win32_window_get_handle, "gdk_win32_window_get_handle", LIBRARY_GDK); to GtkD\generated\gtkd\gdk\c\functions.d and rebuilt and it seems to work. Hopefully that is the right place so in the future when I replace GtkD with it won't show up as a bug in my code somewhere. I assume master will be updated with this at some point? That would be the correct place. If it is added to GtkD it won't be in functions.d, which is generated. It would be something like: gdk.c.win32. -- Mike Wey
Re: gtkD window centering message up and no app on taskbar
On 09-08-17 01:00, Johnson Jones wrote: But, finally, this does seem to work: // Fixup missing taskbar icon void SetTaskBarIcon(gtk.ApplicationWindow window) { version(Windows) version(X86) { import core.sys.windows.winuser, gdk.Window; auto handle = cast(core.sys.windows.winuser.HANDLE)gdk_win32_window_get_handle(gtk.gtk_widget_get_window(window.getWidgetStruct())); ShowWindow(handle, SW_HIDE); //SetParent(handle, null); SetWindowLong(handle, GWL_EXSTYLE, GetWindowLong(handle, GWL_EXSTYLE) | WS_EX_APPWINDOW); ShowWindow(handle, SW_SHOW); } return; } Of course, along with this: MainWindow.addOnShow((Widget widget) { MainWindow.SetTaskBarIcon(); }); `gdk_win32_window_get_handle` I spend way to much time looking for a function like this, before giving up and doing the pointer arithmetic. This should do it for getting the function: ``` import gtkd.Loader; import gdk.c.functions; //Still at gtkc.gdk for 3.6. __gshared extern(C) HANDLE function(GdkWindow*) gdk_win32_window_get_handle; Linker.link(gdk_win32_window_get_handle, "gdk_win32_window_get_handle", LIBRARY_GDK); ``` I did find out that gdk set the Desktop window as the parent window and doesn't set `WS_EX_APPWINDOW` i should try if setting it for top level windows would fix this from within gdk. -- Mike Wey
Re: gtkD window centering message up and no app on taskbar
On 07-08-17 23:52, Johnson Jones wrote: On Monday, 7 August 2017 at 20:57:08 UTC, Mike Wey wrote: On 07-08-17 22:46, Johnson Jones wrote: [...] This appears to be a GTK issue, a work around might be to get the Window handle from gtk and use the Windows API to set the taskbar visibility. Yeah, I was thinking about that but haven't yet figured out how to find the window handle ;/ To get the Window handle you could use this for 32bit Windows: ``` import gtk.c.functions; // Danger, Will Robinson! HANDLE handle = *(cast(HANDLE*)((cast(void*)gtk_widget_get_window(w.getWidgetStruct()))+4)); ``` Where w is your application window, i used this in the map event signal so the handle is actually set. To complicate things there is a race condition in gdk some ware so at random the handle isn't valid. I haven't been able to set the taskbar icon with is tough. The two attempts: -Setting the parent window to null as windows with no parent should have an taskbar icon: ``` ShowWindow(handle, SW_HIDE); SetParent(handle, null); ShowWindow(handle, SW_SHOW); ``` Or set the extended window style to WS_EX_APPWINDOW as that should fore an taskbar icon according to msdn. ``` ShowWindow(handle, SW_HIDE); SetWindowLong(handle, GWL_EXSTYLE, WS_EX_APPWINDOW); ShowWindow(handle, SW_SHOW); ``` -- Mike Wey
Re: gtkD: events being triggered twice
On 06-08-17 21:27, FoxyBrown wrote: On Sunday, 6 August 2017 at 18:26:20 UTC, Mike Wey wrote: On 06-08-17 16:58, FoxyBrown wrote: I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example. To test i put the label that is on the label page in an event box but that doesn't reproduce the issue. I get just a single event on enter and a single event on leave. Ok, I will try to work on figuring out what is going and and potentially reduce to a test case. It might be on my end. I'm pretty sure I'm not adding You might try a separator though in the event box and might try to add it handling various events(maybe even other events for the event box)... things related to the mouse. Here's the glade code for the event box I'm using 5 True False True 5 True False False vertical Try that when you get some time and see if that changes anything. If it doesn't then it's surely in my code or in the gtk version I'm using(still using msys, I'll update to what you released to see if that fixes it). At least we can narrow it down a little... Also seems to be working properly with a Separator. -- Mike Wey
Re: gtkD window centering message up and no app on taskbar
On 07-08-17 22:46, Johnson Jones wrote: On Saturday, 5 August 2017 at 20:56:10 UTC, Mike Wey wrote: Windows will only show the taskbar icon if you are not running the application from the console. Now in x64 it is showing, not in x86. So, not sure what's going on but at least it is showing. I was in a windows console and added a main.def but dmd says that it's not compatible with x64 or something: main.def(1) : warning LNK4017: EXETYPE statement not supported for the target platform; ignored main.def(4) : warning LNK4017: SUBSYSTEM statement not supported for the target platform; ignored but adding that file seemed to allow the icon like you said. I'm not doing anything different for x86 except switching gtk versions... but maybe there is a flag or setting somewhere that is causing the problem. and, in the x64 version I get both the console and gtk app task bar icons... which is what I originally wanted and expected. This appears to be a GTK issue, a work around might be to get the Window handle from gtk and use the Windows API to set the taskbar visibility. Interestingly the icon shows up after restarting explorer.exe. For 64bit apps dmd uses the microsoft linker, so you probably have to use different flags to set the subsystem. -- Mike Wey
Re: gtkD: events being triggered twice
On 06-08-17 16:58, FoxyBrown wrote: I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example. To test i put the label that is on the label page in an event box but that doesn't reproduce the issue. I get just a single event on enter and a single event on leave. -- Mike Wey
Re: gtkD: events being triggered twice
On 06-08-17 03:25, Johnson Jones wrote: GtkEventBox - Enter GtkEventBox - Enter Down GtkEventBox - Leave Up GtkEventBox - Leave GtkEventBox - Leave That is when I move the mouse over the event box then click then move out out then release. I would expect Enter Down Leave Up The fact that enter and leave are not paired equally is a problem. Can be worked around but seems like it would be a bug. the code is simply ebox.addOnEnterNotify(delegate(Event e, Widget w) { writeln(w.getName(), " - ", "Enter"); return true;}); ebox.addOnLeaveNotify((Event e, Widget w) {writeln(w.getName(), " - ", "Leave"); return true; }); Do you have an more complete example that i could test. -- Mike Wey
Re: gtkD load images
On 05-08-17 22:59, ag0aep6g wrote: On 08/05/2017 10:30 PM, Mike Wey wrote: On 05-08-17 15:23, Johnson Jones wrote: On Saturday, 5 August 2017 at 12:51:13 UTC, Mike Wey wrote: [...] There are two issues here, you need to properly escape the slash: "C:a.jpg". [...] ``` Pixbuf p = new Pixbuf(r"C:\\a.jpg"); ``` Thanks. Why do I need 4 slashes? Is that standard with gtk because strings are interpreted twice or something? Seemed to work though. Nothing specific to GTK but in D and other programing languages the \ is used as an escape character, so you can use special characters in your sting like `\n` for a newline. But this means you will need to use \\ to get an literal back slash. I think you missed the point of the question. In the end, the path should contain only one backslash. But with `"C:a.jpg"` and `r"C:\\a.jpg"` you get two. Why do you need two? Does the library do another round of escape sequence handling? That's me not being a Windows user shining trough, i somehow got it in my head that you needed two backslashes after the C:. But indeed just "C:\\a.jpg" or r"C:\a.jpg" will work as expected. -- Mike Wey
Re: gtkD window centering message up and no app on taskbar
On 05-08-17 20:14, Johnson Jones wrote: When trying to center the window. If one uses ALWAYS_CENTERED any resizing of the window is totally busted. CENTER also does not work. move(0,0) seems to not be relative to the main display. I'd basically like to center the window on the main display or at least be able to set coordinates properly. Windows sets (0,0) to be the lower left corner of the main display I believe. What happens is that the gtk window, when using 0,0 actually is like -1000,0 or something in windows coordinates and ends up on my secondary monitor. When the app starts there's no taskbar icon. Luckily I still have the console shown but Eventually I'll need the taskbar. I'm not setting skipTaskBarHint, but I have tried both true and false without any difference. gtk.Widget.translateCoordinates or gtk.Fixed could be useful for positioning the widgets. Windows will only show the taskbar icon if you are not running the application from the console. -- Mike Wey
Re: gtkD load images
On 05-08-17 15:23, Johnson Jones wrote: On Saturday, 5 August 2017 at 12:51:13 UTC, Mike Wey wrote: On 03-08-17 21:56, Johnson Jones wrote: If I do something like import gdkpixbuf.Pixbuf; Pixbuf.newFromResource("C:\\a.jpg"); There are two issues here, you need to properly escape the slash: "C:a.jpg". And a.jpg is not a resource file, so you would use the Pixbuf constuctor to load an image file. ``` Pixbuf p = new Pixbuf(r"C:\\a.jpg"); ``` Thanks. Why do I need 4 slashes? Is that standard with gtk because strings are interpreted twice or something? Seemed to work though. Nothing specific to GTK but in D and other programing languages the \ is used as an escape character, so you can use special characters in your sting like `\n` for a newline. But this means you will need to use \\ to get an literal back slash. https://dlang.org/spec/lex.html#double_quoted_strings You can also use an wysiwyg string by using `r"` at the start so what you type is what you get. https://dlang.org/spec/lex.html#wysiwyg -- Mike Wey
Re: Fix gtkD api display
On 04-08-17 17:24, Gerald wrote: On Friday, 4 August 2017 at 15:08:27 UTC, Mike Wey wrote: Improving the documentation is something i want to do but there are always some more important things to do. Like the Questions/Issues you posted earlier. So unless somebody volunteers it won't happen anytime soon. Mike I had contributed the makeddox.sh script awhile ago, it generates much nicer documentation then candydocs in my IHMO and includes a nice search box. If there is something lacking in it that needs to be improved before it can be used let me know and I'll do the work. The only issue with it that I am aware of is you need to manually copy the public ddox css into the generated folder. I didn't see an easy way to determine it's location automatically. One issue is the shear size of the generated documentation, though the current version of ddox no longer generates a ton of unused files bringing the size down from 15-20GB to a mere 2GB. So it has at leased become manageable to host it on the VPS that hosts gtkd.org. Now remains figuring out setting up the proper redirects on the server, and a few personal preferences about ddox: The need to go trough the empty module page when browsing the documentation. For a lot / most? functions the complete documentation is in the overview defeating the purpose of the one page per artifact. And im not a big fan of the one page per artifact style of documentation. -- Mike Wey
Re: GtkD custom theme on Windows
On 04-08-17 05:06, Andres Clari wrote: I've made a linux program with GtkD, and so far, it's been pretty awesome, however I'm thinking about porting it to Windows also, but the Adwaita theme is too fugly, and cringy, so I'd want to use a compatible theme, which is supposed to be doable. What would be the way to go to make a GtkD app use a custom GTK theme in Windows? I tried this in the past, but never succeeded following documentation found online. I didn't try it myself but it should be something like this: -Download a theme from gnome-look.org -Extract the theme to: C:\\Program Files\Gtk-Runtime\share\themes -Edit C:\\Program Files\Gtk-Runtime\etc\gtk-3.0\settings.ini and add: ``` gtk-theme-name = Name_of_Theme ``` -- Mike Wey
Re: gtkD load images
On 03-08-17 21:56, Johnson Jones wrote: If I do something like import gdkpixbuf.Pixbuf; Pixbuf.newFromResource("C:\\a.jpg"); There are two issues here, you need to properly escape the slash: "C:a.jpg". And a.jpg is not a resource file, so you would use the Pixbuf constuctor to load an image file. ``` Pixbuf p = new Pixbuf(r"C:\\a.jpg"); ``` -- Mike Wey
Re: Bug in gtkd?
On 03-08-17 23:11, Johnson Jones wrote: On Thursday, 3 August 2017 at 21:00:17 UTC, Mike Wey wrote: On 03-08-17 22:40, Johnson Jones wrote: Ok, so, I linked the gtk to the msys gtk that I installed before when trying to get glade to work and it worked! seems that msys is much more up to date than anything else as it just works(I need to remember than in the future). The problem I see is this: When I get ready to release my app to the public, I can't expect them to all have to install msys and build. msys seems to clump everything together and I don't know what files I need to extract to be able to bundle everything together. Any ideas how to solve that problem? At least now I can move ahead and actually make some progress on my app. Would still be nice to get the x86 vs x64 issue resolved so I don't have to keep switching between the two for testing purposes. Since Visual D was just patched to handle x64 BP's I guess I can stay with that for now. I'll try to build and test some new installers tomorrow that will include the loaders. Thanks. Could you take a look at the loading image thread I started when you get time? I can't seem to get an image to load even though it seems straight forward. These are the pixbufs I'm using mingw32/mingw-w64-i686-gdk-pixbuf2 2.36.6-2 [installed] An image loading library (mingw-w64) mingw64/mingw-w64-x86_64-gdk-pixbuf2 2.36.6-2 [installed] An image loading library (mingw-w64) in x64 it crashes completely without an exception though... which is why I want an easy way to switch between the two architectures... since x64 seems to be more unstable than x86 but sometimes it's the reverse, and ultimately I'll want to release in x64. Also, do I ever need to rebuild gdk when changing gtk installations? Does it ever grab anything from them at compile time or is it all at runtime? The new installers are available: https://gtkd.org/Downloads/runtime/ You don't need to rebuild GtkD when changing GTK installations, it does it all at runtime. -- Mike Wey
Re: Fix gtkD api display
On 04-08-17 03:51, Johnson Jones wrote: https://api.gtkd.org It is difficult to navigate. 1. clicking the documentation on the main site takes it to the gtk.AboutDialog api. That is all it shows, I was confused at first, as I'm sure most people would be. 2. The packages list lists all the packages, but all the sub elements are expanded, making it time consuming to hunt down anything specific. Initially collapsing them and adding a search box would be nice. 3. When clicking on any packages it reloads the page and shows only the package in the first tab. This requires one to then go back to packages and hunt for something else again. Because the position of the scroll is not saved, one has to scroll down through the entire list. It would be better, I think, if it was one single tab all in a single hierarchy that never reloaded the page so that it is easier to navigate quickly. e.g., instead of Package atk atk.ActionIF atk.Action ... we have atk atk.ActionIF GetActionStruct GetStruct ... atk.Action ... ... and so effectually combining both tabs. It should solve the issues that the current way has without really causing any problems. Everything should be collapsed by default and since no reloading of the page should occur(which might require having the api descriptions in a separate frame that is loaded separately on package changes to avoid reloading the tree view which will recollapse everything). It will make navigating the gtkD api much more fun ;) Improving the documentation is something i want to do but there are always some more important things to do. Like the Questions/Issues you posted earlier. So unless somebody volunteers it won't happen anytime soon. -- Mike Wey
Re: Bug in gtkd?
On 03-08-17 22:40, Johnson Jones wrote: Ok, so, I linked the gtk to the msys gtk that I installed before when trying to get glade to work and it worked! seems that msys is much more up to date than anything else as it just works(I need to remember than in the future). The problem I see is this: When I get ready to release my app to the public, I can't expect them to all have to install msys and build. msys seems to clump everything together and I don't know what files I need to extract to be able to bundle everything together. Any ideas how to solve that problem? At least now I can move ahead and actually make some progress on my app. Would still be nice to get the x86 vs x64 issue resolved so I don't have to keep switching between the two for testing purposes. Since Visual D was just patched to handle x64 BP's I guess I can stay with that for now. I'll try to build and test some new installers tomorrow that will include the loaders. -- Mike Wey
Re: Bug in gtkd?
On 03-08-17 05:00, Johnson Jones wrote: On Wednesday, 2 August 2017 at 14:51:45 UTC, Mike Wey wrote: On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to install anything GTK related on windows. ... Also, I cannot seem to load a jpg using an imageview (test.exe:1628): Gtk-[1;33mWARNING[0m **: Could not load image 'a.jpg': Couldn't recognize the image file format for file 'a.jpg' Just a normal jpg. Tried a bmp, same thing. It shows fine in glade itself. It looks like the pixbuf loaders are missing from the installer. -- Mike Wey
Re: gtk arch issues(fixed)
On 01-08-17 22:50, Johnson Jones wrote: So, the problem is simple(but unfortunately a lot of wasted time). gtkD needs to be updated to work well with x64 and x86. I think all one has to do is be able to specify which path of gtk to use rather than have it search the windows path. While I could manually rename the dirs or create a script that does so, that seems harsh. It would be nice if we could simply set a path in D that gtkD attempts to use as a base path to load the dlls. That way, we can completely avoid windows path if necessary and simply use d's version to set the correct path to the correct dlls. (or modified gtkD to work properly with both versions installed instead of crapping out on the first instance of the dll it comes across if it is not correct... I'd actually prefer both ways implemented though so gtkD works better on the end user's end but I have more control when developing). I currently have 3.22 32bit 3.22 64bit and 2.14 installed side by side without any issues. I guess i'll have to try this on a fresh install of Windows in case i forgot about some changes i may have made to the system. -- Mike Wey
Re: Bug in gtkd?
On 02-08-17 08:04, Johnson Jones wrote: Ok, Using msys I was able to get glade 3.20 running. Maybe that will fix everything. Great, unfortunately "Use msys2" seems to be the official way to install anything GTK related on windows. -- Mike Wey
Re: custom drawing with gktd?
On 02-08-17 08:35, Johnson Jones wrote: I have a need to draw custom objects with gtkD, is this possible? I see that with drawing area one can use cario, and it seems that gtkD supports this. I'd rather use openGL if possible. I see there is a gtkDGL but no reference to how to use it. I need pretty simple drawing stuff... lines, icons, maybe images(which, I guess, I'll have to use an external lib to load the images). Thanks. For openGL it would be better to use gtk.GLArea, which is included in gtk since 3.16. You can use the GLCore demo as an example: https://github.com/gtkd-developers/GtkD/blob/master/demos/gl/core/CoreGL.d GtkDGL wraps gtkglext3 which is currently not maintained, and no longer has any binaries available. -- Mike Wey
Re: gtk arch issues
On 01-08-17 22:16, Johnson Jones wrote: nvm, the file exists. Why it is not being found is unknown. I did some stuff and it says it is not a valid win32, this is using that gtk3 runtime I linked to... says it's x64 version but probably x86. Would be nice if the error message printed the full path of what was being loaded so it's quicker to diagnose. Seems there is a > ... code ... which is used, could I just hijack this to set the correct path based on what version it is compiled under? Would be the easiest thing, at least as a temporary workaround. You renamed the gtk DLL's, i assume you simply renamed them, but to get things working with different names you would need to build GTK from source, and apply the appropriate patches to GTK and its make files. If you would use a dependency walker on libgtk-3-0.dll you can see that it depends on basically all the other dll's in the directory, and by renaming them they can no longer be found. For libraries that are in both GTK 3 and GTK 2 it might find the libraries distributed with gtksharp but that would also fail because of the version difference. Printing the full path of the library in the error would only only be possible if we call LoadLibrary with the full path. It's been a while since i implemented the architecture check but if i remember correctly there were some issues with that. Otherwise it might be loaded from one of the other directories LoadLibrary searches, and then the printed path would be wrong, making things even worse. And yes you could hard code the path that is passed to SetDllDirectory as a work around, but the dll's will need to have there proper names. -- Mike Wey
Re: Bug in gtkd?
On 01-08-17 21:44, Johnson Jones wrote: On Tuesday, 1 August 2017 at 15:20:08 UTC, Mike Wey wrote: On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0. Which version of glade are you using? The latest: Glade 3.8.5 Could you check File -> Properties and see what is set as the runtime version? It should be at least 3.0 so it doesn't use things that were removed. -- Mike Wey
Re: NG technical issues: Is it just me?
On 21-04-17 19:03, Mike Wey wrote: On 04/21/2017 10:27 AM, Vladimir Panteleev wrote: On Thursday, 20 April 2017 at 23:37:25 UTC, Ali Çehreli wrote: *Looks* like a server/network issue but behaves like a screwy local issue. Started happening more in recent weeks. I don't select automatic checking for messages. I just click on a newsgroup and it fails at differing rates. (Pretty good in the last couple of days.) When it fails, for me the cure is to click on another D newsgroup to make a successful connection and then come back to the failed one; then it always succeeds. It would be helpful if someone could record a packet capture log (e.g. with Wireshark) of the problem. The information therein could be the first step towards diagnosing the problem. Ok, here is an Wireshark export of the error and a few successful packets beforehand. Hopefully this gives some insight in whats going on. https://drive.google.com/open?id=0B6DxRRR3v-n9QzhtZmNEbUQzWmM The errors seem to be getting more frequent lately. But i nog also get these errors on the GtkD newsgroup (vibenews) so it might be a Thunderbird issue. Is anybody getting the errors with a different client? -- Mike Wey
Re: Bug in gtkd?
On 01-08-17 05:53, Johnson Jones wrote: GtkD is currently based on GTK 3 the properties it complains about were removed in GTK 3.0. Which version of glade are you using? -- Mike Wey
Re: gtk arch issues
On 01-08-17 01:37, Johnson Jones wrote: So, the question is, is this a gtkd problem or a gtk problem? In either case, what's the way to get them both to work. Do you guys actually test out both versions installed on the same system? Gtk also loads some of it's own libraries at start up with GModule / LoadLibrary. So with the library names changed GTK might be loading the Gtk 2 libraries installed with gtksharp instead of the correct ones. -- Mike Wey
Re: gtk arch issues
On 31-07-17 19:53, Johnson Jones wrote: Also, why is gtkD even using gtksharp? That's for mono and .net! We don't. only the (C) Gtk runtime is needed. Where did you see gtksharp? -- Mike Wey
Re: gtk arch issues
On 31-07-17 19:16, Johnson Jones wrote: how does one allow both gtk x86 and x64 to work side by side seamlessly? I installed x64 first and it seems, because whatever is using the path to find the gtk runtime, it looks for that first even in x86 build. Seems like gtkd's dll resolution is not very intelligent. While I could manually modify the path each time I switch archs, that seems pointless. One of the problems in gtkd is that it has multiple places where it defines libgdk-3-0.dll. I've tried modifying gdkD so that it uses versioning properly by searching for libgdk-3-0.dll and changing all to use an x86 or x64 when appropriate but that doesn't seem to help. Probably have to rebuild gtkD. Anyways, doesn't seem to be a great solution ;/ Any ideas and maybe someone can add an issue to the github page to get this fixed? (I can't do it for a while because of other issues). At startup GtkD searches the Path for "libgtk-3-0.dll", when it finds one it checks the architecture of the library. If it's the correct architecture it calls `SetDllDirectory` so that the directory with the correct architecture will be searched first by `LoadLibrary`. If it's not the correct architecture it continues searching, if no library with the correct architecture is found, we rely on `LoadLibrary` to error out if the libraries are also not in the other locations searched by `LoadLibrary`. -- Mike Wey
Re: dmd can't build gtk x64
On 29-07-17 01:57, FoxyBrown wrote: On Friday, 28 July 2017 at 22:45:58 UTC, FoxyBrown wrote: Error: can't run 'C:\VS\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64', check PATH It is trying to run some x64.exe/com/bat file... why? What is this file? simply doing dmd -m64 build.d Works fine for x86. I was able to get this to work by copying all the required lib's to the lib dir from the windows sdk(liburct.lib, shell32.lib) and copying link.exe to x64. The program compiles, but when ran, I get the error object.Exception@generated\gtkd\gtkd\Loader.d(125): Library load failed (libgdk-3-0.dll): is not a valid Win32 application. which I assume is due to the fact that I have x86 gtk installed(I think, as I thought I installed the dual package... can't seem to find x64 gtk3+ standalone). Yes, that error is probably because you only have the 32bit version of the GTK runtime installed. On gtkd.org installers for both 32bit and 64bit are available, they can be installed side by side without any issues. -- Mike Wey
Re: GtkD on android?
On 25-07-17 20:06, Joakim wrote: On Saturday, 22 July 2017 at 18:59:44 UTC, FoxyBrown wrote: With LDC's new ability to do android/arm, we are missing the ability to do GUI's? Can any of the current D solutions work such as GtkD or QtD? I'm looking for something somewhat lightweight, easy to use(I find GtkD a bit funky but it does seem to work and is relatively easy once one gets through the basics). I think having a GUI builder is crucial though as it makes it so much easier in the long run. Glade is a bit funky but functional and works. Ideally I'd like to be able to make portable apps that just work across the board(mac, linux, windows, android) without much hassle. Mike said maybe later, when I asked him in January: http://forum.dlang.org/post/o4rq0i$dur$1...@digitalmars.com In the meantime, you can try DlangUI, as Seb pointed out, but I get the impression it's not touch-optimized, just like Gtk. And if you want something lightweight, the complete GTK stack is probably not what you are looking for. -- Mike Wey
Re: [your code here] Pure RPN calculator
On 26-07-17 16:40, Iakh wrote: On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote: readln.split.fold!((stack,op){ switch(op){ static foreach(c;"+-*/") case [c]: return stack[0..$-2]~mixin("stack[$-2] "~c~" stack[$-1]"); default: return stack~op.to!real; } })((real[]).init).writeln; What does "case [c]:" mean? In the static foreach c is a `immutable char` by putting it between [ and ] you create an array of immutable characters (string). -- Mike Wey
Re: Go Your Own Way (Part One: The Stack)
On 07-07-17 22:10, Walter Bright wrote: On 7/7/2017 12:38 PM, Steven Schveighoffer wrote: Which would mean that the lack of alloca prototype on Windows is a straight up bug (the fact that you can just add the declaration and it works is pretty good proof). It's in core.stdc.stdlib Only for version DigitalMars and GNU. -- Mike Wey
Re: Let's paint those bikesheds^Werror messages!
On 28-06-17 01:34, Moritz Maxeiner wrote: All these can even do true colors on Windows: - https://blogs.msdn.microsoft.com/commandline/2016/09/22/24-bit-color-in-the-windows-console/ On Windows 10, and in that case you can even use the vt100 escape sequences: https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx -- Mike Wey
Re: Phobos PR in need of review/merge
On 27-06-17 08:49, Walter Bright wrote: You can also specifically request a review from one of Team Phobos: https://github.com/orgs/dlang/teams/team-phobos/members Just click on the [Reviwers] link. Is that page private? I get an 404 error, and i can't find the page on github. -- Mike Wey