Re: How to make a GtkButton respond to a key press
On 03/06/2015 08:52 AM, Michael Torrie wrote: No, this is not quite what I am asking for. Capturing keyboard events is fine, but I need the button to click visually, for feedback purposes. Just like what happens if you define the control key shortcut and press that. So the question is either, how can I get GtkButton to respond to a non-modifier hotkey, or how can I programmatically get GtkButton to visually depress and release? You can call g_signal_emit_by_name() for the GtkButton activate signal to get the visual animation of a button press and release. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Understanding accelerators.
On 10/07/2014 04:45 AM, Oscar Lazzarino wrote: I'm trying to understand the difference between accelerators and the “key-press-event” signal. Let's say I have a window with just one button quit. I'd like to handle the controloq key event to quit the application. I now I can connect to the top window key-press-event, but - just to understand how things work - is there any way to do the same with accelerators? Or are accelerators exclusively intended to be used with menus? I'm totally lost in the documentation bouncing between actions, accelerators, accerator groups, action groups, ui managers, etc, and I can't find a SIMPLE example. Any help would be greatly appreciated. There are menu accelerators and there are mnemonic accelerators. What you need to use for a quit button is a mnemonic accelerator. You do not attach to any key-press signal. Attach to the button clicked signal. GTK provides the functionality to capture the keyboard press and route it to the button click. You're complicating this a little. It's not that complicated. :) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Understanding accelerators.
On 10/07/2014 09:18 AM, Gergely Polonkai wrote: Mnemonics are discouraged by the HIG, and AFAIK they are not displayed by recent GTK versions. From the user's perspective, I think there is no difference. However, if you are using GApplication/GtkApplication, it is easier to register accels, and you can even make them easily customizable for the users. I'm yet to find a good example on the Interwebs, but if you take a look at GNOME 3.14 apps, you will find some for sure. It's quite humorous that no one responds to most queries on this list, but as soon as I do there are a handful of replies to point out how I'm wrong. Mnemonics are not displayed by default, yes, as that's a stylistic preference of the theme you use and not a GTK default. Discouraged? This is news to me. I just ran through a handful of GNOME apps and they all use mnemonics. In fact... the GNOME HIG page *encourages* to make shortcut keys as mnemonic as possible[1]. Menu and mnemonic accelerators do have differences. The former can be assigned to any key combination. The later only apply to the ALT key. [1] https://developer.gnome.org/hig/stable/keyboard-input.html.en ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Custom Titlebar
On 08/09/2014 04:25 PM, Mahan Marwat wrote: How can I add a custom titlebar to my GUI application? Are you asking for custom text or a complete replacement with widgets of your own? If the former then it's a simple call. I'll use the C function: gtk_window_set_title( GTK_WINDOW( window ), Hello this is new title bar text ); If the later, GTK does not support that. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Custom Titlebar
On 08/11/2014 04:40 PM, David Nečas wrote: Unless you are running someting like Gnome 3(?), this will add a strangely looking thing to the top of your window, but inside. It will not change the title bar which is controlled by the window manager. I've never seen it actually do what is advertised. Admittely, I didn't test it much because I consider it broken by intent (not even getting to broken by design). That's why I did not recommend this to the OP. Is that call even supported on win32? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_spawn*() on windows
On 07/03/2014 08:33 AM, jcup...@gmail.com wrote: Yes, I'm doing that. It all works and I can capture stdout and stderr from the convert.exe I'm running, it's just that I get a very annoying command window flash on the screen each time. If anyone has any ideas about the command window, I'm all ears:-( I don't have ImageMagick binaries to check myself, but are they compiled as Windows apps or console apps? Console apps will always force a command prompt window to open. This is not a by-product of a g_spawn call. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Can't link to Pango
Bric wrote: Here is my config.log : http://www.flight.us/misc/gtk_config.log.txt Your log shows your system libraries are mismatched in some way. /usr/local/lib/libpangocairo-1.0.so: undefined reference to `pango_fc_font_create_base_metrics_for_context' ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkTreeView isn't updating when GtkListStore appended and set
On 01/04/2014 05:21 PM, Jordan H. wrote: In Glade I've defined column 0 in the list store as a gchararray cell. I even tried forcing the assignment of GtkListStore to GtkTreeView (knowing full well I wouldn't need to) to no avail. I don't get any errors, but the GtkTreeView doesn't reflect the changes made to the GtkListStore. Any suggestions? Thanks in advance! I haven't used Glade/GtkBuilder, but I'm not sure if it automatically assigns the ListStore column to the TreeView like you are thinking. You can make sure by calling a few functions. gtk_tree_view_set_model( tree_view, GTK_TREE_MODEL( list_store ) ); gtk_tree_view_column_add_attribute( column, cell, text, 0 ); // 0 being the column you want to assign to the column in the GtkTreeView ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: changing font, color, size, etc. in a GtkEntry
Eric Wajnberg wrote: However, as I've mentioned in my original post, functions like pango_font_description_from_string, etc. are not recognized in my coding environment (while I can define pointer to things like PangoFontDescription without problem). This looks weird to me. Is there some specific libraries or headers I have to load or declare before? Or are these fonctions available on GTK 3 only, and - if yes - what can I do, then? (I am coding on Windows with CodeBlocks 12.11 and GTK 2.24.0). Pango is not tied to a GTK version. You can use GTK 2 for this. What do you mean not recognized? The compiler reports an undefined function? The linker reports an undefined function? The function has been around for a very long time (at least since Pango 1.10) so this is not something new. It appears your development environment is missing headers and/or libraries. Something to consider: I cross-compile Windows binaries under Fedora using MinGW packages. You may find this a better alternative as packages will be up-to-date (GTK 2.24.22), packaged properly, and find some support from the packagers and upstream in case something like this goes wrong. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: changing font, color, size, etc. in a GtkEntry
Eric Wajnberg wrote: I simply want to modify the font, color, size, etc. of the characters entered while they are typed in a GtkEntry. I am coding with GTK 2.24.0. Looking around on the web, I found several possible functions to do that, some of them seem to be specific to GTK3, however. I found - and tried to play with - things like: gtk_entry_set_attributes gtk_widget_modify_text gtk_widget_modify_base gtk_widget_modify_font gtk_widget_create_pango_layout gtk_widget_create_pango_context Some of them lead me to define and to argument a pointer to a struct of type PangoFontDescription or GtkStyle. Hence, it seems that I also need to use function like, e.g., pango_font_description_set_weight, etc., but I'm not fully sure about this. You are close. You need to use gtk_widget_modify_font(). You pass in a font description created by: PangoFontDescription *fontDesc = pango_font_description_from_string( monospace 10 ); This would set the entry text to a monospace-type font with 10 point size. Don't forget to call pango_font_description_free() afterwards. If you wish to change font while typing you need to connect to the key-press-event signal on the GtkEntry widget and handle key presses that way. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkEntry ... change size
Mariano Gaudix wrote: I can not change the size to GtkEntry . I am using Gtk 3.6 . I need a GtkEntry small , for my graphic interface . GTK expands widgets to fill space by default so setting widget size has no visible effect. You need to disable expansion. I'll add a general disclaimer that you should not hard-code widget size unless you absolutely must. Allowing widgets to expand helps your app work on different screen sizes and shapes. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Signal of a button dynamically created
Borja Mon Serrano wrote: The point here is: how can I know what button was pressed in order to remove a row? You need to attach to the clicked signal on each button[1]. Each button could call a separate function or you can pass a pointer to different values to know which button is which. [1] https://developer.gnome.org/gtkmm-tutorial/unstable/sec-connecting-signal-handlers.html.en ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkEntry ... change size
Mariano Gaudix wrote: ¿ how I disable expansion ? I used the sentences . gtk_widget_set_vexpand (GTK_WIDGET(entry ) , FALSE ) ; gtk_widget_set_hexpand (GTK_WIDGET(entry ) , FALSE ) ; But these sentencesdon't run . I know those are the new GTK3 functions, but I still mainly use GTK2. Try: gtk_container_add( GTK_CONTAINER( hBox ), entry ); gtk_box_set_child_packing( GTK_BOX( hBox ), entry, FALSE, TRUE, 0, GTK_PACK_START ); gtk_widget_show( entry ); ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkEntry ... change size
On 10/28/2013 08:55 PM, Mariano Gaudix wrote: The GtkEntry continuous big . gtk_box_set_child_packing( GTK_BOX( box ), entry,FALSE, TRUE, 0, GTK_PACK_START ); the sentence don't work . You need a widget adjacent to your entry to take up the space you don't want filled by your entry... (say a blank label widget) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkCellRenderer for GtkButton or GtkSwitch
On 05/03/2013 11:30 AM, D.H. Bahr wrote: Is it possible to display a GtkButton or a GtkSwitch within a TreeView row (that is a GtkCellRenderer of some kind)? Yes, but unfortunately there isn't a convenience function for it. You will have to create a custom renderer. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkCellRenderer for GtkButton or GtkSwitch
On 05/03/2013 02:29 PM, D.H. Bahr wrote: Ok, does anyone have some working code with similar effects? I've never coded my own widgets before, so I'm not sure how to do so. You can take a look at this page[1], but I cannot vouch for its relevecy with current GTK2 or GTK3. Your question was asked[2] a few years ago, which turned up in my Google search. [1] http://scentric.net/tutorial/sec-custom-cell-renderers.html [2] https://mail.gnome.org/archives/gtk-app-devel-list/2008-September/msg00109.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Release of next binary GTK+2 package for Windows?
On 03/12/2013 08:24 AM, Serrano Pereira wrote: We are currently using GTK+ 2.24.10 on Windows 7 (the binary package from gtk.org) which is affected by bug 685959 Memory leak on every redraw of a widget which causes our application to crash with an out of memory error. Has the fix been released yet? If so, to which GTK+ version? The latest binary package for Windows is currently version 2.24.10. When will the binary package with the fix be released? According to the ChangeLog that bug was fixed in 2.24.14. http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.14.news If the new binary package won't be released anytime soon, is there another way for me to get the fix? Yes, there are a few distros that provide MinGW packages. Fedora has 2.24.16 you can grab. You will also need to grab all dependencies. There's about a dozen of them. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: switch printer tray during printing
On 03/11/2013 03:46 PM, Adam Tauno Williams wrote: I'm not sure this is even possible. Tray select, duplex, etc... are often encoded in either the PCL preamble of a print job or in a PJL envelope [common for Postscript]. They really are attributes of the *job*. I'd guess that Gtk/GNOME would have to 'emulate' this behavior by splitting the ob silently into multiple jobs. That could get wierd. At the time I wrote my message I was under the impression I was sending one stream of PCL to the printer and switching trays, but in fact I am sending two separate streams. (with my non-GTK software) Changing trays may be out of the question, but I do know that Postscript allows per-page paper orientation changes. I have a few PDFs that do so. The software that is demanding this is in the pharmaceutical industry where they need all sorts of odd shaped data to print in different ways to different paper sizes and trays in one go. I have it working for me now without too much pain, but if I ever have an epiphany I'll be sure to share it. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: switch printer tray during printing
Michael Cronenworth wrote: Does anyone know if GTK allows switching print trays in the middle of a GtkPrintOperation? I tried setting the source to Tray 2 in the request-page-setup signal for the second page, but this did not work. The second page printed to Tray 1 (default). Old message, but I still wanted to reply for the Google archives. I cannot get GTK to change tray during a print job. I had to break the print job into two jobs and manually call gtk_print_settings_set_default_source() inbetween jobs. Ideally GTK should be able to change tray *and* paper orientation/size during a print job. There doesn't seem to be an RFE for this, but I think it would be a good feature. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to prevent windows to be raised at the top of the stack when clicked?
Olivier Guillion - Myriad wrote: Is there a way to prevent a clicked window from being automatically sent to top of the stack ? Any help would be greatly appreciated. You can use gtk_window_set_transient_for() to force stack ordering. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Get the summary from a key in GSettings
rastersoft wrote: I'm creating an extension for Gnome shell and want to simplify some parts of the configuration. To do so, I need to get the summary text from GSettings, given its key. I've been checking the C API but I can't find a suitable method. Is there a way of doing it without parsing the XML? I took a quick look and there doesn't seem to be a method to get the summary text. The normal way to use preferences in a Gnome Shell extension is to use GIO Settings, but it only touches the actual values and doesn't provide a way to read the summary. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Change background color in GtkTreeView
Tomasz Jankowski wrote: I'm working on UI for embedded system using GTK+ 2.24. I want to change GtkTreeView background (area behind rows, which is by default white) to match default color of window area (grey by default). I retrieved GtkStyle associated with GtkWindow and looked for this particular tint of gray color in GdkColor arrays in GtkStyle instance (gb, fg, base arrays). Then I assigned these colors to GtkTreeView using gtk_wdget_modify_base(), but I was unable to find the same color. Any idea? The first array value of bg contained the background color of my window. Worst case: If you can get a screenshot of the window you can take a image app, such as Gimp, and use the color picker tool. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
switch printer tray during printing
Does anyone know if GTK allows switching print trays in the middle of a GtkPrintOperation? I tried setting the source to Tray 2 in the request-page-setup signal for the second page, but this did not work. The second page printed to Tray 1 (default). Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Clarification on recent deprecations
David Buchan wrote: Do I need to change the link to gmodule-2.0? To be honest, I really don't understand what it's for. Is there a good explanation somewhere? You can always find your pc files in: /usr/lib{64}/pkgconfig Example: /usr/lib64/pkgconfig/gmodule-2.0.pc Inside the file will contain the flags that are passed to the compiler. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkHBox child replacement
Piotr Sipika wrote: While updating the text inside the label is easy (via gtk_label_set_text()), what's the best way to update the icon child, assuming it's a GtkImage and I have an updated GdkPixbuf for a new icon? You want to call gtk_image_set_from_pixbuf(). Don't forget to call g_object_unref() on the new GdkPixbuf after each update. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK window positioning
David Buchan wrote: gtk_window_set_position (GTK_WINDOW (window1), GTK_WIN_POS_NONE); [snip] I find that the two windows are always placed right on top of each other. I can drag the top one off the one underneath, but I'd like the window manager to choose placements that are separate. Suggestions? Have I bungled something? Have you tried not calling gtk_window_set_position()? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk apps on iOS/Android?
Ardhan Madras on 09/10/2012 11:08 AM wrote: Actually, there is a Java based X11 Server running on Android and was available in Play Store (Android Market). Yes, I am fully aware of this app. However, it is not a usable solution. It was written from the ground up so who knows what part of the X11 spec is missing from it or how stable it is. It's best to write native iOS or Android apps. Please don't waste your time trying to port Qt or GTK+. There was a perfectly good mobile Linux distribution, but unfortunately it was killed off when Microsoft bought the company. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk apps on iOS/Android?
Tomaz Canabrava on 09/10/2012 11:27 AM wrote: Well, actually there's an working Qt version for Android, called Necessitas. so, there's no need to 'waste your time porting', it's already ported. Wow! Everyone is an expert! @kde.org! Sweet! /sarcasm Anyone else want to tell me something I already know? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [RFC] Why GtkMenuItem hide_on_activate property is not taken into account?
Tomasz Bursztyka wrote: [snip] So my question is: how to get this behavior for my GtkSwitchMenuItem, properly done with existing GtkMenuShell/GtkMenuItem functions/signals? What signals should I catch or which function should I override? You're better off proposing this patch in a bug report on https://bugzilla.gnome.org ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: widget_destroy() question
On 08/16/2012 09:03 PM, Vlasov Vitaly wrote: For example, i got frame in which packed vbox. In vbox packed in five buttons. If i call gtk_widget_destroy(), all packed widget's will be destroyed? or only frame? Calling widget_destroy will automatically destroy child widgets. If you want all widgets destroyed at one time you should destroy the vbox. If you want only one button destroyed you should call destroy on only that one button. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Passing data to a callback (again)
Frank Cox wrote: What have I missed? Not all callbacks perform the same function. That is why you must consult the documentation for the signal you want to catch. The g_signal_connect() function does indeed only pass one pointer for the fourth argument data. All signals have a data argument to receive the one pointer. In the case of the insert-data signal it has a specific callback that provides additional data. Other callbacks will have different function arguments that will provide different data. In the end, the data pointer is the only pointer you can pass from outside any callback. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Open file from menu
Rudra Banerjee wrote: 1) putting the above block inside if (argv[1] != NULL) is giving a segmentation fault: Are you checking argc? If you are not passing an argument argv[1] does not exist so, yes, you will get a segfault for running beyond the argv[] array. if ( argc 1 argv[1] != NULL ) foo else return 0; and 2) How I can open the file using file menu, instead of commandline argument? I have defined the menu as follows: [snip] which is opening the file selector, but *NOT* writing it in the textview. I wish to open the file in textview and save it aswell after I edit that. Are you checking for a filename returned from the file chooser dialog? You are going to need more code to do what you want. GTK won't do it automatically for you. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkPrintOperation uses wrong scale on Windows ?
Geert Janssens wrote: I rewrote my code to no longer use cairo_identity_matrix (altering some of our own transformations to cope with this), and now the pages print fine on Windows as well. Good deal. I'm glad you figured it out. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkPrintOperation uses wrong scale on Windows ?
Geert Janssens wrote: Am I doing something wrong here ? Was GNUCash setting units before? If so, what to? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkPrintOperation uses wrong scale on Windows ?
Allin Cottrell wrote: Sorry, I don't have a solution, but I can confirm the problem. It has been there for a long time (since GTK 2.16 or earlier). When I first came across the issue I tried messing with the GTK_UNIT_* arguments till I was blue in the face, to no avail. I also tried inserting debugging statements much like yours, but couldn't work exactly where the problem lay. Eventually I just gave up on using GtkPrintOperation on Windows. I hope you have better luck! We may not be using GtkPrintOperation the same way, but I do not have a problem with Windows printing. I'm using GTK_UNITS_MM and images or text print in the same location with the same resolution on Linux and Windows. GTK 2.24.10 and Cairo 1.11.2. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
list of printers
I need to be able to set a printer as a default for the GTK app - not the system default printer - so the user can have things print without having to see the print dialog every time. One way I thought about doing this is to call gtk_print_operation_run() and let the user select the printer to use as the app default and call a draw-page function that does nothing. The resulting printer's GtkPrintSettings data would be saved to a file and henceforth the app would read that file for knowing what printer to print to. Is there an easier way to do this that I have missed? Ideally I'd like to grab a GList of printer names and display them in a ComboBox for user-selection, but I cannot find any GTK functions to do this. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Porting Between Linux and Windows
On 06/15/2012 07:33 PM, Eric Tavenner wrote: [snip] Other people have answered the rest of your e-mail pretty well. I'd recommend C over C++ as well, as explained in the other e-mails. There are Hello World C source files in GTK documentation. Be sure to look them over. http://developer.gnome.org/gtk-tutorial/2.24/c39.html I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64 bit machine. Currently Fedora has GTK 2.24.10 and Windows has 2.22.1. Is this going to cause problems with compiling? Fedora allows you to cross-compile with MinGW and I use Fedora myself to build 32-bit and 64-bit, Linux and Windows executables. I'd highly recommend you compile on one platform. It makes life much easier and you can use GDB on Windows for any debugging needs. Fedora carries GTK 2.24 for both Linux and Windows and I'd recommend sticking to this version as the Windows build of GTK 2.24 is very stable. Previous GTK versions were very unstable. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Slow combo box when adding 500 rows
Osmo Antero wrote: Adding rows to a combo box with a GtkListStore is immensely slow. Is it right that adding 500 rows can take upto 10 seconds and the GUI freezes? I have similar hardware but with the NVIDIA driver so it only freezes for about 2 seconds on my system. [snip] What is your opinion? Should I use a thread to add data after the GUI has been displayed? It looks like a GTK3 performance issue. Running your app against GTK2 results in the combo widget displaying instantly. Another reason why I have not jumped from GTK2 to GTK3 yet. You should file a bug with this test case. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: MSAA or UIA
Mike wrote: Searches on the internet give me nothing. Who knows when/if gtk+ applications will be accessible using MSAA or UIA? What are the reasons we're not there yet? Googling for uia gtk brought me this up in 30 seconds: http://comments.gmane.org/gmane.comp.gnome.gtk+.devel.general/22293 Ask Microsoft to fix their licenses. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: MSAA or UIA
Mike wrote: Unfortunately I couldnt view the whole thread. Your web page ends in the middle of the conversation, strangely. The web site doesnt have links to view the whole thread; it's a horrible mailing list reader. Your web browser must be busted. I can view the entire thread by clicking on the link I provided. Here's a link to the same thread from Gnome's mailing list viewer: http://mail.gnome.org/archives/gtk-devel-list/2012-April/msg00032.html The original poster was pointed to the Gnome legal list and he was going to pose a question there about UIA and GTK. I do not know if he did. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkButton bg color
Steve wrote: Any chance you can provide an example of a button with a background color? GdkColor colorGreen = { 0x, 0x90ff, 0xeeff, 0x90ff }; // without mouse hovering gtk_widget_modify_bg( button, GTK_STATE_NORMAL, colorGreen ); // with mouse hovering gtk_widget_modify_bg( button, GTK_STATE_PRELIGHT, colorGreen ); If this doesn't work, you must be using a GTK theme that is overriding the coloring of widgets. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkButton bg color
On 04/29/2012 11:30 AM, Steve wrote: gtk_widget_modify_bg(button, GTK_STATE_NORMAL,color); This is the right call, but I have found that this doesn't work on Windows. Are you running the program in Windows? Coloring works fine for me in Linux. If you're running Linux, your color variable may not be setup correctly. How are you defining it? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK program (a Gimp plugin) crashes only on Windows
Alessandro Francesconi wrote: What could be the problem? Is that a good way to update the GtkFrame + GtkScrollableWindow contents? Or is it a problem related to compiling arguments/libraries? I would recommend that you gather further debugging information by using gdb instead of relying on the mysterious Windows debug dialog. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Formatting dates according to the region
Dylan McCall wrote: However, g_date_time_format(datetime, %x) only returns a date formatted in that last way. How can an application use other date formats for the current region? Preferably without duplicating code, or, at least, effort. Look at the documentation for g_date_time_format(). You will find the other format specifiers that you want. %a, %A, %b, %B, and %c look helpful for you. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Getting the busy cursor to display.
James Tappin wrote: Is there some other call (or calls) I should be making to force the updates to take place? I use the following for widget updates during background processing: while ( gtk_events_pending( ) ) gtk_main_iteration( ); Not sure if it will work for cursor drawing though. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
window icon resolution
When I call gdk_pixbuf_new_from_file() to set a window icon, the resulting image in the Gnome Shell ALT+TAB switcher is fuzzy and clearly low-resolution. The window icon is a 128x128 pixel 24-bit PNG file. When I have the file displayed in another viewer (eog) and ALT+TAB, the Gnome Shell image is smaller than the full image in eog, but clearly fuzzier and lower resolution. Other applications such as Pidgin, Firefox, or Geany display clear, high-resolution icons. What am I doing wrong that other applications are doing right? I checked the Geany source and saw it had inlined the GdkPixbuf image and loaded it that way. Why would that make a difference? Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: window icon resolution
Tadej Borovšak on 02/08/2012 11:48 AM wrote: Not an expert, but my guess would be that gnome-shell loads images on it's own based on what is defined in your .desktop file when this file is available. Do you install this file for your app? My .desktop file references the same file (and same path) that I'm loading within the app. Based on your idea, I noticed other apps only reference the basename of their icon and place the file in /usr/share/icons/hicolor/foo/basename.png. I tried this same behavior and what do you know... Gnome Shell shows my hi-res window icon. Is this behavior a possible bug (or enhancement) of Gnome Shell? Not that I'm real broke up about it, but it was annoying. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: window icon resolution
Michael Cronenworth wrote: Based on your idea, I noticed other apps only reference the basename of their icon and place the file in /usr/share/icons/hicolor/foo/basename.png. I tried this same behavior and what do you know... Gnome Shell shows my hi-res window icon. Even though this method works, it only works when you start the app directly from the .desktop file. If I execute the app from a terminal the Gnome Shell ALT+TAB icon is the old, fuzzy resolution. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Standardizing file open etc
Mixbus JohnE wrote: Our 'C' program uses 'open()' and the like for dealing with disk files. This seems to work okay on Linux but not so well on Windows if there are (say) Greek or Russian characters in the file path. I'm not a Linux programmer so I assume that 'open()' on Linux must be UTF-8 aware maybe?? g_filename_from_utf8() On Windows I'd need to use '_wopen()' in this context but that would mean having different code for Windows and Linux. Is there anything built into Glib that could help with this? e.g. a function which can take a UTF-8 encoded file path and open the file successfully, whether on Windows or Linux? Thanks. g_open() Read the documentation pages surrounding the two functions I suggested to understand how they work on Windows. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Runtime environment for GTK+ application
Manuel Ferrero wrote: First: I can't find a precoocked package or at least a best practice document on which files are needed to distribute with my application, can someone point me on the right direction, please? You can either take Dov's approach and package the GTK DLLs in your installer, or you can use a pre-packaged installer: http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.24.8-2011-12-03-ash.exe?download I am assuming you are using GTK 2.24.8 (as you should on Windows). Second ancd very similar to the first: I know my hello world is working because I copied the exe file in the bin directory of my GTK installation. I was expecting I can run it from any folder in my computer because I put the GTK installation base folder in my path though, but I get some dll error. Do I forgot something during the GTK installation? The bin folder of your GTK DLLs needs to be in the %PATH% of your Windows environment. The pre-packaged installer I linked to above will set that up for you, or you can do it manually. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to extend a widget?
jacky wrote: What I was looking into would be more taking an existing widget, and modifying it a little, as in changing its behavior on some aspect, or adding a feature, something like that. My question is: what would be the best/standard/recommanded way to do such a thing? Widgets are not plugins. They are whole objects. There is no extensible feature to them. You will have two choices: 1. Copy an entire GTK widget and give it a unique name. Example: GtkButton becomes GtkMyButton 2. Create a shell widget that uses existing GTK widgets inside of it to do what you want. In the event you need to touch the GTK widgets inside, you can make your new widget a simple struct and have pointers to the interior GTK widgets. I would suggest number 2, unless you are doing something very radical. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to extend a widget?
Michael Cronenworth wrote: 2. Create a shell widget Rereading your post I think you called this composite widget. I'm not sure why you are opposed to this idea. I've created a composite widget myself and it has worked great for me. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How to extend a widget?
jjacky wrote: Anyways, I don't have a problem with creating a new (shell/composite) widget using another one inside of it, it's actually exactly what I did in my example: created a widget JjkCalendar which contains a GtkCalendar. Your composite widget project is similar to mine. I created a custom widget that is a text input combo box that if you click on the drop down button it displays a GtkCalendar. You can type in the date (in any format) and it will select the date in the GtkCalendar widget. It's just that I felt (from tutorials and such I read) that such (composite) widgets were only using widgets they contain and combining them together, rather than modifying their behaviors. You can certainly modify their behaviors. I catch and call signals that you normally wouldn't in order to parse and display the correct date format and positioning of the GtkCalendar widget. I guess my question is more: how do I affect this widget's internal behavior? how do I add a new feature (which might imply alter current way to draw the widget) ? That is, do something not really supported/planned by the widget's public API. If signal catching/calling are not enough then you might be best off creating a brand new widget. It seems you want to change the drawing of the GtkCalendar widget so you are on the right track of creating your own widget. Like I said, in the example code I posted, in order to do that, and alter GtkCalendar's behavior, I needed to redefine GtkCalendarPrivate in my widget, so that I could change values contained the GtkCalendar's private struct. Also had to copy/paste a few functions as well -- is that okay, or will it lead to problems? And if so, what's the right way to do it then? I'll admit I hadn't looked at your example the first go around. If you wish to customize the positioning, coloring, and text of each day then you must create your own widget. However, if all you want is to color the current day, then I think there already exist ways to do this without having to create a whole new widget. First, you have to set the day, and second you can theme it as you are trying to do already. Setting the day alone will color the current day. Is that all you want? In regards to your second question: As long as you are not modifying your system's GTK libraries you will not have problems in the future. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK 3 support status
On 12/03/2011 08:41 PM, John Lindgren wrote: I am wondering what the status of GTK 3 is at this time with regard to bugs reported by application developers. I reported a rather serious bug (https://bugzilla.gnome.org/show_bug.cgi?id=662043) a month and a half ago, and there is still no comment from any GTK developer. The bug affects the Audacious project to the point that we will be forced to go back to using GTK 2.x if it is not resolved soon. I agree with the conclusion of another user that this is a bug breaking [the] UI design of GTK applications. Thank you for your attention. Hi John, I agree that yours, and a few other GTK3 bugs[1][2], have kept me from porting my apps from GTK2. My suggestion would be to post your e-mail to the gtk-devel list[3], and as a last resort open a bug on the Red Hat bugzilla as Red Hat does the most GTK work AFAIK. [1] https://bugzilla.gnome.org/show_bug.cgi?id=660797 [2] Resizing of GtkTreeView columns resizes a window similar to your label bug. [3] http://mail.gnome.org/mailman/listinfo/gtk-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gdk/gtk+ win32 thread question, please help to explain
On 11/22/2011 10:13 PM, KC wrote: So the Unfortunately ... statement only apply to GDK on WIN32 ? It's safe to call GTK+ APIs (if protected by gdk_threads_enter/leave) from multi-threads even on WIN32 backend ? Is this correct ? No. GTK2 (I can't say about GTK3, but I bet it is the same) most definitely does not work with threads even with gdk_threads_enter/leave under Win32. You can use threads in your app, but all GTK2 operations must be strictly done by the primary thread. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GTK mailing list
It seems the amount of traffic on this list has dropped significantly over the past few years. Is there a better mailing list or web forum to collaborate with others about GTK application development? Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK3 and MS-Windows theme
Michael Cronenworth wrote: Does GTK3 contain the win32 work that was just released with 2.24.8? It looks like the answer is not yet as I see the win32 work is on the master branch. I'll wait for 3.4 (or if its ported to 3.2) before trying GTK3 again. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
GTK3 and MS-Windows theme
Does GTK3 contain the win32 work that was just released with 2.24.8? My GTK3 app doesn't display using the MS-Windows theme, even when I specify it in the etc/gtk-3.0/settings.ini file. Under Windows XP or Windows 7 it uses an ugly gray theme with hard square buttons. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtk3 and resizing GtkTreeView columns
I ported an app from GTK2 to GTK3. Aside from lots of function renaming and layout adjusting due to the flipping of the expand flag... I have a problem with columns in GtkTreeView widgets. In GTK2, resizing a column with the mouse past the width of the visible tree wouldn't cause the whole window to resize. In GTK3 it does, and when the window is resized you cannot shrink the window until you shrink the TreeView. How do you get tree views in GTK3 to act like GTK2? Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
How-to override printer settings
I'm trying to send a print job to tray #2 on a laser printer. It has two, real trays. I've tried two ways of sending the print job to the second tray but each time the printer uses the first tray. I understand that each printer may have a different source string, but I will always use a Lexmark printer and from what I have seen the CUPS ppd has Tray 1, Tray 2, etc for the source string. 1) Called gtk_print_settings_set_default_source( settings, Tray 2 ) after gtk_print_operation_run(). 2) Called set_default_source() before gtk_print_operation_run() by creating a new settings struct and calling set_print_settings(). The GTK documentation is not very detailed in this area and Google has not been very helpful. Any tips would be appreciated. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Gtk 3.0 API and display issues
I tried to convert a GTK 2.0 app to GTK 3.0 and ran into a few things: 1. It was pretty nasty of the GTK/Gnome folks to, at the very last minute, deprecate and change gtk_combo_box_new_text() to GtkComboBoxText. 2. The GTK 3.0 API references gtk_combo_box_text_remove_text() but the compiler complains the function is undefined. This is essentially a show stopper for converting my app. 3. Temporarily removing the *_remove_text() calls and running the app shows that the default GTK 3.0 theme does not display GtkFrame widgets. Another show stopper. Should I file bugs? or are these known issues? or am I doing something wrong? Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [Win32] Hidden window cannot be shown more than once
Michael Cronenworth on 06/17/2011 11:46 AM wrote: Is this a possible bug? or I'm doing something wrong? And just as I hit send I catch it. My callbacks were of return type void. Changing them to gboolean and returning TRUE makes the window appear upon the second call. It seems in Win32 the default is to continue the signal callbacks, which destroys the window. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[Win32] Hidden window cannot be shown more than once
Hello, I have a window that I create in a hidden state. When it is accessed in a menu I call gtk_window_present( window ); and the window is visible. I have a callback attached to the destroy and delete-event signals and I call gtk_widget_hide( window ) in them. When a user attempts to access the window a second time, the window is never displayed. I have verified that the window pointer is not being munged. This works perfectly fine on Linux clients. It affects Windows 7 64-bit and Windows XP 32-bit clients. I'm using the following runtime: gtk2-runtime-2.22.0-2010-10-21-ash.exe [1] GTK+ Runtime installer, based on gtk+-2.22.0-2, glib-2.26.0-2, atk-1.32.0, pango-1.28.3, cairo-1.10.0-2. Is this a possible bug? or I'm doing something wrong? [1] http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.22.0-2010-10-21-ash.exe?download ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_remove
Craig Bakalian wrote: Theglib/gstdio.h did the trick. But it is odd behavior. It is not odd. Read David's e-mail for a full explanation. If it is still not clear, you should read the gcc man pages for warning options. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Memory leaks
James Morris wrote: How does one gain this mysterious tool for Linux? It's called Google. There's a web page[1] that details how to setup valgrind to debug gtk/glib apps and even a preliminary suppression file. [1] http://live.gnome.org/Valgrind ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: newbie question about g_object unref()
N James Bridge wrote: It seems that g_object_unref (ptr) doesn't set ptr to NULL when it frees the allocated memory. Have I got something wrong here? Do I have to do it explicitly? The official documentation[1] does not mention anything about setting the pointer to NULL. Did you read something that says otherwise? [1] http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Take part in gkt+ development
Alexander Kuleshov wrote: 1) If i write patch, where must i send it? gtk-devel might be a more appropriate list. This list is for developers of GTK applications and not for GTK development. :) 2) What version of gtk+, must i use for development? From git? I am not a gtk developer (I am a gtk app developer), but yes, I would think you should start with the latest GTK+ git checkout. Special note: GTK+ 1.x is deprecated - do not look at this. GTK+ 2.x is in the process of being deprecated. GTK+ 3.x is where the majority of development is happening. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk 2.10 key bindings
Jaroslav Šmíd on 07/17/2010 01:05 PM wrote: Well, shouldn't you modify ~/.gtkrc-2.0 for GTK 2? .gtkrc should be for GTK 1. [I just noticed this was sent to me off list. Posting to list.] Let me clarify on none of those classes are taking effect. $ cat ~/.gtkrc-2.0 binding gtk-override { bind shiftF10 { move-cursor (visual-positions, 3, 0) } } class * binding gtk-override GtkEntry and GtkTextBuffer fields are working as I can visually see the cursor moved to the right 3 characters. However, in the Gnome Terminal, SHIFT+F10 still displays the context menu as if I right-clicked. Logging out/in does not help. Using ~/.gtkrc and/or ~/.gtkrc-2.0 does not help. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk 2.10 key bindings
I've got an app on a RHEL 5.5 box that needs the SHIFT+F10 key. However, GTK 2.10 (only version available for RHEL 5) captures the SHIFT+F10 key for the context menu pop-up. I've attempted to bind another command to SHIFT+F10 but it isn't working. cat ~/.gtkrc binding gtk-override { bind shiftF10 { move-cursor (visual-positions, 3, 0) } } class GtkWidget binding gtk-override class GtkWindow binding gtk-override class GtkEntry binding gtk-override class GtkTextView binding gtk-override None of those classes are taking effect. I have logged out/in of the local session but still no go. How do you override SHIFT+F10 with gtk 2.10? unbind wasn't added until gtk 2.12. Thanks, Michael ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Good view on windows
Adam Chrapkowski wrote: I have written a GTK+ based application and I need to redistribute it on Windows (I'm Ubuntu user). Beware if you are wishing to use native 64-bit binaries. The latest GTK+ for Win64 has a few issues (example: Windows theme doesn't work). Be sure to use 2.16. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_timeout_add_full from different thread not working
On 02/22/2010 08:55 PM, S Boucher wrote: Calling g_timeout_add_full() from a different thread (note the pthread_create in the sample bellow) than where gtk_main() is does not work as I expect. The timeout function only gets called if I generate events by moving the mouse. If I don't move the mouse, all I see is the timeout is added repeatedly, but timeout_func does not get called. I'm afraid there's something I do not understand... and thus, your help would be appreciated. I don't see a call to g_thread_init() in your example. You'll need that call prior to calling gtk_init(). ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: cool google search entrybox?
ferar aschkar wrote: how can I achieve a google search entry like that in firefox with auto-suggest and search history, any examples or links. What about this libsexy library? is there other library like that for creating cool widgets? You will want to use GtkEntryCompletion[1]. [1] http://library.gnome.org/devel/gtk/unstable/GtkEntryCompletion.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK Action Handler
dhk wrote: How can I reuse these callbacks? Use user_function( GtkWidget *widget, gpointer data ) instead of explicitly setting a class. Then cast widget as whatever you need, eg.: GTK_BUTTON( widget ) inside of your callback. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK Action Handler
dhk on 12/31/2009 10:33 AM wrote: When the button or expander is clicked with the mouse the callbacks work fine. The problem is from the menu the activate signal has GtkAction as the first parameter of the callback and I don't think that can be cast to a GtkButton or GtkExpander. I want to call the button and expander callbacks as if they were clicked with the mouse. Yeah, I didn't read your whole e-mail chain until now. GtkWidget and GtkAction are different classes. You will need to use two callback functions. If you don't care about the first argument, you could make stubs for the initial callback functions and have them call your standard callback function. The only way to do away with separate functions would be to use gtk_menu* functions and create your menu in C. I am more familiar with raw C so someone more familiar with GtkBuilder may have a better solution, but I don't see one. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Problem with table
Eero Tamminen on 12/29/2009 09:17 AM wrote: Is there some trick to doing this? If you want to use fixed lengths you must pack the widgets with the expand flag set to false. Instead of using gtk_container_add use gtk_box_set_child_packing. Example: gtk_box_set_child_packing( GTK_BOX( hBox ), label, FALSE, TRUE, 0, GTK_PACK_START ); ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Problem with table
Eero Tamminen on 12/29/2009 09:17 AM wrote: Instead of s/Instead of/Along with/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Read-only controls
Pierre Wieser wrote: Hi, Is there a standard Gtk way of defining controls as read-only at runtime ? In my user interface, I have entries, radio and toggle buttons, and a combo list ; I would set them as read-only when the current item cannot be updated for a reason or another. For now, I set all these controls as insensitive, but there is a real semantic difference between a field is not available - doesn't make sense here and a field cannot be modified, and I'd wish my UI reflects this difference. What should I do for that ? Entries: gtk_entry_set_editable() For buttons, radios, and other items, setting them to insensitive should be the appropriate thing to do. If you don't feel the same way though, you can set callbacks on the buttons, radios, etc. and just not do any of the actions the widgets would do. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: dotted line separating table columns in GTK 2.18
Kristian Rietveld wrote: Not that I know of, but I don't have knowledge of SWT so I cannot think of workaround in that area. I think it is a bit stupid that Ubuntu turned on these grid lines by default, because it is deliberately not a theme setting. We wanted the developers of applications decide whether or not grid lines should be enabled for a particular tree view. FYI, Fedora turned it on by default as well. (Fedora 12) It's unfortunate that it is not available as a style setting. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: dotted line separating table columns in GTK 2.18
Alex Ignácio da Silva wrote: Isn't there a way to change this behavior via an environment variable or some other mechanism not involving touching the C code? Create a ~/.gtkrc-2.0 and add style no-grid-lines { GtkTreeView::enable-grid-lines = GTK_TREE_VIEW_GRID_LINES_NONE } class GtkTreeView style no-grid-lines It isn't working for me though. Something is missing. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK on Windows 2000 pro, sp4
On 11/30/2009 10:08 PM, Allin Cottrell wrote: OK, found it. In GLib 2.22.2, gwin32resolver.c, the function free_lookup_by_name calls freeaddrinfo(). The MS header ws2tcpip.h is included indirectly, but this is not going to work on Windows 2000 unless wspiapi.h is also included. Google: msdn freeaddrinfo. You should probably open[1] a bug report about this if you wish to see it fixed. Sometimes Tor visits this list, but it's not a 100% guarantee. Mike [1] http://bugzilla.gnome.org ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Regarding example code (was Why is ChangeValue reentrant)
Michael Torrie on 08/13/2009 10:31 AM wrote: I'm on Fedora 11 with GTK 2.18 I think. $ rpm -q gtk2 gtk2-2.16.5-1.fc11.x86_64 ;) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Regarding example code (was Why is ChangeValue reentrant)
Boggess Rod on 08/13/2009 10:39 AM wrote: It's either already be resolved in a newer release, or it exists only as an HPUX implementation issue. I may contact HP, but it doesn't belong on the Gtk bug list. HP provides an update. I'd get off version 2.6 and onto 2.16 ASAP. Tell your superiors there's security fixes and less customer support calls if you update. ;) http://hpux.connect.org.uk/hppd/hpux/Gtk/Development/gtk+2-2.16.4/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Why is ChangeValue reentrant on a gtk_dialog_run?
Boggess Rod on 08/11/2009 08:08 AM wrote: At the risk of beating a dead horse, I've figured out what the problem is, I just don't understand why it's occurring or how to fix it. You're thread jacking. Please stop. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk_file_chooser_hangs
arne on 07/09/2009 12:39 AM wrote: I have the problem, that the gtk_file_chooser is not working anymore in my application under win32. I get just a sandglass-curser over it. I get no warning or errormessage on the console. I Setup a new Computer with Mingw and the actual (2009/06/01) All-In ONE Bundle. I just compiled an app with Fedora 11 Mingw (gcc 4.4.0) and I have no problems with gtk_file_chooser. It's possible that whatever you have the default path is a network link or some other path that is not immediately accessible. Is it? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_spawn_async_with_pipes() ssh based IPC
Thomas Stover on 07/09/2009 02:37 PM wrote: Is all this in anyway better than a maybe a custom tls/ssl server or something? I know this is slightly off topic, but I know everybody has had to ask themselves this same question. It's simple to write a GnuTLS server/client setup. Why don't you want to do that? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_spawn_async_with_pipes() ssh based IPC
Thomas Stover on 07/09/2009 03:16 PM wrote: I've done an openssl one before, and I'll look at gnutls, but the problems with that route as I see it are mainly: -you have to authenticate connections somehow- portably, and securely. Where as with ssh the OS just provides you with UIDs. I'm not a fan of the completely separate user database just for the one program architecture either. -(related to authentication) key management - ssh does all that already (ssh-agent, etc) (although the gnome-keyring library works for *nix) -more options for an admin to deal with -as legacy as ssh is, it does so much so well. It just feels like leveraging that would be a good idea. Also I might be thinking of the wrong project, but I have some vague memory of GnuTLS taking the downloads on their site down in protest after 911 (unless you donated money) or something quacky like that. (I'm pretty sure I shouldn't have said that, but whatever). You could have a TLS session without x509 auth and just use PAM or LDAP for user auth. Something like that is not provided by a single function call though. Too many options? If you make the server/client yourself then it's limited to however you program it. I don't understand your reasoning for this complaint. SSH is great for remote terminal sessions, but not much more. It sounds like you just want to be extremely lazy. Suck it up and write your own implementation using the standard library tools available. It will be portable -- my GnuTLS apps run on Linux and Windows. I don't remember anything about GnuTLS and any political agenda as that was before my time in FOSS, but I wouldn't be surprised. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_spawn_async_with_pipes() ssh based IPC
Brian J. Tarricone on 07/09/2009 03:45 PM wrote: I think the sshfs guys might beg to differ with you on that one. As would anyone who uses subversion or git (etc.) over ssh. Or anyone who's tunneled various protocols using ssh's port forwarding. That's off-topic. I'm not ignorant to those use cases. And here I was thinking that the entire point of writing computer programs was so we could be lazy. Note my word *extreme*. I'm all for easy programming -- but it sounded like the OP wanted to write three function calls and be done. Anyway, Thomas: as long as you're able to parse the responses you get from the server, using g_spawn_async_with_pipes() and probably GIOChannel, you should be able to do what you want. It probably would be more reliable to write your own TLS server and client, but might not be faster or easier. I'm not sure about the win32 issues, though. There should be zero win32 issues. One of my Win32 apps uses a GTK gui to talk to a Linux server daemon using XML-ized data packets. Not exactly the same but it works perfectly. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_spawn_async_with_pipes() ssh based IPC
Thomas Stover on 07/09/2009 03:55 PM wrote: In a perfect world a password, another private key, or what ever wouldn't ever enter the picture. ssh-agent / pageant.exe work so darn well once you get up and running. It's already sad enough that there is no way to merge this world with https client authentication, somehow. SVN is one example of something that let's you keep things simple administratively by optionally using the ssh security model. I hate to say it, but the windows named pipes over SMB is another good model (the implementation however...). Passwords all over the place = evil. Each application asking you to decrypt a private key / cert on its own = annoying. Again gnome-keyring-daemon is on the right track, but I need something for the windows side. I understand your authentication requirement, but I haven't written a program myself that masters these interfaces (PAM, LDAP, etc) so this will be my last comment on this. I have extensive knowledge using these interfaces across multiple applications however. There was something that crossed my mind when I first read your OP and this may or may not be what you are looking for... http://www.libssh2.org/wiki/index.php/Main_Page There's packages in Fedora (and probably Debian, etc) for this library, but I have not used it. That's the kind of support I need on a 24 hour a day basis. I hear you. 99.999% uptime is golden. This is with a glib event loop right? Yep. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: usb plug/unplug notifications
On 07/09/2009 09:14 PM, Ardhan Madras wrote: For desktop application (because we are GTK+ forum) there is HAL (Hardware Abstraction Layer) http://www.freedesktop.org/wiki/Software/hal to receive events and informations from devices and the kernel, gnome-volume-manager use HAL to know when a device has been attached then do some task that the user has defined (eg. mount). I'd advice against programming to HAL unless your environment requires it. DeviceKit is the future. P.S. Top posting? :) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk version for windows 9x
Andrea Zagli wrote: which is the latest version of gtk working on windows 9x? and libglade? thanks in advance If your users are still using Windows 9x, do them a favor and install a new Fedora or Ubuntu distro on their machines. Not only are they open to security vulnerabilities, but they would be *better* off with Linux for new software. Wine would/should be able to run any legacy app they absolutely need. I'm sure they would thank you. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Closing a window.
Original Message Subject: Closing a window. From: Sunburned Surveyor sunburned.surve...@gmail.com To: gtk-app-devel-list@gnome.org Date: 05/28/2009 03:27 PM I'm a Java developer that is brand new to GTK and not the world's greatest C programmer. (I'm acutally working with GTK in an effort to become more familiar with C.) I'll help you, if it rids the world of a Java programmer. :) Can you guys give me some things to check in my code that might lead me to the cause of the problem? Perhaps I'm messing something up with the signal connection. If you copied the Hello World app 1:1 then there's your problem. The delete_event callback is not set to close the window for you. The comments for the app should point you in the right direction. In particular, the comment on line 15 and onward. ;) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: support gtk+ about zoom in a widget
Original Message Subject: support gtk+ about zoom in a widget From: 呉永 w...@shcore.com.cn To: gtk-app-devel-list@gnome.org Date: 03/16/2009 08:23 PM Hi, First, I want to zoom in a window just like when we use IE browser,sometime we can't see the web page clearly, so we will use [Ctrl]+[mouse wheel] keys to zoom the page in, in that case we can see the web page clearly! please tell me how to do that in gtk! You will need to setup a GDK keypress event signal on the widget you wish to zoom on. Then you'll need to write code that will do the zooming when the key presses you want are pressed. A.K.A. when the signal is called. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Date edit widget?
Original Message Subject: Date edit widget? From: John Coppens j...@jcoppens.com To: gtk-app-devel-list@gnome.org Date: 02/12/2009 12:13 PM Once upon a time there used to be a gnome_date_edit widget. But with the tendency to eliminate most of gnome ui things, I was looking what to use if some GTK replacement existed instead. I only found GtkCalendar - but I don't want an entire calendar on my forms! Anyone know if there is some practical replacement for a date (+time) editor? GTK does not have a specialized widget like that. You will have to create it yourself. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: win32 warning - g_win32_get_system_data_dirs
Original Message Subject: Re: win32 warning - g_win32_get_system_data_dirs From: Tor Lillqvist t...@iki.fi To: Michael Cronenworth m...@cchtml.com CC: gtk-app-devel-list@gnome.org Date: 02/04/2009 01:48 AM File a new bug please. --tml Done. http://bugzilla.gnome.org/show_bug.cgi?id=570501 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
win32 warning - g_win32_get_system_data_dirs
I have just added Win32 GTK development to my existing Linux development experience, and I am getting a warning when using GTK 2.14.7 and MinGW: C:/msys/1.0/include/glib-2.0/glib/gutils.h: In function `g_win32_get_system_data_dirs': C:/msys/1.0/include/glib-2.0/glib/gutils.h:143: warning: ISO C forbids conversion of function pointer to object pointer type Bug that caused this: http://bugzilla.gnome.org/show_bug.cgi?id=173098 My ugly patch: --- /include/glib-2.0/glib/gutils.h.orig2009-01-13 11:04:38 -0600 +++ /include/glib-2.0/glib/gutils.h 2009-02-03 16:56:29 -0600 @@ -140,7 +140,11 @@ static inline G_CONST_RETURN gchar * G_CONST_RETURN * g_win32_get_system_data_dirs (void) { - return g_win32_get_system_data_dirs_for_module ((gconstpointer) g_win32_get_system_data_dirs); + gconstpointer address; + G_CONST_RETURN gchar * G_CONST_RETURN * pfn; + + *(unsigned long *) address = *(unsigned long *) pfn; + return g_win32_get_system_data_dirs_for_module (address); } #define g_get_system_data_dirs g_win32_get_system_data_dirs #endif It probably needs work, but this removes the warning and should keep the same functionality. Anyone have any recommendations: File a new bug? Open the old bug? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Window events problems
Original Message Subject: Window events problems From: Perriman chuchiperri...@gmail.com To: gtk-app-devel-list@gnome.org Date: 12/30/2008 07:21 PM Can you help me? I found that in order to properly attach to key-press-event or button-press-event in a GTK_WINDOW_POPUP type window I have to attach focus to the window with a handful of function calls... gtk_window_present( GTK_WINDOW( popupWindow ) ); gtk_widget_grab_focus( popupWindow ); gtk_grab_add( popupWindow ); gtk_widget_grab_focus( widget ); Then I can catch key and button presses inside the window. Otherwise it still thinks the GTK_WINDOW_TOPLEVEL has focus and receives keys/buttons. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How can I wrap or scroll text inside a GtkLabel to keep the width?
Original Message Subject: How can I wrap or scroll text inside a GtkLabel to keep the width? From: Guenther Meyer [EMAIL PROTECTED] To: gtk-app-devel-list@gnome.org Date: 12/11/2008 02:22 AM hi, I have GtkLabels packed inside some vboxes or tables, the width of the box is determined by the size of some other elements (buttons, listviews, ...). when the text inside the labels is changed, and this text is too long to fit, the box automatically resizes, which distorts the whole window layout and pushes some widgets off the screen. so how can I fix the width of the GtkLabel (which I don't know at creation), and let the text automatically wrap or scroll, if it doesn't fit? gtk_label_set_line_wrap( GTK_LABEL( label ), TRUE ); However, for this to work you must set a maximum size on the label. gtk_widget_set_size_request( GTK_WIDGET( label ), 100, -1 ); 100 being 100 pixels wide. You will probably want to include an alignment and justify call so that the text always looks nice. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk-feed
Original Message Subject: gtk-feed From: [EMAIL PROTECTED] To: gtk-app-devel-list@gnome.org Date: 12/03/2008 11:50 AM Hello all, I have been developing a small GTK application for some time now and I have reached version 0.2.0 with it. Basically, it's simple RSS feed reader which only appears as an icon in the window manager's system tray. As of now, it's unfinished and much developing would need to be done. Unfortunately, I seem to be lacking free time and I just decided to post this in here, in case if anyone would get interested contributing. Otherwise, comments and suggestions would also be welcome :) You can find gtk-feed in here: http://henux.nor.fi/coding/projects/15-gtk/24-gtk-feed I was going to happily look at it until I tried compiling. You should add a requires: gtk-2.14.x to your configure script. I am using 2.12 and I ran into an error with gtk_dialog_get_content_area(). 2.12 is still kind of new so you may wish to add a #define around the GtkDialog widget you are using to also have 2.14 compliant code. Users will be able to use your program on a wider variety of distributions. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Focus problem
Perriman wrote: Can you help me?? (I attach the example) Sorry, I don't see the example. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list