Re: Static library with Gtk 3
Le 30 novembre 2017, à 12:44, Emmanuele Bassi a écrit : To be fair, there's literally no reason whatsoever to do a static build; this is not 1983. You're going to waste more resources (loading time, storage space) doing a static build of everything, these days. I think there are some good reasons. For example, see http://www.musl-libc.org/intro.html . However I'm no expert in this field, so I'm not going to argue myself; I'm just saying that there are experts who do static linking, so there must be good reasons to do so. My strong suggestion is to simply ship your application in a bundled archive that replicates the file system layout that GTK expects, alongside a launcher Is this supposed to save loading time and storage space? -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Static library with Gtk 3
Le 29 novembre 2017, à 18:57, Мариано Гаудикс a écrit : Hi . I need a example for compiling a static library with Gtk3 libraries together . MXE might help you with this: http://mxe.cc/ -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Cross platform development
Le 18 mars 2017, à 14:37, Dirk Gottschalk via gtk-app-devel-list a écrit : Am Samstag, den 18.03.2017, 11:42 +0100 schrieb pelzflorian (Florian Pelz): Note that if your application is not libre software (it should be, please make it libre!), then static linking means you need to provide your application’s source code or compiled object files Thanks, this is a point I totally forgot. So no statically linking is possible. Making the project open is no option. The protocol of the devices we communicate with is covered by various NDAs. Does distributing a compiled object "leak" more information than distributing a dynamically-linked exe? I only want to copy just the needed files, not the complete DLL set Mingw has on my systems, these are real much. I can't remember if finding the deps was part of your original question (sorry). In case it was: http://www.dependencywalker.com/ -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Cross platform development
Le 17 mars 2017, à 23:02, Dirk Gottschalk via gtk-app-devel-list a écrit : I'm developing a multi platform application with GTK+ for Windows and Linux. IIRC is GTK+ and it's dependencies not linkable statically, which i would prefer. Yes, they are! I use this http://mxe.cc/ for my GTK2 app, but it has GTK3 also and many, many more libs! http://mxe.cc/#packages As you can guess, with a statically linked exe, no more headache with lib distribution, installers and so on... -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[5]: argv revisited
(Approximate repost of a message I sent with a wrong From address; looks like the mods haven't delivered nor rejected it, hence the repost, but I don't have the original message so this will break the thread. Sorry for that.) Andrew Robinson: So is that how to actually get help on the GTK Dev forums? Beg for help? I thought posting a problem would be enough, but okay then ... In my frame, saying please is not begging. I found your "Show me your code" a bit too imperative. Also, the etiquette in MLs is different from that in StackExchange. But well, I'm not a native English speaker. Your source code doesn't work, so let's compare environments. I have: 1) Windows7 2) Win32 version of GTK+, version 3.18 3) The pathname that doesn't work contains the UTF-16 character, U+2026 (ellipsis) Again, I cross-compiled in Linux for Win32, linking the last GTK2 (2.24.X I think) statically. Executable tested in Win XP. NOTE: The UTF-8 version of U+2026 is 0E280A6h, but Windows doesn't support UTF-8. I don't know how the infinity symbol I used is coded in Windows. I inserted it with the help of the character map tool. It displays properly in the file explorer. Here is where the problem occurs (simplified): oSrcFilename = gtk_file_chooser_get_filename(oBtnSrcFile); g_file_get_contents(oSrcFilename,*ptrSrcCode,*lenFile,0); I looked at your code and could see nothing different about it in this regards I spot one difference in that I call g_file_new_for_path to turn the filename string into a GFile. Maybe this is relevant, maybe not, I can't tell. HTH -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[4]: Compiling for Windows [Was: argv revisited]
OK. I understand your mileage is very different from mine. Remember, I'm just a GTK user (this is GTK *app devel* list, not GTK devel list). Just a few remarks before I answer your other mail: Le 5 mai 2016, Andrew Robinson a écrit : 1) Because there are between 40 to 120Mb worth of libraries or their dependencies I would have to post on my website. It's not clear to me whether one has to distribute GTK if it's linked statically, because one doesn't distribute the libs themselves. But I'm no lawyer and didn't investigate the question (I don't distribute publicly my small app). 3) If I do compile GTK myself, I will have to maintain all that huge amount of source code on my website, per the licensing agreement. I use GTK2, it's stable :-) I must tell grandma and grandpa to get their own copy of MSYS2 and MXE, (not Msys2, MXE will do all the needed download) and provide make their own copy of GTK+ for Win32. Wouldn't that be easy and fun? All the more as they would have to install Linux beforehand! That attitude is one of the reasons I chose to abandon Windows ... You didn't understand me: I was continuing on your irony, of course having them install Linux would be even more uneasy and unfun! -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[3]: Compiling for Windows [Was: argv revisited]
Le 5 mai 2016, Andrew Robinson a écrit : Actually, MXE isn't a compiler, but a Makefile that compiles a cross compiler. OK. So if I don't want to make my on copy of the GTK+ libraries, Why wouldn't you want to build your static libs for future inclusion in your software? Where "build" is for "let the Makefile of MXE do all the work needed to build". I must tell grandma and grandpa to get their own copy of MSYS2 and MXE, (not Msys2, MXE will do all the needed download) and provide make their own copy of GTK+ for Win32. Wouldn't that be easy and fun? All the more as they would have to install Linux beforehand! -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[4]: argv revisited
Le 5 mai 2016, Andrew Robinson a écrit : I've just tested a filename containing spaces and U+221E (infinity symbol), writing and reading both work. So you verified that in Windows using the Win32 version of GTK+? Show me your source code. "Please." Cross-compiled on Linux with i686-pc-mingw32-gcc from mingw-cross-env-2.21 (previous name of MXE), GTK2 statically linked. I think I already posted the code snippet for reading. Here for writing: -:-:-:- GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new ("Title", GTK_WINDOW(gtkwin), GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); /* gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), default_folder_for_saving); */ gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "foo.bar"); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT){ char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); GFile *outfile=g_file_new_for_path(filename); GFileOutputStream *FOstream= g_file_replace(outfile, NULL, FALSE, G_FILE_CREATE_NONE, NULL,NULL); assert(FOstream); GDataOutputStream *DOstream= g_data_output_stream_new(G_OUTPUT_STREAM(FOstream)); assert(DOstream); gboolean res= g_data_output_stream_put_string(DOstream,some_string,NULL,NULL); assert(res); g_object_unref(DOstream); g_object_unref(FOstream); g_object_unref(outfile); g_free(filename); } gtk_widget_destroy(dialog); -:-:-:- -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[3]: argv revisited
Le 3 mai 2016, Andrew Robinson a écrit : I don't think I tried filenames with spaces, but I did test filenames with accented letters in both Linux and Windows, and it worked (using GTK2). E.g. for reading a file contents into one big string I have this: I don't know about accented letters, since they are a part of the Windows version of ASCII. Try a real life UNICODE character, such as the one I have in my path, C:\My.\Images. Hi, I've just tested a filename containing spaces and U+221E (infinity symbol), writing and reading both work. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[2]: Compiling for Windows [Was: argv revisited]
Le 3 mai 2016, Andrew Robinson a écrit : Is it really necessary for every Windows application bundle to ship its own copy of GTK+? By default MXE links statically. So you don't have any dll to bundle with your app. In such circumstances, what does LGPL say? Do you still have to provide the GTK source code (given that you don't distribute GTK libs)? Well I can't ship MSYS2 and MXE with my application, and I most certainly can't sell any application to grandma and grandpa, if it requires instructions on how to install MSYS2 and MXE just so you can run my application. I really don't understand why you say this. As its name says, MXE is a compiling environment. Would you ship your assembler with your executable? -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Compiling for Windows [Was: argv revisited]
Le 2 mai 2016, Florian Pelz a écrit : On 05/02/2016 12:36 PM, Lucas Levrel wrote: Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It compiled my project with no effort at all. This is interesting. May I hijack this thread? I did not know about MXE. What is their relationship with MSYS2? I don't know. I'm a mere user and haven't even subscribed to their ML. Distributing the GTK+ source code with bundles for LGPL compliance seems easier with MXE. How do others handle source code distribution? This is not an issue for GNOME projects and I can't find examples. Is it really necessary for every Windows application bundle to ship its own copy of GTK+? By default MXE links statically. So you don't have any dll to bundle with your app. In such circumstances, what does LGPL say? Do you still have to provide the GTK source code (given that you don't distribute GTK libs)? -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[2]: argv revisited
Le 2 mai 2016, Andrew Robinson a écrit : I could find functions that worked for the command line, but I couldn't find any that worked for the filechooser, and when I go online and do a search, there are no examples for what I want to do. The GNOME forum answered my UNICODE question for the command line issue, but didn't answer the part about filechooser, and then they had the nerve to close out my bug report, which I thought was very rude. Also, I am kind of leery about having long filenames in Windows, and although I didn't see a problem with it, I have seen lots of Linux programs that would not work if certain file name paths contained any spaces. I am just not getting any good feelings with GTK, which is sad, because it is the only toolkit I know of that has a working add_from_file function. I don't think I tried filenames with spaces, but I did test filenames with accented letters in both Linux and Windows, and it worked (using GTK2). E.g. for reading a file contents into one big string I have this: -:-:-:- GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new ("Title", GTK_WINDOW(gtkwin), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); /* gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), "foo.bar"); */ if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT){ char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); GFile *infile=g_file_new_for_path(filename); GFileInputStream *FIstream=g_file_read(infile, NULL, NULL); assert(FIstream); GDataInputStream *DIstream= g_data_input_stream_new(G_INPUT_STREAM(FIstream)); assert(DIstream); char *string= g_data_input_stream_read_until(DIstream,"",NULL,NULL,NULL); assert(string); /* ... */ g_free(string); g_object_unref(DIstream); g_object_unref(FIstream); g_object_unref(infile); g_free(filename); } gtk_widget_destroy(dialog); -:-:-:- (Not sure I understand your need, though.) -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Compiling for Windows [Was: argv revisited]
(copy to OP in case he's already unsubscribed, apologies for duplication if he's not) Le 30 avril 2016, Andrew Robinson a écrit : Now my new problem I had was either locating a Win32 version of GTK+ greater than v3.18 or locating a version of libglib.dll greater than v2.40. It isn't going to happen. The GTK+ project itself does not support Win32 or Win64, expecting the developer to install MSYS2 and then ... nothing. The GTK+ project gives no further instructions on what to do next. Getting the Linux binaries for GTK+ in MSYS2 seems easy, but I don't want the Linux binaries, I want the Windows binaries. I would compile my own binaries for Windows but there is little reliable and complete information out there on how to do it and what is there isn't credible. From what I understand, compiling binaries for Win32 is a very time consuming and tedious project, so I knew if I had any problems compiling it, I would not receive any help from the GTK+ (or probably even the GNOME) community in resolving them. I'm not an expert programmer and when I wanted to compile for Windows the software I developped in Linux, I couldn't achieve a satisfactory result (using the -mwin32 or -mwindows flag gave either a clumsy additional command window, or yielded an antivirus alert!). Then I found MinGW Cross Env, now called MXE (http://mxe.cc/). It compiled my project with no effort at all. When you install it, it compiles the cross-compiler and the libs you want, so this takes quite long, but with no user intervention. Then all you have to do is add such lines in your Linux-ready Makefile: # prepend all binaries with a later-defined prefix PKG_CONFIG=$(CROSS)pkg-config CXX=$(CROSS)g++ LD=$(CROSS)ld AR=$(CROSS)ar STRIP=$(CROSS)strip ... # define the prefix in the rules targeting Windows myrule : CROSS=/path/to/bin/i686-pc-mingw32- myrule : ... HTH -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re[2]: argv
Le 15 avril 2016, Andrew Robinson a écrit : Let me rephrase this whole entire issue: Does anyone here have a working, tested, and simple program (not a command line only program) that runs in Windows with the GTK+ Win32 libraries, version 3.0 or above? If so, please give me a link of it so I can test it on my system. It could help tremendously in troubleshooting a problem am I seeing in an otherwise working program I have. Gtk2 came with "gtk-demo". Doesn't Gtk3 have a similar app? However, I don't know if it parses command-line args, if that's what you're looking for. Also, I've got limited knowledge in the compiling-assembly-linking process, but (just as Florian Pelz says) I don't see how, if your program tries to parse CL args before calling gtk_init, linking to Gtk could alter them. Maybe you could link to a dummy lib where gtk_init is a no-op, to see if that makes any difference? Good luck. -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [Denemo-devel] Tooltips - what am I doing wrong?
Le 27 novembre 2015, John Coppens a écrit : I think those 'tear-offs' are not the same ones as referred to here. The 'main menu bar' of GIMP doesn't have tear-offs anymore. I believe the ones you are showing are from right-clicking on the canvas. Right. I also suspect that the complexities arise from detaching menus from the main menu bar, not from the right-click, which is already a pop-up Thanks for clarifying. This said, I don't see much difference between e.g. the sub-menus of a menu and those of the right-click pop-up. Never mind. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Installation of pygobject with gtk on windows.
Le 27 novembre 2015, Nicolas Brack a écrit : I'm writing a small application for name generation, that I want to share with various people. Unfortunately, a lot of said people are not passionate GNU/Linux user as I am, and so porting the application for windows is important. I am not a main windows developer. I didn't use C to write the app and I already have a small prototype in python3 that works under Gnu/Linux using PyGObject for Gtk3. I now want to, firstly, have a decent installation of PyGObject and Gtk on windows so the program run and, secondly, be able to build an installer bundling the python and gnome dependencies to run standalone on windows. For my C/C++ app, to avoid these nightmares (compiling on Windows, bundling libs and/or create an installer), I cross-compile statically using MXE (http://mxe.cc): work on Linux, distribute a single .exe . It looks like the PyGObject package is not available out-of-the-box, but it may be easy to add. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [Denemo-devel] Tooltips - what am I doing wrong?
Le 18 novembre 2015, Emmanuele Bassi a écrit : On 18 November 2015 at 15:57, Lucas Levrel <llev...@yahoo.fr> wrote: Le 18 novembre 2015, Emmanuele Bassi a écrit : Tearoff menus are, by *any* metric that is not artificially restricted to "the Denemo users", a very seldom used UI element in any UI that has been designed in the past 15 years (to be generous; I haven't seen them past the early '90s); If I'm understanding right what "tear-off menus" are, they are used by Gimp. Not really, unless you're still using Gimp with GTK 1.2. I don't know, and I don't know how to know. This is Gimp 2.8. Please see by yourself: http://www.cjoint.com/c/EKti1g3OOvR Cheers, -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [Denemo-devel] Tooltips - what am I doing wrong?
Le 18 novembre 2015, Emmanuele Bassi a écrit : They decide that menus should not be torn off, and that is that, despite the fact that Denemo users do tear off menus if they are going to be using them for a while. Tearoff menus are, by *any* metric that is not artificially restricted to "the Denemo users", a very seldom used UI element in any UI that has been designed in the past 15 years (to be generous; I haven't seen them past the early '90s); If I'm understanding right what "tear-off menus" are, they are used by Gimp. Is that a useful "metric"? (That makes me wonder: what GTK version is Gimp using?) -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Interpretation of gtk warnings and errors messages
Hi, Le 13 novembre 2015, Sergei Kolomeeyets a écrit : Can anybody be so kind to help me with sources (docs of web) with relevant information or any ideas concerning interpretation of gtk messages like this: (main_1:31671): Gtk-WARNING **: /build/buildd-gtk+2.0_2.24.10-2-i386-Tg7Q_2/gtk+2.0-2.24.10/gtk/gtkwidget.c:5683: widget not within a GtkWindow. It's obvious that 5683 is a line in the source file. It was easy to check, but comments in that file tell almost noting as usual. Is this your code or third-party software? In the latter case I doubt you can make sense of it. The developer of that software will (should), if you make a bug report. What about (main_1:31671)? How can I understand what is it and where is it? I think this is the name and PID of a thread. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GTK/GDK Bug 09/30/15
Le 30 septembre 2015, Thomas Dineen a écrit : I am getting a segfault from GTK/GDK. This segfault is associated with the top level window freezing up! It dose seem to "wake up" again if the top level menus are accessed. Dose anyone know what causes this freezing up? Is there anything else I could do or send to help resolve this bug? Make a minimal example showing the problem and post it. (More than often, one finds the bug while making the minimal example.) -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Auto-resize scrolled window
Le 21 septembre 2015, Subsentient a écrit : On 09/21/15 20:33, Subsentient wrote: > When I resize the window, I'm having difficulty finding a way to make a > scrolled window automatically resize with it. I can't use > gtk_widget_set_size_request(), because then I won't be able to shrink it > down again. > Working in C. How can I have a widget automatically resize to fill all > available space given by a window, and then be willing to shrink again > if the user tries to resize the window? I've even tried putting it into a GtkAlignment with full expansion. It's in a vbox btw. In my app the window has the following layout, and it resizes (expands and shrinks) nicely: window (with default size) + hpaned + frame | + scrolled_window (policies "automatic") | + drawing_area (added with viewport; has size request) + vbox + frame | + scrolled_window (policies "never" and "automatic") | + text_view (with size request) + hbox + entry + button This is Gtk 2. To insert the frame into the vbox, and the entry into the hbox, I invoke: gtk_box_pack_start( ..., ..., TRUE, TRUE, 0); To insert the frame into the hpaned: gtk_paned_pack2( ..., ..., TRUE, FALSE); For the vbox into the hpaned: gtk_paned_pack1( ..., ..., FALSE, FALSE); HTH -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Misconduct of GTK+/glib Bugtracker Admins
Le 7 juin 2015, IgnorantGuru a écrit : As for who agrees with me and who doesn't, outside of fanboy lists and such, most people I encounter are QUITE unhappy with GTK 3, and often ask why I use it at all. Indeed, can't you go back and use GTK 2 instead ? (Maybe does this bug exist in GTK2 as well?) -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re: Re: Re: Re: Getting a Cairo context
Le 27 mars 2015, Emmanuele Bassi a écrit : I don't understand. Gtk2 is stable and only receives bug fixes, right? (Is this what you call deep maintenance?) So why should a tutorial on it be maintained? A tutorial on Gtk 2.24 would do, whatever its date. You still need to maintain a tutorial, unless it does cover *everything* already — which is not the case. So we seem to agree on that: a tutorial on 2.24 would not require maintenance, sadly there's no such tutorial. If you're writing new code and you're using GTK+ 2.x, you're sadly Doing It Wrong™, as the kids say today. I really meant expanding the code of a current project, not starting a new project. But in any case, as a very occasional programmer, I'd rather not base my work on a moving ground: 2.24 has a fixed API, is stable and maintained. Cases like Heartbleed make me think that novelty for the sake of novelty is unwise (and in my case I'd spend more time following 3.x API changes than developping my project, which would be silly). Thanks again for your help and advice. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Simple glib compilation problem: DSO missing from command line
Le 27 mars 2015, Bruno Cauet a écrit : I'm having trouble compiling stuff with glib. Here it is: $ LANG=C gcc -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -L /usr/lib -l gio-2.0 segfault.c Maybe: $ GTKHDR=$(pkg-config --cflags gtk+-2.0) $ GTKLIB=$(pkg-config --libs gtk+-2.0) $ LANG=C gcc $GTKHDR segfault.c $GTKLIB -l options must come after source files I think. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re: Re: Re: Re: Getting a Cairo context
Le 26 mars 2015, Emmanuele Bassi a écrit : What I do in a similar situation is keeping a kind of carbon copy of the bare drawing: - get two pixmaps from the drawing area : bare_pixmap=gdk_pixmap_new(d_area-window,width,height,-1); full_pixmap=gdk_pixmap_new(d_area-window,width,height,-1); - draw your background on bare_pixmap - when you have to redraw, just copy bare_pixmap to full_pixmap, add stuff to full_pixmap, then display it: gdk_draw_drawable(full_pixmap,copy_gc,bare_pixmap,0,0,0,0,-1,-1); (add stuff to full_pixmap) gdk_draw_drawable(d_area-window, copy_gc, full_pixmap, x, y, x, y, width, height); Where copy_gc has been defined this way: GdkGC *copy_gc=d_area-style-fg_gc[GTK_WIDGET_STATE (d_area)]; This is really GTK+ 2.x only, and even then it's pretty much X11-only. It works in Windows, cross-compiled in Linux with mxe (MinGW cross env). Pixmaps are really Cairo surfaces, these days, and GCs are Cairo contexts. The widget state is part of the GtkStyleContext, and the gtk_render_* API substitute the background rendering. Even for GTK+ 2.x API you should not be using gdk_draw_* and GdkGC API at all, unless your code is supposed to work with GTK+ 2.6. It is supposed to use the latest GTK+ 2 (2.24 I guess). I'm eager to read a tutorial on GTK2 programming. I think I never found one, so I'm using the reference manuals, which is a rather tough way to learn indeed. (gtk-demo doesn't have examples of what I need) Your help is appreciated. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
RE: Re: Re: Re: Re: Getting a Cairo context
Le 26 mars 2015, Sergei Naumov a écrit : Hmm. This is something I did not know I could do. But in this case I would have to redraw everything in the widget's drawing area which is my axes, tickmarks, labeles, etc... All right, I will try it this way because it is much simpler. What I do in a similar situation is keeping a kind of carbon copy of the bare drawing: - get two pixmaps from the drawing area : bare_pixmap=gdk_pixmap_new(d_area-window,width,height,-1); full_pixmap=gdk_pixmap_new(d_area-window,width,height,-1); - draw your background on bare_pixmap - when you have to redraw, just copy bare_pixmap to full_pixmap, add stuff to full_pixmap, then display it: gdk_draw_drawable(full_pixmap,copy_gc,bare_pixmap,0,0,0,0,-1,-1); (add stuff to full_pixmap) gdk_draw_drawable(d_area-window, copy_gc, full_pixmap, x, y, x, y, width, height); Where copy_gc has been defined this way: GdkGC *copy_gc=d_area-style-fg_gc[GTK_WIDGET_STATE (d_area)]; -- Lucas Levrel ___ 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_set_geometry_hints woes
Le 24 octobre 2014, Norbert Zeh a écrit : This doesn't quite achieve what I want as it does not constrain the geometry of the main window. In order to ensure its child has a fixed aspect ratio, the GtkAspectFrame introduces horizontal or vertical padding if its own aspect ratio is different. The ability to provide a geometry widget to gtk_window_set_geometry_hints seems to be designed to solve exactly the problem I'm facing, except it doesn't have the desired effect. From the name it looks like gtk_window_set_geometry_hints works on windows. Your constraint results in a variable aspect ratio for the window; it means the system would have to compute an aspect ratio for each cursor position during window resizing. I've never seen any app doing this, especially video players which would be a perfect candidate for this feature, so I guess it's impossible. Just my 2 ¢. -- Lucas Levrel ___ 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.
Le 7 octobre 2014, Oscar Lazzarino a écrit : 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. Here's how I set Return as accel in my GTK 2 app: gtkwin=gtk_window_new(GTK_WINDOW_TOPLEVEL); accels=gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(gtkwin),accels); ... button=gtk_button_new(); gtk_box_pack_end( GTK_BOX(...), button, FALSE, FALSE, 0); button_img=gtk_image_new_from_stock(GTK_STOCK_OK, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(button), button_img); g_signal_connect(button, clicked, G_CALLBACK(...), ...); gtk_widget_add_accelerator(button, clicked, accels, gdk_keyval_from_name(Return), (GdkModifierType)0, GTK_ACCEL_LOCKED); HTH. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Redistribution of GTK DLLs
Le 5 mars 2014, Chris Angelico a écrit : The sources to all of GTK? I don't know, I haven't looked; but since I'm not actually compiling GTK myself, I'd need to figure out exactly what sources are actually necessary. E. g. GTK+ 2.24 is only 13 MB (compressed), here: http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/ There you also find links to dependencies (GLib, Gdk, etc.): http://www.gtk.org/download/linux.php I guess you'd just pick the version number matching the DLLs you use. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Redistribution of GTK DLLs
En date de : Mer 5.3.14, Chris Angelico ros...@gmail.com a écrit : The very easiest solution for my users would be for me to distribute a .ZIP file of eighteen DLLs, which my app can fetch and deploy. But that would require me to make the source of those DLLs available, and AFAICT pointing to gtk.org does *not* suffice. Just a newbie question: are the sources so big that you can't host a copy of them where you host your zipfile? -- LL ___ 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
Le 12 février 2014, Bric a écrit : I am trying to compile gtk+-3.11.5 during ./configure I am getting: Can't link to Pango. Pango is required to build *** GTK+. For more information see http://www.pango.org I have pango-1.36.2 installed pkg-config --cflags pango pangocairo : I think you should look at --libs since the error is about linking. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Gdk 3.4.1
On Sat, Jul 20, 2013 at 10:52 PM, Chris Sparks mr_...@cox.net wrote: Hello, I have been search and search for an answer to my dilemma so I thought I'd post a question here. If this isn't the right list, please advise. I have been using Gdk 2.x for some time and decide to upgrade to Gdk 3.x. Let me tell you that it has been and continues to be a nightmare. Le 23 juillet 2013, Chris Sparks a écrit : Thank you Simon. I have already seen this and since all of my coding was with Gdk only using a Gtk method means I have to redesign my software. I am not sure if I want to take that on. If I were you, I'd ask myself: do I need Gtk 3? Some people word this as: if it works, don't fix it! Gtk 1 is still distributed. So you can bet Gtk 2 will continue to be distributed for years. Unless Gtk 3 has new capabilities useful to your software, don't migrate! -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re : Confused about GDKPixBuf/Cairo interaction
--- En date de : Lun 18.2.13, Rena hyperhac...@gmail.com a écrit : Recently I've been developing a Game Boy emulator that uses GtkDrawingArea and GdkPixbuf to display the game screen. In addition to the game output I want to also be able to draw text and shapes on the display window, and Cairo seems to be the ideal way to draw shapes. I'm already using Cairo to copy the Pixbuf to the GtkDrawingArea, so that seems like a good sign that Cairo and GdkPixbuf should interact nicely. Hi, Not sure if this can help, but here's what I do. It uses GdkPixmap. double new_x,new_y; new_x=d_area-allocation.width; new_y=d_area-allocation.height; copy_gc=d_area-style-fg_gc[GTK_WIDGET_STATE (d_area)]; pixmap=gdk_pixmap_new(d_area-window,new_x,new_y,-1); cairo=gdk_cairo_create(pixmap); and then, on expose events: gdk_draw_drawable(d_area-window, copy_gc, pixmap, event-area.x, event-area.y, event-area.x, event-area.y, event-area.width, event-area.height); I also have to handle configure events (where the drawing area changes size). -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re : GTK app development for windows.
--- En date de : Lun 24.12.12, Muhammed Fatih BALIN catlak.profesor@gmail.com a écrit : On Ubuntu 12.04 I can create, compile and run applications easily but I want to compile them for windows. I have mingw packages installed. But there is no gtk package in ubuntu repositories for cross development. How can I install necessary packages on ubuntu and compile gtk applications for windows on _ubuntu_? I use this with success: http://mxe.cc/ Note: I do GTK2 only, I don't know if this has GTK3. HTH. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re : Different behavior for a none decoration widget on Windows and Linux
--- En date de : Lun 21.5.12, 徐舫 xufa...@gmail.com a écrit : I created a none decoration widget using the following code. But when I clicked the item on the Window task bar, the widget does not minimized to the task bar. gtk_window_set_decorated (GTK_WINDOW(win), FALSE); gtk_widget_set_can_focus(win, TRUE); gtk_window_set_resizable(GTK_WINDOW(win), TRUE); gtk_container_set_border_width (GTK_CONTAINER (win), 0); gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER); I don't have the answer, but if I were you I'd try to toggle these settings one at a time to see if they have an influence on your issue. HTH. -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Help! Widgets drawn in reverse order
Le 7 mai 2012, Barry Kauler a écrit : The problem is that gtkdialog renders the widgets in a window in reverse order. That is, a widget that should be bottom-right, draws top-left. These snapshots show the problem: http://bkhome.org/blog/?viewDetailed=02809 Maybe you should post the source of your dialog (the file you feed gtkdialog with). Also, you might get more help on the GTK developers' list. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Missing icon in gtk 2.24.10 for win32
Hi, I'm developping an app with MinGW on Win XP. I installed the all-in-one bundle linked by http://www.gtk.org/download/win32.php . I've put the following in my code to force display of icons: gtk_settings_set_long_property(gtk_settings_get_default(),gtk-button-images,1,); But when I summon a GtkFileChooserDialog, I get a Gtk-warning in the console: cannot find icon gtk-file (or so, mine is in French). It also complains about not finding hicolor either. I found in the archive a workaround which consists in installing the hicolor index.themes file somewhere. That indeed suppresses the warning, but the icon still doesn't show up. Yet it must exist somewhere (not in my computer) since it appears in the stock icons catalog of gtk-demo! I've just downloaded the gtk 2.24.10 sources, it doesn't have a gtk-file image. So I wonder if there might be a packaging bug. Any help or thoughts? Thanks in advance. -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Configure event for a text view?
Le 8 mars 2012, Lucas Levrel a écrit : Now, I want to scroll down to the end of the text whenever the window is resized. As for now, when the window is shrinked, the end of text gets out of view and the user has to scroll down manually. I thought I'd connect the following: void scroll(){ gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW(text_view), end_ptr, 0., FALSE, 1., 1.); } to some configure-event, but I can't find a widget on which this has the desired effect. For the records, I found I should connect to the size-allocate signal of the text view. -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: cairo: multiple sprites images in one PNG
Le 15 mars 2012, Christopher Howard a écrit : Question for the veterans: -- ship_surf = cairo_image_surface_create_from_png(ship.png); // ... cairo_set_source_surface (cr, ship_surf, x, y); cairo_paint (cr); -- But what if I want, for ease of maintainability (and less system I/O calls) to put a whole bunch of sprites in one PNG? Is it possible for me to either... * load one PNG image into a surface, and then draw to a CR using only a small part of that surface? or * load one PNG into a surface, and then split that surface into multiple smaller surfaces? I'm no veteran, but I'd create one small cairo_t per sprite, then repeat your last two lines above (where cr would be the sprite), once for each sprite, with appropriate x and y : Cairo will automatically clip what falls outside the sprite's cairo_t. (Your first option seems feasible with clipping, but might be more complicated: you'd need to clip each time you draw the sprite.) -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Configure event for a text view?
Hi, My GTK window contains (among others) the following hierarchy of objects: gtk_window hpaned vbox frame scrolled_window text_view text_buffer I also set up stuff that scroll to the end whenever text is added to the buffer (note: the buffer is not editable, it's the standard output of my app): gtk_text_buffer_get_end_iter(text_buf,end_iter); end_ptr=gtk_text_buffer_create_mark(text_buf, NULL, end_iter, FALSE); and: void output(const char * str){ gtk_text_buffer_insert(text_buf, end_iter, str, -1); gtk_text_buffer_insert(text_buf, end_iter, \n, -1); gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW(text_view), end_ptr, 0., FALSE, 1., 1.); } Now, I want to scroll down to the end of the text whenever the window is resized. As for now, when the window is shrinked, the end of text gets out of view and the user has to scroll down manually. I thought I'd connect the following: void scroll(){ gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW(text_view), end_ptr, 0., FALSE, 1., 1.); } to some configure-event, but I can't find a widget on which this has the desired effect. Any help appreciated. Thanks. -- Lucas Levrel ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Compiling for Win XP SP1
Hi, Thanks for your answer. Le 28 février 2012, Raja Mukherji a écrit : What sort of error are you getting? I found that installing the Visual C++ 2008 Redistributable Package was necessary to run the app on Windows XP SP1. Windows XP SP2 and newer seem to have it installed already. I don't know which error the user is getting. And it's a toy app, so I don't want to have them waste time on debugging this. Is the package you mention to be installed in the Windows sense, or can I just zip those files together with my app? Do you know where I'll find older releases of GTK? -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Compiling for Win XP SP1
Hi, I'm writing a GTK+-based application for Win and Linux. One of my potential users only has XP SP1, and the current version of my app doesn't work there; I compiled it against GTK+ 2.24 under XP SP3. I guess I should use an older version of GTK+. Which one? Then: - Where will I download it (headers+DDLs)? - Where will I find the relevant documentation? (Or even better, a list of differences between this older version and the current one.) Many thanks in advance. -- LL ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list