Re: How can I check if a GtkWidget exists?

2012-07-20 Thread James Morris
On 20 July 2012 07:50, Frank Cox wrote: > How can I check if a GtkWidget exists? > > I am planning to create and destroy widgets in a window depending on the > user's > selections, but I can't figure out how to determine if a particular widget > already exists in the window so it won't be created

Re: Threads and idle functions

2012-07-02 Thread James Morris
On 3 July 2012 02:10, James Morris wrote: > (sorry forgot list) > On 3 July 2012 01:50, David Buchan wrote: >> My understanding is that child threads must never alter the UI in any way. >> >> If I have a program which spawns a child thread to download some data and I &g

Re: Threads and idle functions

2012-07-02 Thread James Morris
(sorry forgot list) On 3 July 2012 01:50, David Buchan wrote: > My understanding is that child threads must never alter the UI in any way. > > If I have a program which spawns a child thread to download some data and I > want to be able to have a dialog pop up should an error occur, is it correct

Re: custom widget theme change problem

2012-06-21 Thread James Morris
On 22 June 2012 01:50, James Morris wrote: >> Can anyone give any pointers as to what might be happening? > > I've found the culprit, or put another way, I've found what to comment > out to fix the problem. > > In my custom_widget_realize callback it has the foll

Re: custom widget theme change problem

2012-06-21 Thread James Morris
Hello again, Seems to be a habit of mine here, I ask a question, don't get an immediate response and then look further into it and find some sort of solution... On 21 June 2012 10:42, James Morris wrote: > Hi, > > I have a custom GTK widget which renders using Cairo. In the exp

custom widget theme change problem

2012-06-21 Thread James Morris
Hi, I have a custom GTK widget which renders using Cairo. In the expose callback gtk_widget_get_style is called to obtain colours to render the widget with some theme consistency. When a theme is changed (ie using gtk-chtheme) any of my custom widgets that are visible are not updated. However, af

Re: GtkFileChooser selection-changed signal emission on gtk_dialog_run()

2012-06-14 Thread James Morris
On 14 June 2012 16:54, James Morris wrote: > Hi, > > I've got a problem with the "selection-changed" signal being emitted > as soon as gtk_dialog_run is called on a GtkFileChooserDialog. I tried > delaying connection of the callback until right before calling > gt

GtkFileChooser selection-changed signal emission on gtk_dialog_run()

2012-06-14 Thread James Morris
Hi, I've got a problem with the "selection-changed" signal being emitted as soon as gtk_dialog_run is called on a GtkFileChooserDialog. I tried delaying connection of the callback until right before calling gtk_dialog_run but there were still four calls (in a row AFAICT) to the callback. I am now

Re: gtk-app to search google scholar

2012-05-25 Thread James Morris
On 22 May 2012 21:20, Rudra Banerjee wrote: > Dear friends, > I am trying to make a gtk application that will create a bibtex. > The problem is I am a novice in C/gtk programming(this will be only my > 2nd programme in gtk). > To do that, First and foremost, I need to search google scholar from th

Re: no luck with dialogs and ecrooolbars, and gtktext..

2011-12-20 Thread James Morris
> n Tue, Dec 20, 2011 at 02:52:10PM -0800, Gary Kline wrote: >>         text = gtk_text_view_new(); >>         gtk_container_add(GTK_CONTAINER(window),text); >>         buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)); >> " >> and fopen some file and display the text in the buffer.  The >> qu

Re: 'irregular shaped' windows without deprecated gdk code or compositing

2011-08-01 Thread James Morris
On 31 July 2011 23:24, James Morris wrote: > Hi, > > It appears that the 'irregularly shaped' windows which used to be > possible by using now-deprecated GDK code even without full > compositing available, are no longer possible using non-deprecated > code. > >

'irregular shaped' windows without deprecated gdk code or compositing

