Re: recommendations for new laptop as existing one could crash.

2017-06-05 Thread jcupitt
I've been happy with my xps-13, fwiw. https://arstechnica.co.uk/gadgets/2017/01/dell-xps-13-ubuntu-review-2017/ It's £1200 for the one with Ubuntu pre-installed. Fedora works well too, apparently. John ___ gtk-app-devel-list mailing list gtk-app-devel-

Re: Cross platform development

2017-03-19 Thread jcupitt
ect buildable via cmake or autotools, it should be simple to adapt. https://github.com/jcupitt/build-win64 John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Migrate to gtk3.0

2017-03-10 Thread jcupitt
On 10 March 2017 at 15:48, Rúben Rodrigues wrote: > Yes, i'm using GtkPlot! SO, I think I'm unable to migrate this to gtk3 > because of graphs. SOmeone who knows something about this charts? > http://madebyryan.blogspot.pt/2011/08/smooth-curves-for-gtk-chart-component.html I switched from GtkPlot

Re: How to confirm a memory leak

2016-07-30 Thread jcupitt
You need to set the malloc routines to use the real system malloc; export G_DEBUG=gc-friendly export G_SLICE=always-malloc I have this suppressions file: https://github.com/jcupitt/libvips/blob/master/libvips.supp That's for a gobject-based library, you might ne

Re: disabling mouse scroll on GtkComboBox and spin buttons

