Re: win32 (via Wine): 'image-missing' not present in theme Adwaita
Hi Emmanuele, Thanks for your feedback. > You need to generate the icon cache on the > target machine. Assuming "target machine" in this context is the target operating system, how do I generate icon cache on Windows (Wine on Linux, in my case)? >> Note that I don't want to move the executable (poplaun.exe) >> into a bin/ directory. I want to keep it in the , in >> the top level. > > Why? Are you trying to complicate your life? In my experience, it's fairly standard for Windows packages to have their executables in the root (top level) directory. Putting mine in a bin\ directory and then having to instruct users to enter that directory to start the program would slightly decrease the user-friendliness of the program. > [...], or you identify the ones you use and only ship > those in your installer. It's good to read that this is possible. If I can figure out all the required files (including - apparently - an icon cache) and where to put them, this is indeed what I will do. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: win32 (via Wine): 'image-missing' not present in theme Adwaita
Hi all, Recently, I wrote: = > I'm running my ported GTK+ application via Wine, and it keeps > throwing: > - > Gtk-WARNING **: Error loading theme icon 'image-missing' for stock: > Icon 'image-missing' not present in theme Adwaita > - > > How can I get rid of this? > > I've already tried adding > usr/share/icons/Adwaita/.../status/image-missing.png > and > usr/share/icons/gnome/.../status/image-missing.png > to the program's directory, but that doesn't fix it. = I've since gotten an insightful reply from Tilo, and someone also e-mailed me off-list with some pointers. I would still like to find a way to get rid of these Adwaita-related warnings. Here are download links of the GPL3+ program in question: http://www.popot.org/other_useful_tools.php?tool=poplaun The page has both the Windows and GNU/Linux packages. It is a simple application that retrieves and launches Prince of Persia mods. I have tried copying my GNU/Linux's /usr/share/icons/Adwaita/* content to the Windows port's /share/icons/Adwaita/ But then I get: wine: Unhandled page fault on read access to 0x9666 at address 0x7e99f29c (thread 0009), starting debugger... Note that I don't want to move the executable (poplaun.exe) into a bin/ directory. I want to keep it in the , in the top level. Also, even if copying all Adwaita icons somewhere would have worked, surely there must be a solution that doesn't require including 42MB into the package, and still have it work out of the box - with the (application-exit and help-about) icons... Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: win32 (via Wine): 'image-missing' not present in theme Adwaita
> Also the all the *-from-stock (e.g. gtk_button_new_from_stock) > functions have been deprecated in GTK 3.10 so maybe that’s the issue? Ah, that must be it, yes. I use gtk_image_new_from_icon_name() for menu icons, and now that you mention it these indeed do not show up. So, that must be where it tries to use the 'image-missing' icon. Thanks, I guess I'll just have to accept that menu items really can no longer have icons. Thanks for the reply. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gtk-WARNING **: Could not find signal handler
> pi@raspberrypi:~ $ sudo apt-get install gmodule-export-2.0 As Tilo wrote, you may need to compile it yourself. A quick search seems to indicate that there is gmodule-no-export-2.0 (no export) and gmodule-2.0 (export). If this is true, you may want to look for gmodule-2.0 instead. norbert # apt-file search libgmodule libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.0 libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.1 libglib2.0-dev: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a libglib2.0-dev: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so Seems to tell me that these are the packages you'd be looking for. Just a hunch, someone else may know more about it all. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
win32 (via Wine): 'image-missing' not present in theme Adwaita
Hi, I'm running my ported GTK+ application via Wine, and it keeps throwing: - Gtk-WARNING **: Error loading theme icon 'image-missing' for stock: Icon 'image-missing' not present in theme Adwaita - How can I get rid of this? I've already tried adding usr/share/icons/Adwaita/.../status/image-missing.png and usr/share/icons/gnome/.../status/image-missing.png to the program's directory, but that doesn't fix it. = Another, unrelated, question. Question for those of you porting to Windows: I'm using ShellExecute() where I use fork()/execl() on GNU/Linux, and ShellExecute() keeps throwing me ERROR_BAD_FORMAT. According to https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx this means "The .exe file is invalid (non-Win32 .exe or error in .exe image)." But I've double-checked and and it's definitely a 32-bit executable: - PE32 executable (GUI) Intel 80386, for MS Windows, UPX compressed - I've tried 3 different Wine versions (staging, devel and repo), and tried fixing it with WINEARCH=win32. Nothing fixes it. you. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Programatically activate menu like a mouse click
> How can I trigger the menu activation (like a mouse click does) ? I would guess with: https://developer.gnome.org/gtk3/stable/GtkMenu.html#gtk-menu-popup-at-widget It's available for GTK+ 3.22 and up, so I cannot test it to verify. This should tell you your GTK+ version: $ pkg-config --modversion gtk+-3.0 Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Weather API
> gnome-weather [...] I can i use this libraries with C? I think, in theory, the GWeather Reference Manual... https://developer.gnome.org/libgweather/stable/ ...should have information about its C functions in the Functions sections. But they are empty, e.g.: https://developer.gnome.org/libgweather/stable/GWeatherLocationEntry.html Maybe someone needs to run GTK-Doc to create the manual? Installing libgweather-3-dev does not give me a man page for, for instance, gweather_info_get_wind() either. This seems to have some docs though: https://lazka.github.io/pgi-docs/GWeather-3.0/index.html Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: textview widget selection buffer_select_range is cleared when dialog closes (intermittently?)
> > I have a textview widget being used in an editor where an > > incremental search is performed. [...] I can't help you, but after seeing some of your functions I'm wondering... Setting the search direction (backwards, forwards), setting/toggling case sensitivity (yes, no), and moving the selection to whatever matches next; these are functionalities programmers want to provide users, and that GTK+ could probably deliver with readily available functions. This reminds me of what I wrote in the last paragraph: https://mail.gnome.org/archives/gtk-app-devel-list/2017-February/msg00014.html To get case insensitivity search for a tree view in single selection mode I recently had to create a custom gtk_tree_view_set_search_equal_func(). I used g_strrstr() on the g_utf8_strdown()'ed key and gtk_tree_model_get()-obtained iter. I then noticed that pressing Enter did not move to the next match. That was very recent, your "Hope this can help someone else." mail arrived just after that. :) Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: want to capture a mouse click in an Entry
> I have an gtk_entry [...] and i would like to capture clicks > in the entry [...] depending on what modifier keys are held You can use g_signal_connect (..., "button_press_event", G_CALLBACK (Function), NULL); Then in Function, check if (event->button.state == GDK_SHIFT_MASK) {} else {}. Also do gtk_widget_grab_focus (widget); in Function. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Removing entries from EntryCompletion
> Is seems to me that the easiest way for the user to > indicate to the GUI that a particular suggestion > should be removed would be via the delete button > whilst that suggestion is highlighted. As soon as you click anywhere outside the area with suggestions (matching entries), the overview of suggestions disappears. This means that users can never hover over a suggestion to highlight it and then press a delete button. Unless I'm misunderstanding what you have in mind. Anyway, why not add a button to open a completely new window that allows users to remove suggestions from a tree view. This should also allow them to remove multiple entries at once. Another, lazier solution, could be to add a delete button that will delete the suggestion matching what's currently in the entry. Something else that may or may not be possible, is add a g_signal_connect (entry, "key_press_event", G_CALLBACK (Delete), NULL); and then check in Delete() if (strcmp (gdk_keyval_name (event->key.keyval), "Delete") == 0) and if that's the case, somehow obtain the active suggestion. The problem here is that a GtkEntryCompletion only contains only private data. At least, I think. I tried using selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view_proposals)); to get a selection, but this doesn't seem to work. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: issue with drawing graph in GTK
> I am using below code for drawing two graphs from same data. > [...] > please let me know if more information is required. If the problem persists and you've been unable to find help, I suggest you create and share with us a short, self contained example program that demonstrates the graph problem. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkPrintOperation; request for assistance
> For a simple printing example in C this is my try at it. > > https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/print_buffer1.c Much appreciated Eric. A question about this code. When I use, for example, the gedit text editor, its File->Print... dialog includes a "Page Setup" tab where I can use a "Paper size" drop-down to modify the paper size. With your example, but also with the current GTK+ code for Ggradebook, the "Paper size" drop-down is grayed out (disabled), /even/ after selecting a valid printer. The workaround I'm using with Ggradebook is to first run gtk_print_run_page_setup_dialog(), then pass the resulting GtkPageSetup values that the user supplied to the final dialog. Is there a way to fix this. In my opinion, your example application is close to being usable as a generalized example. But it still needs to allow the user to specify a paper format, and then extract margins - perhaps with a forced minimum - and perform subsequent calculations based on those. I'd like to end with a more general note about GTK+ and printing. This is not about my work or your example, but something for the library developers. I'm a fan of GTK+ and have always been a fan. The printing functionalities are extremely versatile. But it's difficult for me to understand why there is no function that requires only a buffer (of any size), font type and font size as parameters, then presents the user with a print dialog. As a programmer, I don't want to think about margins, pages, cairo, pango, and so on. I also feel sorry for all other programmers who suddenly need to write begin_print() and draw_page() functions just to print a buffer. I feel like there's room for improvement here. :) Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Identifying monitors
> I save preferences per monitor I think giving us more context might be useful. What kind of things do you save per monitor, and why? These are not things you could recreate by scaling and positioning based on detected monitor dimensions? If we're assuming monitors can be arbitrarily plugged in and out, and detection is unreliable or users may even have unidentifiable monitors, no function will ever help you. If this is not a cross-platform application and you _really_ need to recognize monitors, your program could make a system call to "xrandr --prop" and compare EDID strings. If you save a collection of settings per monitor, maybe your application should a) by default, assume the setup is unchanged, and b) allow users to specify which collection of settings should be attached to which monitor (location) if they decide to modify their setup. If you have a broad range of users, all GTK+ 3.22 and newer functions, including both gdk_monitor_get_model() and gdk_display_get_monitor(), may be problematic. My reasoning is that Ubuntu Xenial (and thus Mint Sarah, Mint Serena, and various others) provides 3.18.9 to users: http://packages.ubuntu.com/search?keywords=libgtk-3-dev=names=xenial=all All these users would need to manually compile GTK+ 3.22 or newer, including all the dependencies it needs. If we know what is the application's intended behavior that is causing you explore saving settings per monitor, we may be able to offer alternative solutions. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: What does "Pango-CRITICAL **: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed" mean?
> It did not solve the Problem, [...] Before I e-mailed my response I locally created a program that included the function your posted. Double clicking the bottom field threw the error you mentioned. After modifying the code as I described in my previous post, the warning on the console disappeared. No warnings remained; I solved your problem. If I did not solve your problem and you're under the impression that I gave you a "wrong answer", then either your question wasn't clear enough or you did not include the code that actually caused the issue you ran into. I suggest that, next time you ask for help, you include a complete working example program that reproduces the problematic behavior. This prevents other people from having to do this work and getting back to you with a solution that is valid but still insufficient. > Thanks. Sure. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkPrintOperation; request for assistance
Hi Emmanuele, Thank you for your reply. > [...], instead of generating a massive string and then > sending it to lpr, [...] I'm slightly confused, is that a description of what my code is currently doing? If it is: I was unaware that the code is generating a massive string. My intention and understanding was that it sets margins and a font, then sets the starting location to the top-left with cairo_move_to(), and then starts making multiple PrintIt() calls. Each PrintIt() call - sets and shows text with pango_layout_set_text() and pango_cairo_show_layout(), and subsequently - prepares for the arrival of additional text by updating the output location to the next line with cairo_rel_move_to(). I was hoping a cairo_rel_move_to() call to a location below the bottom margin would automatically trigger the library to increment the page number. A more general remark. It's unfortunate that the GtkPrintOperation documentation lacks (a link to) source code of a, as small as possible but still complete, stand-alone example program that allows the user to select a file of any size, and then pick a printer, paper size and orientation, including preview option, and print. Such an example would be user-friendly. Users, in this context, being programmers who work with GTK+ and would like to use GtkPrintOperation. I lack the energy to study GNOME Dictionary's gdict-print.c file in hopes of solving the bug. I thought that my current code related to printing is close to being correct. If I can't use PrintIt() as I'm currently doing, I don't see myself rewriting what's necessary to make it work. How can I be so far away from a solution that I would need to study the code of another program? I've already invested many hours into creating its current printing functionality. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: What does "Pango-CRITICAL **: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed" mean?
> keybuf = gtk_entry_buffer_new ("Not yet generated", 45); https://developer.gnome.org/gtk3/stable/GtkEntryBuffer.html#gtk-entry-buffer-new The second parameter of gtk_entry_buffer_new() specifies the number of characters in the string. Either change 45 to 17 or to -1. Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GtkPrintOperation; request for assistance
Hi all, Yesterday, I finished the migration of a 16+ year old GTK+ 1.2 application to GTK+ 3.18. The application is Ggradebook, the official GNU gradebook. -- Websites: http://www.norbertdejonge.nl/Ggradebook/ https://www.gnu.org/software/ggradebook/ Changelog: http://www.norbertdejonge.nl/Ggradebook/ChangeLog.txt Latest release, source code: http://www.norbertdejonge.nl/software/Ggradebook-0.92.tar.gz -- The migration process was easy. Several people of Freenode's #gtk+ were helpful. (Thanks!) There's one known bug that was introduced during the migration. A bug that I do not know how to fix. In previous releases of the application, printing was done by writing directly to "lpr". I want code to be C99 compatible, so I replaced the popen() functions with GtkPrintOperation. Currently, printing works properly, but both the preview and output end after page 1. This is, of course, not the intended behavior. A quick glance at the print.c source file shows the problem. The relevant code is under "/*** print operation ***/" and in the PrintPage function. The solution... I don't know. I would be grateful if someone is willing to took into this and help me out. If substantial changes are required, I will gladly update future releases to include an additional contributor entry in the package's docs/AUTHORS.txt file. I've been staring at, and experimenting with, the related code for hours, and eventually decided to release with this known bug, because I simply don't know how to fix the problem. Hope to hear from you. :) Best regards, Norbert ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list