2011-07-31 Thread James Morris
Hi, It appears that the 'irregularly shaped' windows which used to be possible by using now-deprecated GDK code even without full compositing available, are no longer possible using non-deprecated code. Using the old deprecated code, a GdkRegion could be created with the desired window shape (wit

Re: Making widgets visible outside their containing window

2011-07-13 Thread James Morris
2011/7/13 Felix H. Dahlke : > Thanks for your answers. I did fool around with a popup, but it would > also overlap other windows, transient or not. Furthermore, I need it to > move relative to the window if that is moved. > > Maybe it's best if I tell you what I'm trying to do in particular: > I'm

gobject and gtk_widget_set_sensitive

2011-07-04 Thread James Morris
Hi, I have a custom widget I've created which uses widgets from a 3rd party library. When I use gtk_widget_set_sensitive(my_widget, FALSE), some of the widgets from the other library remain sensitive. Is this a bug in the 3rd party library? Or should I be using a callback to handle the "state-ch

Re: Changing a GtkToolButton icon_widget on the fly

2011-06-22 Thread James Morris
On 22 June 2011 05:43, James wrote: > Hi, > > I've been trying to change the icon_widget that's displayed for a > toolbar button while the main window is displayed.  I can't seem to get > the actual image to change, although the functions that call > gtk_tool_button_set_icon_widget(0 do get called

Re: How to make the toolbar button flashing

2011-03-01 Thread James Morris
On 1 March 2011 08:20, Miroslav Rajcic wrote: > I am trying to make the "Pause" button flash (or show any similar behaviour > similar to that) when the pause state is active. > So far I tried many things, but none of these seem to work: > - changing the button background color > - changing the but

custom gtkwidget destruction

2011-02-24 Thread James Morris
Hi, I'm a little confused over destruction of my custom widgets. I'm mainly looking at existing code for how to do things as I've found the docs (via DevHelp) difficult to understand and to garner an idea of when and what is needed. Here's some typical code for one of the widgets which is (typica

Re: g_remove

2011-02-17 Thread James Morris
On 17 February 2011 12:27, Craig Bakalian wrote: > Hi, > > I am using g_remove to remove some temporary files from the /tmp folder. > It is working as expected.  Yet, gcc is complaining that I am making an > implicit declaration.  What is up with this? You've not #include-ed the necessary files?

Re: adding button events to a gtkdrawingarea based gobject

2011-02-15 Thread James Morris
On 14 February 2011 13:20, James Morris wrote: > Hi, > > (forgive some imprecise names here, am writing from memory and in a > rush before work) > > I'm adapting some code which uses gobject to create a widget. The code > previously used GtkWidget as the parent_class but

adding button events to a gtkdrawingarea based gobject

2011-02-14 Thread James Morris
Hi, (forgive some imprecise names here, am writing from memory and in a rush before work) I'm adapting some code which uses gobject to create a widget. The code previously used GtkWidget as the parent_class but I am trying to adapt it to GtkDrawingArea as the parent_class. However, the button_pr

Re: Memory leaks

2011-02-09 Thread James Morris
On 9 February 2011 16:10, Michael Cronenworth wrote: > 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 prelimin

Re: Memory leaks

2011-02-09 Thread James Morris
On 9 February 2011 11:13, Tor Lillqvist wrote: > With the right tool there is no problem at all in finding such "true" > leaks. How does one gain this mysterious tool for Linux? I have used Valgrind but as mentioned by numerous souls at numerous times in the past, a suppressions file is needed

Re: gobject construction with parameter

2011-02-01 Thread James Morris
On 1 February 2011 00:39, James Morris wrote: > On 31 January 2011 13:32, Jannis Pohlmann wrote: > >>> Can anyone point me in the direction of code examples where the >>> construction of the g object requires a parameter so I can see how to >>> do it pl

Re: gobject construction with parameter

2011-01-31 Thread James Morris
On 31 January 2011 13:32, Jannis Pohlmann wrote: >> Can anyone point me in the direction of code examples where the >> construction of the g object requires a parameter so I can see how to >> do it please? - I can't make sense of the documentation. > > I usually do this by adding a construct or c

gobject construction with parameter

2011-01-31 Thread James Morris
Hi, I'm trying to modify some existing code which uses gobject so that the function to create a new object can take a parameter. The existing code is quite simple, and my modifications simplify it further so I don't want to spend a great deal of time messing about with Gobject things. Can anyone

Re: bug in Cairo or Gtk - peculiar behaviour on resizing or exposing window

2010-11-14 Thread James Morris
On 14 November 2010 12:40, N James Bridge wrote: > Thanks for input. I assume you did see the same error in drawing - some > areas inside the drawing come out solid black? Yes. > I will have to look up valgrind. All of this is a big learning exercise! Valgrind sometimes spots initialization err

Re: bug in Cairo or Gtk - peculiar behaviour on resizing or exposing window

2010-11-14 Thread James Morris
On 13 November 2010 22:18, N James Bridge wrote: > I am hoping someone will have the time to look at this. I have been > developing a gtk/cairo program to draw views of the Mandelbrot set. I > wanted to show how the usual iteration progressed for an arbitrary > starting point; it worked but occasi

Using RTL variants of GTK_STOCK_* icons

2010-11-09 Thread James Morris
Hi, Is it possible to use an RTL variant of a stock icon (in an LTR language, without breaking RTL languages)? ta james ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Shortcut for GtkEntry Icon?

2010-10-26 Thread James Morris
How can I make the icon for GtkEntry activiated by pressing enter/return within the entry itself? I can't switch focus to it using tab. Cheers, james. -- _ : http://jwm-art.net/ -audio/image/text/code ___ gtk-app-devel-list mailing list gtk-app-deve

moving message on a gtk dialog

2010-10-19 Thread James Morris
On 19 October 2010 11:01, Guruprasad Bhat wrote: > Hi all, > I was thinking of a application for showing moving message. In gtk is it > possible to do that? I want a small gtk dialog displaying moving message. > Can any one suggest in this regard. > *Regards,* > *  Guruprasad Bhat.* The simplest

Re: gtk filechooser dialog error

2010-10-01 Thread James Morris
On 1 October 2010 07:22, Nagaraja wrote: > Hi all, > > I supposed use  gtk_wdget_hide instead of gtk_widget_destroy in this > case,now it is working as expected. What about all the errors/warnings, have they gone, or do they still appear? Did the errors appear the first time the dialog was opened

scrolled window adjustment 'changed' signal question

2010-09-22 Thread James Morris
Hi, As from my previous email, I require the dimensions of the scrolled window. I decided to detect when they change (due to the top level window being resized) by using the 'changed' signal emitted by the hadjustment and vadjustment respectively. So I create two user functions one for when windo

Re: obtaining current viewport/scrolled window dimensions

2010-09-22 Thread James Morris
On 22 September 2010 23:49, James Morris wrote: > Hi, > > I have a GtkDrawingArea within a GtkViewport within a > GtkScrolledWindow. I need the viewport dimensions so I can center the > contents of the drawing area when the drawn contents are smaller than > the viewport/window

obtaining current viewport/scrolled window dimensions

2010-09-22 Thread James Morris
Hi, I have a GtkDrawingArea within a GtkViewport within a GtkScrolledWindow. I need the viewport dimensions so I can center the contents of the drawing area when the drawn contents are smaller than the viewport/window. There is a vague mention of "page_size" in the documentation for scrolled windo

Re: Performance issues of GDK deprecation in favour of Cairo

2010-08-18 Thread James Morris
On 18 August 2010 15:57, Stefan Kost wrote: > hi, > > On 17.08.2010 12:01, James Morris wrote: >> Hi, >> >> I see that some GDK drawing functions and graphics contexts have been >> deprecated in favour of using Cairo. >> >> Yesterday I spent a few

Re: Performance issues of GDK deprecation in favour of Cairo

2010-08-17 Thread James Morris
On 17 August 2010 11:23, Chris Vine wrote: > On Tue, 17 Aug 2010 10:01:43 +0100 > James Morris wrote: > >> I see that some GDK drawing functions and graphics contexts have been >> deprecated in favour of using Cairo. >> >> Yesterday I spent a few hours *remov

Performance issues of GDK deprecation in favour of Cairo

2010-08-17 Thread James Morris
Hi, I see that some GDK drawing functions and graphics contexts have been deprecated in favour of using Cairo. Yesterday I spent a few hours *removing* Cairo code from my fledgling GTK application and replacing it with gdk_draw_rectangle, gdk_gc_set_rgb_fg_color, and gdk_gc_set_function. I did th

Re: custom widgets - advice on where to start?

2010-07-07 Thread James Morris
> > /Staffan > > On Wed, 2010-07-07 at 13:05 +0100, James Morris wrote: >> Hi, >> >> I need to create some complex widgets for my program. The first of >> which is the main widget which will show static rectangles within >> which other rectangles appear and

custom widgets - advice on where to start?

2010-07-07 Thread James Morris
Hi, I need to create some complex widgets for my program. The first of which is the main widget which will show static rectangles within which other rectangles appear and disappear at musical rates (think fast electronic dance music rates). The static rectangles may overlap each other, but the oth

Re: 1-Bit Bitmap

2010-06-01 Thread James Morris
I recently wrote a window-placement-like algorithm for a 128x128 grid using bit manipulation. You might find some of the code useful for writing your own library code to do what you require. It does not have any functions to set individual bits in the array, but it does have a function to unset are

g_atomic_pointer*

2010-03-01 Thread James Morris
Hi, I need to use an atomic pointer for my app. The documentation for the glib atomic operations is not exactly helpful. Anyway, I wrote a test program: 8< /* atomic.c */ #include int main() { char* myptr = 0; char* str = "Hello"; g_atomic_pointer_set(&myptr, str); char*

stock buttons without labels

2010-02-16 Thread james morris
Is it possible to create a new stock button and it have no label? I only want media play, media previous, media pause, the labels just look naff for these sorts of obvious buttons. Cheers, James. ___ gtk-app-devel-list mailing list gtk-app-devel-list@g

Re: locale, gui vs command line question?

2010-02-02 Thread james morris
On 2/2/2010, "David Nečas" wrote: >On Mon, 1 Feb 2010, Freddie Unpenstein wrote: >> > On Sun, 31 Jan 2010, james morris wrote: >> >> Why is store/change/restore of locale bad? >> >> > There's nothing at all wrong with it in the context you &

Re: locale, gui vs command line question?

2010-02-02 Thread james morris
On 1/2/2010, "Freddie Unpenstein" wrote: >> There's nothing at all wrong with it in the context you specified >> -- i.e. you want to ensure that floating-point values written to >> and read from file always use '.' as the decimal separator. I do >> that in my app, gretl (also for reasons of port

Re: locale, gui vs command line question?

2010-01-31 Thread james morris
On 31/1/2010, "David Nečas" wrote: >> I've not had to deal with locales before, and I'm trying to understand >> what GTK does to the locale when it initializes so I can work around it >> and save data files as "C" locale. I've tried adding >> setlocale(LC_NUMERIC, "C") to the start of main, and

locale, gui vs command line question?

2010-01-31 Thread james morris
e when it initializes so I can work around it and save data files as "C" locale. I've tried adding setlocale(LC_NUMERIC, "C") to the start of main, and after calling gtk_init, but it seems to make no difference. Any help/pointers appreciated. James Morris. PS I asked this