2016-05-22 Thread jcupitt
On 22 May 2016 at 10:57, Florian Pelz wrote: > On 05/22/2016 11:54 AM, jcup...@gmail.com wrote: >> x = gtk_combo_box_new_text(); >> g_signal_connect(x, "scroll-event", G_CALLBACK(true_cb), NULL); >> ... > > Ah yes, this is a much better way. I'm not sure it'd work for spin buttons though :-( Som

Re: disabling mouse scroll on GtkComboBox and spin buttons

2016-05-22 Thread jcupitt
On 22 May 2016 at 07:36, Lokesh Chakka wrote: > Is there a way to disable mouse scroll on GtkComboBox and GtkSpinButton > widgets ? Yes, the mouse wheel to change the combo drives me CRAZY. It means you can't use the mouse wheel to scroll a window that contains widgets, since you might scroll a

Re: Documenting properties and signals with gtk-doc

2014-12-20 Thread jcupitt
Oh dear, I'm sorry, I've been fiddling with gobject-introspection too much recently. Of course you don't need introspection to generate gtk-doc output. I don't know why your signal documentation is not being generated. On 20 December 2014 at 13:10, wrote: > I believe (I think) signals and pr

Re: Documenting properties and signals with gtk-doc

2014-12-20 Thread jcupitt
I believe (I think) signals and properties are found at build time by starting up your library and walking the classes you define. You need to add a bit more machinery to your Makefile.am to help it run g-ir-scanner for you. There's a page on the wiki about this: https://wiki.gnome.org/action/sho

Re: Plotting library for GTK+

2014-12-08 Thread jcupitt
On 8 December 2014 at 15:27, Johannes Deutsch wrote: >> I use goffice for this kind of thing. It's the plot library from >> gnumeric, so any plot you can make in gnumeric, you can make with >> goffice. > > Do you know if it's safe to consider goffice for applications based > on gtk3 that should ru

Re: Plotting library for GTK+

2014-12-02 Thread jcupitt
On 2 December 2014 at 16:17, Sergei Naumov wrote: > I think this question was asked many times but googling gives a rather patchy > answer to it. So, I am writing a piece of C code that acquires some data from > hardware controllers and it also has to plot a few simple graphs and > histograms > o

Re: g_spawn*() on windows

2014-07-03 Thread jcupitt
On 3 July 2014 15:26, Allin Cottrell wrote: > On Thu, 3 Jul 2014, Michael Cronenworth wrote: >> 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 >>>

Re: g_spawn*() on windows

2014-07-03 Thread jcupitt
Hi Vivien, 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 :-( John On 3 July 2014 14:26,

g_spawn*() on windows

2014-07-03 Thread jcupitt
Hi all, I'm using g_spawn_command_line_sync() to run a series of command-line programs (actually ImageMagick's convert, if that's important). It works fine, but on Windows I get an incredibly annoying console window flash up for a fraction of a second for each command. Does anyone have any good i

Re: Drawing bit mapped image in drawing area

2014-03-27 Thread jcupitt
isplays a live video image with an overlay. It's in Python for gtk2, but gtk3 is (almost) the same, except for the drawing model for the overlay. It runs at about 50fps with not too much CPU load on my laptop. https://github.com/jcupitt/rtiacquire/blob/master/rtiacquire/preview.py The overlay

Re: Still confused on new thread starting idle functions to update UI.

2013-12-04 Thread jcupitt
Oh dear, I think my attachment got munched (thanks Chris). Try here: http://pastebin.com/PsG2UDkY On 4 December 2013 13:31, wrote: > Here's a tiny, complete program that does almost what you want. It's > gtk2, but should work fine with gtk3. > > It just updates a status bar, but it'd be easy

Re: Still confused on new thread starting idle functions to update UI.

2013-12-04 Thread jcupitt
Here's a tiny, complete program that does almost what you want. It's gtk2, but should work fine with gtk3. It just updates a status bar, but it'd be easy to make it do a textview instead. John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome

Re: Valgrind is grinding my gears

2013-11-05 Thread jcupitt
I have a valgrind file here I use for my large gtk2 program: http://www.vips.ecs.soton.ac.uk/development/nip2a.supp I get clean runs with this file. Run with something like: export G_DEBUG=gc-friendly export G_SLICE=always-malloc valgrind --suppressions=/home/john/nip2.su

Re: GUI freeze and long blocking operation

2013-06-15 Thread jcupitt
I did a music player that pulses a set of lightbulbs in time: https://github.com/jcupitt/huebert/blob/master/huebert/controller.py Every method starts with: logging.debug('methodname: parameters') And I debug by running with logging enabled and dumping the output to a file:

Re: GUI freeze and long blocking operation

2013-06-14 Thread jcupitt
On 14 June 2013 07:29, Kip Warner wrote: > Hey Tristan. I see what you mean, but I think I should have provided > more code to show that what I was actually doing I think was what your > followup suggestion was. Namely do some short work, update the GUI, do > some more short work, repeat. > >

Re: GUI freeze and long blocking operation

2013-06-13 Thread jcupitt
Hi Kip, On 13 June 2013 06:40, Kip Warner wrote: > If I start the long job function from within my assistant's "prepare" > signal callback, as opposed to en-queueing it there via idle_add(), then > the GUI doesn't refresh throughout the duration of the long job. This > happens even though I do pu

Re: GUI freeze and long blocking operation

2013-06-12 Thread jcupitt
e enable progress feedback while long_job(): do a bit of work self.progress.update(percent) hide progress feedback mark gui active again Code here, if it's any help: https://github.com/jcupitt/rtiacquire John ___ gtk-app-devel-li

Re: GtkBox vs GtkGrid

2013-06-03 Thread jcupitt
Hi Tom, On 2 June 2013 13:12, Thomas A. Moulton wrote: > Am I missing something? > > If I use GtkBox it seems that once I add a child I can't get access to it's > address any more (GtkWidget *) > > So if I create a box with some things in it in glade I really can't do much > with them. > (Other t

Re: Widget alignment

2013-05-23 Thread jcupitt
On 23 May 2013 01:18, Kip Warner wrote: > I think your scrolled window is being allocated the width of the page, and then the image is falling to the left within that. Try without the srcolled window. Could you post a complete example? J

Re: Widget alignment

2013-05-22 Thread jcupitt
Hi Kip, On 22 May 2013 01:17, Kip Warner wrote: > How can I have this image widget added to the parent such that it is > always vertically aligned with the top of the page, but keeping the > other child box below it still vertically centred? I've tried wrestling > with Glade, but I can't figure o

Re: Wake screen saver

2013-03-18 Thread jcupitt
Hi Paul, On 18 March 2013 21:22, Paul Stelzig wrote: > Is there a way make the screen saver wake up without a key press or mouse > movement? My program is written in C with GTK+ 3.0 I'm running on Linux Mint > 13 with the mate desktop. The program is monitoring a inputs from a DIO > card, an

Re: window-popup = menu

2013-03-13 Thread jcupitt
Hi again, You can connect to the "map" event. This happens after the window has been realized and just before the window appears on the screen, so the size has been calculated. https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-map In ::map, change window x/y to move it away from t

Re: window-popup = menu

2013-03-13 Thread jcupitt
Hi Mariano, Just call gtk_menu_popup() and it'll position the menu away from the screen edges for you. https://developer.gnome.org/gtk3/stable/GtkMenu.html#gtk-menu-popup John On 13 March 2013 04:05, Mariano Gaudix wrote: > Hello how i can determine the size of a window-popup hidden ? ¿

Re: GTK app development for windows.

2013-01-30 Thread jcupitt
-mingw-w64. If you have many other dependencies, jhbuild is very convenient. I have a repro here which builds a setup.exe installer for a large application, including a lot of deps. https://github.com/jcupitt/build-win32/tree/master/7.30 John ___ g

Re: Stock Id's and Icons on buttons

2012-12-17 Thread jcupitt
On 15 December 2012 23:47, Perdie Perduta wrote: > Can any one help me understand how to add my own stock id's or icons > to these menu buttons, preferably in Glade rather than having to code > it in the software. I have some C here that adds new stock items: https://github.co

Re: GUI freezes waiting for callback function to return

2012-12-13 Thread jcupitt
On 13 December 2012 11:21, Mateusz Marzantowicz wrote: > I'm writing very simple application in Python using pygobject. I'm using > > What I've observed is that GUI (menu to be specific) freezes till my > callback function finishes. It's completely unacceptable for GUI This is because callbacks a

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread jcupitt
Sorry I missed the process bit. To have the load in another process, use a pipe to send worker results back to the main process, and add the pipe to your gtk main loop as an event source. You obviously can't use any gtk/glib stuff in your worker, you'd need to just make a .jpg, then do all the wi

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread jcupitt
On 6 October 2012 15:48, Filip Lamparski wrote: > However, the thumbnail loading process takes a long time, so I want to put > it into another process, with the GUI displaying a spinner or a progress > bar until the loading finishes. Sorry, I don't use Python much, but in C you'd start a thread t

Re: Gtk_Tree_View, drawing speed

2012-09-26 Thread jcupitt
On 26 September 2012 07:09, Arne Pagel wrote: > Do you see any other option? Have you tried setting the fixed-height hint on the treeview? By default treeview supports variable-height rows. This is great, of course, but there is a performance penalty: whenever the model changes, the view has to

Re: parsing bibtex with GKeyFile parser

2012-09-06 Thread jcupitt
On 6 September 2012 13:01, Rudra Banerjee wrote: > I am thinking of possibility of parsing a bibtex file with gkeyfile > parser. bibtex has the structure like: > @Book{a, > Author="b and q and r, s ", > Editor="c", > Title="d", > } GKeyFile syntax is not much like that. Yo

Re: auto refresh file in textview

2012-08-24 Thread jcupitt
On 24 August 2012 14:41, Rudra Banerjee wrote: > I am sorry but I really don't know how to write on a buffer. I append to a textview like this: void log_text( Log *log, const char *buf ) { GtkTextView *text_view = GTK_TEXT_VIEW( log->view ); GtkTextBuffer *text_buffer = gtk_text_

Re: auto refresh file in textview

2012-08-24 Thread jcupitt
Hi Rudra, On 23 August 2012 13:45, Rudra Banerjee wrote: > whenever I am writing, it is saved, but to see the change, I have to > reopen the file(obviously). What do you need to know? Do you want your textview to update as the file changes? If your program is appending to the file as well as di

Re: yet another thread question

2012-07-06 Thread jcupitt
On 6 July 2012 14:49, David Buchan wrote: > If I understand the first solution correctly, we're creating a separate idle > function for each message. If the worker thread gets a bit ahead of the GUI > updates, then a few idle functions might pile up. ok. But one thing I don't > understand is that

Re: yet another thread question

2012-07-06 Thread jcupitt
Hi again David, On Friday, 6 July 2012, David Buchan wrote: > > When the user presses a button, an idle function is begun to watch a flag > which will tell it a message has been left in a string for it by a worker > thread. The worker thread is then started. It will produce results to be > disp

Re: Another thread/idle/timeout question

2012-07-05 Thread jcupitt
you mean something more complicated and I've misunderstood :( I use semaphores for hairier thread synchronisation problems. http://en.wikipedia.org/wiki/Semaphore_%28programming%29 I have a set of simple semaphore functions over the g_thread primitives: https://github.com/jcupitt/libvips/blob/maste

Re: GTK 2.24.10 memory leak on win32?

2012-07-03 Thread jcupitt
On 2 July 2012 15:44, Gabriele Greco wrote: > I'm posting the code here before creating a bugzilla entry for it since I'm > not sure I can use g_idle_add to notify a new frame is available without > freeing the source, that works in linux and in older WIN32 versions and it > seems correct since g_

Re: Threads and idle functions

2012-07-02 Thread jcupitt
Hi Igor, On Tuesday, 3 July 2012, Igor Chetverovod wrote > > Hi David, > probably you should use macros: > gdk_threads_enter () > gdk_threads_leave (). Those macros were used to lock the main gdk thread in earlier versions of gtk if you wanted to call gtk_ functions from many threads. They are n

Re: Porting Between Linux and Windows

2012-06-23 Thread jcupitt
On 16 June 2012 01:33, Eric Tavenner wrote: > I am trying to teach myself C++.  My goal is to be able to write code for > the same app in either Linux or Windows, and compile for both from the same > code.  Is this possible? Yes, I have a largish C/C++ program which I can build for Windows and Li

Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread jcupitt
On 1 June 2012 20:41, Chris Vine wrote: > jcup...@gmail.com wrote: >> That's out of date. g_idle_add() does not need any locking by you. > > I think you may be confusing this with the fact that with glib >= 2.32 > it is no longer necessary to call g_thread_init() to make glib thread > safe, which

Re: Help with a multi-threaded application. Spot a crash.

2012-06-01 Thread jcupitt
Hi again Osmo, On 31 May 2012 17:50, Osmo Antero wrote: > Jcupitt: > Ok, g_idle_add() seems to need protection by gdk_threads_enter() and > leave(). > Ref: > http://developer.gnome.org/gdk/stable/gdk-Threads.html#gdk-threads-add-idle That's out of date. g_idle_add() does not

Re: Help with a multi-threaded application. Spot a crash.

2012-05-31 Thread jcupitt
On 31 May 2012 07:11, Osmo Antero wrote: > The actual code has also a LockedCounter (mutex controlled) object > that feeds each thread with a unique sequence number. Only the thread > with highest sequence number can tick and change the GUI, others will > simply die away. I expect you know, but t

Re: Getting the "busy" cursor to display.

2012-04-11 Thread jcupitt
On 10 April 2012 18:33, James Tappin wrote: > Thanks for the suggestion. Unfortunately in this case it doesn't help. (I > have also tried gdk_display_flush and gdk_window_flush, but still the same > story). Here's a tiny test program that works for me with gtk2. It just uses: gdk_window_set_cu

Re: Getting the "busy" cursor to display.

2012-04-10 Thread jcupitt
On 10 April 2012 16:58, James Tappin wrote: >      call gdk_display_sync(gdk_display_get_default()) >      call gdk_window_set_cursor(draw_window, busy_cursor) >      call gdk_display_sync(gdk_display_get_default()) My gtk2 program does this with: gdk_window_set_cursor( w

Re: problems understanding gtk3/gdk/cairo interaction

2012-04-06 Thread jcupitt
Hi Roger, You should do all drawing in the expose handler and nowhere else. Don't do any direct drawing in your data hander, instead update your model and queue an expose event. On 7 April 2012 02:16, Roger Davis wrote: > presumably this includes the GtkDrawingArea widget as well. If there is >

Re: Making a cursor (cross hair) track between image displays

2012-04-04 Thread jcupitt
On 4 April 2012 15:37, Tilton, James C. (GSFC-6063) wrote: > Your response is very helpful. The one key question that remains for me is: > > How do I draw a "floating crosshair"? You need to do it by hand, unfortunately, though it's not so hard (I think). The trick (in my opinion) is to have a c

Re: Making a cursor (cross hair) track between image displays

2012-04-04 Thread jcupitt
Hi Jim, On 2 April 2012 17:00, Tilton, James C. (GSFC-6063) wrote: > When I place the cursor in one of the display images, I would like to have a > cross hair appear at the cursor location of the window in which the cursor is > placed at the location currently pointed to by the cursor. I would

Re: Re:GtkScrolledWindow/GtkViewport question

2012-03-07 Thread jcupitt
Hi Michael, Unfortunately I don't think this is easy. You need o do some kind of crazy hack, like realizing but not mapping the dialog, measuring the size you get, guessing the amount of chrome the theme is adding from that, then setting the default window size and finally mapping. I'd love to be

Re: Scrollable object problem in GTK 2.20 (Windows)

2012-03-06 Thread jcupitt
Hi John, On 6 March 2012 09:38, John Emmas wrote: > We're using GTK+ v2.20.0 which was current at that time. The Windows version > has a peculiar problem > > The problem affects any "scrollable / draggable" object but the easiest > example to explain is probably a scroll bar. Let's say I left

Re: gtk+ 2.24 installation problems

2012-03-04 Thread jcupitt
Hi Roger, On Saturday, 3 March 2012, Roger Davis wrote: > I then downloaded those sources and first built glib 2.27.93 with a > simple './configure --prefix=/usr; make; make install;'. That went fine, Oh dear, I think you may have broken your system. You've overwritten files which were being run

Re: porting Xlib/Motif apps to GTK+

2012-02-29 Thread jcupitt
As a short-term fix I think it'd be fine to target gtk2, it's going to be around for years. In my opinion, the time of xor rubber banding has passed, it's just too hard to get it working reliably in complex situations. Once you have double buffering, background scrolling, overlapping display objec

Re: porting Xlib/Motif apps to GTK+

2012-02-29 Thread jcupitt
Hi Roger, I moved a medium-sized (100k lines) application from Motif/X11 to gtk+ a while ago. As you say, gdk_ is a thin layer over the X11 drawing system, so converting that is pretty easy. Gdk has quite a few helpers too, eg. stuff for rendering a 24-bit image to whatever visual the server has,

progress bar use

2012-01-16 Thread jcupitt
On Monday, 16 January 2012, Nick Belshaw wrote: > I would like to implement a progress-bar to make clear to users stuff is > happening. > Specifics involve loading and pre-processing of files. Some files might be > very big requiring some 10's of seconds to do all stuff. > At the moment the proces

Re: maybe known, maybe not...

2012-01-08 Thread jcupitt
Hi Gary, On 8 January 2012 02:49, Gary Kline wrote: > o am trying to have a "run" button fork off a new gvim and increase > a global counter after the first gvim is closed.  my main gtk goes > dark and nothing responds in this case.  i don't know if every If you do this: system("gvim stuff.tx

Re: GtkTreeView very slow for large lists

2011-12-16 Thread jcupitt
On 16 December 2011 10:36, wrote: > 2011/12/16 John Lindgren : >> Lately I have been trying to improve the performance with large >> playlists (i.e. on the order of 100,000 entries).  The one remaining >> problem spot seems to be GtkTreeView.  I am attaching a simple test >> program that creates

Re: GtkTreeView very slow for large lists

2011-12-16 Thread jcupitt
2011/12/16 John Lindgren : > Lately I have been trying to improve the performance with large > playlists (i.e. on the order of 100,000 entries).  The one remaining > problem spot seems to be GtkTreeView.  I am attaching a simple test > program that creates a GtkTreeView with 3 columns and 100,000 r

Re: list troubles?

2011-12-16 Thread jcupitt
On 16 December 2011 08:17, Gary Kline wrote: > i've asked what i thought were straightforeward quwstions recently. > zip.  am i getting thru? The last mail I see from you in my mail archive is 2 days ago, saying "thanks" to Florian. Were there some more since then? John _

Re: GLIB for a webserver

2011-12-13 Thread jcupitt
On 13 December 2011 10:45, Marcelo Elias Del Valle wrote: > I was thinking in monitor the server memory to not let it reach the maximum > allowed by the OS, which seems to be the basic idea behind what you have > said. Although I think it' s better than nothing, the problem is that other > machine

Re: how to use hbox?

2011-12-12 Thread jcupitt
Hi Gary, 2011/12/11 Gary Kline : >        well, i've reached a stumbling block.  the app i am working >        on had things is a vertical stack.  so far, there about 6 >        rectangles.  the first shows the default title and the >        count: Something like "talk.0.txt" Here's a tiny demo p

Re: GLIB for a webserver

2011-12-11 Thread jcupitt
Hi Marcelo, On 10 December 2011 23:05, Marcelo Elias Del Valle wrote: >    Imagine the following scenario: the application running on my web > server spends 20k of memory for each concurrent request. If I have > enough concurrent requests in a way it will consume more memory than, > let's say, 2G

Re: a couple questions...

2011-12-08 Thread jcupitt
Hi Gary, On 8 December 2011 01:00, Gary Kline wrote: >        i'll need a play button and callback that invokes, say, >        espeak -f on that file. Make a play button with gtk_button_new_from_stock(GTK_STOCK_PLAY): http://developer.gnome.org/gtk3/stable/GtkButton.html#gtk-button-new-from-sto

Re: Focus behaviour on widget derived from a gtkentry

2011-12-07 Thread jcupitt
On 7 December 2011 09:16, Geert Janssens wrote: > I am now having problems to set the focus on this widget programmatically. In > this particular use case, the widget is added to a GtkAssistant, and during > the prepare of the page showing this widget, I call a gtk_widget_grab_focus on > it. This

Re: mutex doubt

2011-12-06 Thread jcupitt
2011/12/6 Marcelo Elias Del Valle - SYSMAP SOLUTIONS - Claro MA-SP - : >        Do I need to call g_thread_init() manually before calling g_mutex_new > (), in a glib only application? Or is it auto called by default when I call > g_type_init() and therefore I don't need to do it? Older versions

Re: obtain parent from menu callback

2011-11-28 Thread jcupitt
Widget *menu, GtkWidget *button, Rowview *rview ) { do_stuff( rview ); } Source here, along with some other stuff. It's only 100 lines or so. https://github.com/jcupitt/nip2/blob/master/src/gtkutil.c John ___ gtk-app-devel-list maili

Re: Valgrind questions

2011-11-23 Thread jcupitt
Hi Tom, On 23 November 2011 15:21, Thomas Harty wrote: > any suggestions for what's causing this leak report and the best way to > suppress it? That looks like a gtk/gtkmm bug to me, but it's hard to tell without some context. Could you make a tiny test program which shows this behaviour? It a

Re: gtk and linux

2011-11-03 Thread jcupitt
Hi Craig, On 3 November 2011 08:07, Craig wrote: > Is there a list of linux "flavors" like Ubuntu, KDE, Red Hat... that > include or don't include gtk? And, let's say that a type of linux I think all will include gtk, either as part of the standard install or available via the package manager. T

Re: GLib with Flex and Bison

2011-10-03 Thread jcupitt
On 3 October 2011 01:37, Craig wrote: > I am about to try to use GLib in a Bison file, mainly calling > functions on the GList Object.  I have never tried this before.  Will it > work?  Are there any threading issues? Bison and flex don't use threads, so no, there's no issue there, it works fine.

Re: Valgrind questions

2011-09-20 Thread jcupitt
Hi Tom, On 20 September 2011 11:38, Thomas Harty wrote: > Running like that, I still get quite a few leaks detected by valgrind. Some > of them are created by g_type_add_interface_static, which looks like another > type_init leak, which we can safely ignore. So, I've added the following to > t

Re: Valgrind questions

2011-09-20 Thread jcupitt
I posted this the last time this subject came up (twice last year, I think), but I made this valgrind suppression file for my project:  http://www.vips.ecs.soton.ac.uk/development/nip2.supp Run with: $ export G_DEBUG=gc-friendly This makes Glib clear certain memory areas after using the

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread jcupitt
On 30 August 2011 15:22, Andrew Wood wrote: > How would you link it directly to the window then rather than to a widget? You can link a GClosure to a key press with this: http://developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html#gtk-accel-group-connect Parse "esc" to key/mod with

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread jcupitt
Hi Andrew, You can add an accelerator to a window and it'll be called when that key combination is pressed. It doesn't need to be associated with a widget. However I think it's generally considered good form to have a menu item somewhere with the accelerator as a shortcut. That way the user can d

Re: Detecting Ctrl Esc in GTK app

2011-08-30 Thread jcupitt
That lets you detect ctrl-esc anywhere on the desktop. If you only need to detect crtl-ecs within your window you can just set "Escape" as an accelerator, see: http://developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html On 30 August 2011 06:33, czk wrote: > try gdk_window_add_filter o

Re: gtk assistant any good?

2011-08-19 Thread jcupitt
On 19 August 2011 16:13, Michal Suchanek wrote: > https://bugzilla.gnome.org/show_bug.cgi?id=656816 Could you explain the combobox navigation bug a little more? It seems to work for me. If I open GIMP preferences (for example) and tab to one of the comboxboxes there I can use up/down arrows to c

Re: Questions on creation of glyphs

2011-07-19 Thread jcupitt
Hi Ferdinand, >> I want to create a small set (say >> 5-10 symbols) of custom glyphs and want these symbols to be >> part of the alphabet of a fictional language. I also want to >> assign unused unicode values to these symbols and want these >> symbols to appear on my application as well as the te

Re: I Miss Using My Anjuta IDE

2011-03-11 Thread jcupitt
On 11 March 2011 12:23, Craig Bakalian wrote: > I don't know if this is the right place to complain about this, but ever > since I update to 11.04 I have not been able to use Anjuta IDE. Hi Craig, 11.04 is still in development and is not finished. You should expect many broken packages and non-f

Re: custom gtkwidget destruction

2011-02-25 Thread jcupitt
On 24 February 2011 22:57, James Morris wrote: > I am wondering if in this case, as there is no extra data to destroy, > is it really necessary for me to specify the destroy function? > > Put another way, by specifying the destroy function, am I duplicating > by 'over-riding' the 'default destruct

Re: Viewport diagonal scrolling redraw

2011-02-16 Thread jcupitt
On 16 February 2011 04:48, Rendaw wrote: > As a side note, does gdk_window_process_updates() preserve mouse motion > events when the MOTION_HINT mask is set?  I also had motion event queuing > problems (I would stop moving the mouse but the screen would continually > redraw for a few seconds until

Re: Memory leaks

2011-02-11 Thread jcupitt
I posted this the last time this subject came up (twice last year, I think), but I made this valgrind suppression file for my project: http://www.vips.ecs.soton.ac.uk/development/nip2.supp With this, I get no reported leaks in my huge (200,000 lines of C) application on Ubuntu with current gtk+.

Re: Bring a widget to the foreground

2011-01-07 Thread jcupitt
On 7 January 2011 11:33, John Emmas wrote: > Although I can now change the button's label font, the new font seems to be > quite transitory and certain operations seem to reset it.  For example if > (later) I change the label's text (e.g. if it currently says "This message" > and I change it to

Re: Bring a widget to the foreground

2011-01-04 Thread jcupitt
I agree, I was just trying to keep it simple. On Tuesday, 4 January 2011, Jaroslav Šmíd wrote: > Don't do that. Fixed size buffers are evil for string formatting. You better > use g_strdup_printf even though this would lead to reallocations. But much > better then end up with cropped text. > >

Re: Bring a widget to the foreground

2011-01-02 Thread jcupitt
On 2 January 2011 15:39, John Emmas wrote: > To be honest, all I'm trying to do is create a button whose label font can be > changed on demand.  I've managed to achieve it by using an empty button with > a label on top, except that the label doesn't always stay on top! Ah, OK, yes, there's a mu

Re: Bring a widget to the foreground

2011-01-02 Thread jcupitt
Hi John, On 2 January 2011 13:17, John Emmas wrote: > As an example, let's say I wanted a button whose label needed to be at the > top of the button, rather than in the centre.  I use either a separate label > or a graphical image to achieve this. You can just set the alignment on the label to

Re: Cancel construction of GObject

2010-11-27 Thread jcupitt
On 27 November 2010 11:14, Jaroslav Šmíd wrote: > Is it possible to "cancel" construction in gobject-derived class? I don't think so. Lots of code (including code inside gobject) assumes that g_object_new() always returns a valid pointer. I handle this by having a more complicated init system. I

Re: Memory management in gtk

2010-10-19 Thread jcupitt
On 19 October 2010 06:22, Vishak V. Kurup wrote: > I am having a small problem related to GTK. My application is having > around 15 windows.  When I start my application and check the memory > usage using "top" utility it shows around 19MB. When a new window is > created it may increase upto 22 MB

Re: GTK+ vs GTK 2 vs GTKMM

2010-09-17 Thread jcupitt
On 14 September 2010 15:48, Dmitry Kruglov wrote: > 5. I want to work with the database and use the Grid in different > windows: http://gtkextra.sourceforge.net/ I think you'll find that the standard gtk treeview widget is better for this. For example, if you use Rhythmbox, the main display of so

Re: porting gdk -> cairo

2010-08-11 Thread jcupitt
On 11 August 2010 02:14, Allin Cottrell wrote: > rid of GdkGC.  I'd imagine that the effect I'm after is something > that many GTP apps have need of, and it's trivial to achieve with > the GDK API. I've found that XOR rubber banding is quite hard to do reliably in gdk. The problem I think is tha

Re: how to implement my own window decoration

2010-07-28 Thread jcupitt
2010/7/28 c-aries : > Hi all. Can someone show me how to implement my own window decoration? > Such as removing the title and resize buttons, adding background picture in > the window decoration. You can use gtk_window_set_decorated() to turn off the usual window decorations: http://library.gn

Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread jcupitt
On 4 July 2010 16:50, John Emmas wrote: > operation being processed.  Neither of those is quite what I need.  I'm > looking for is a function that will force a window to be repainted at once, > before any other pending events get processed. There's gdk_window_process_updates(): http://library.

Re: Brainy person needed for scrolling canvas problem!

2010-07-03 Thread jcupitt
On 2 July 2010 18:12, John Emmas wrote: > Thanks for the suggestion John.  Can I assume that you're referring to the > functionality of gdk-pixbuf?  It didn't occur to me to look there, though I > suppose it's the most obvious place to find a solution.  I'd been looking for > layering API's or

Re: Brainy person needed for scrolling canvas problem!

2010-07-02 Thread jcupitt
Hi John, On 2 July 2010 16:04, John Emmas wrote: > Now for the problem  when in "playback" mode, I'd like the viewport to > have a vertical "now line" (similar to the play head on a tape recorder). I doubt I count as brainy, but one simple technique would be to render the screen in layers.

Re: multithreading gtk app

2010-06-30 Thread jcupitt
On 30 June 2010 01:57, Mick wrote: > can anyone point me to an explanation (with examples) to help me > understand running some dialogs in separate threads. (eg. help, > preferences, etc) It's almost always best to only have a single GUI thread in a gtk application, in my experience. Use non-mod

Re: Translating co-ordinates from local to screen space

2010-06-11 Thread jcupitt
On 11 June 2010 11:50, Matthew Allen wrote: > I'm trying to translate co-ordinates from local widget space into screen > space and back again. Is that possible with GTK? You can use _get_allocation() to get the size and position of a widget within it's parent: http://library.gnome.org/devel/gtk/

Re: Top down layout

2010-06-09 Thread jcupitt
On 9 June 2010 12:40, Matthew Allen wrote: > the problem I have now is that because I'm catching the "configure-event" > on the GtkWindow (to adjust my internal position/size variables) the > scrollview doesn't update to the client area of the window as I resize it. That's an easy one (phew): all

Re: gdk_draw_image() not working?

2010-06-09 Thread jcupitt
On 8 June 2010 23:22, Tomasz Sterna wrote: > I am using the following code (stripped): > > 8< > drawing = gtk_drawing_area_new (); > gc = gdk_gc_new (drawing->window); > image = gdk_image_new (GDK_IMAGE_FASTEST, >                       gdk_visual_get_system(), w, h ); > paint_image (imag

Re: Top down layout

2010-06-09 Thread jcupitt
On 9 June 2010 06:16, Matthew Allen wrote: >    GtkWidget *vp = gtk_viewport_new(GTK_ADJUSTMENT(h), GTK_ADJUSTMENT(v)); >    if (vp) >    { On a tiny style point, by design gtk cannot get out of memory errors. You can set a handler to run on out-of-mem, and allocations you perform yourself with g

Re: Top down layout

2010-06-09 Thread jcupitt
Hi Matthew, On 9 June 2010 06:16, Matthew Allen wrote: > When I tried putting putting a scrollable area into a window... > I didn't get very convincing results. The code below attempts to put a very > large button into a 300x300 size window. I made you a tiny example program. This puts a 400x400

Re: Good view on windows

2010-05-25 Thread jcupitt
On 25 May 2010 16:20, Adam Chrapkowski wrote: > I have written a GTK+ based application and I need to redistribute it on > Windows (I'm Ubuntu user). I'd add another bit of advice to Tor's excellent mail: cross-compile from linux with mingw. It really is much faster and simpler than compiling on

  1   2   >