Re: Creating an aggregating GtkContainer

2009-11-19 Thread Murray Cumming
On Wed, 2009-11-18 at 19:35 +0100, Per Hermansson wrote:
 Hi everyone
 
 I'm contributing to a project called the Common Printing Dialog
 which goal is to create the next generation print dialog for Gnome.
 The dialog allows users to customize different options which depends
 on the current printer being selected.
 
 What I'm struggling to implement is a GtkContainer which sort of aggregates
 or combines multiple sub-containers. So that when adding new widgets
 each sub-container is filled until no more space is available then the 
 next sub-container
 is filled. A picture of how this should look like is available here:
 http://wiki.openusability.org/printing/index.php/Image:Level3.5_1200.png

This is what I call a flowing columned container: Widgets are moved into
the next column if the current column is full, like text in newspaper
columns. You can see the result here, for instance:
http://www.glom.org/screenshots/glom_example_filmmanager.png
In that screenshot the widgets are divided between the two columns at
runtime.

I have a custom FlowTable container
http://git.gnome.org/cgit/glom/tree/glom/utility_widgets/flowtable.cc
to do this in Glom, but 
a) It's C++, using gtkmm
b) The size/positioning code is horrible and inefficient.
c) It's hacky. This can't be done properly until we have
height-for-width layout in GTK+:
https://bugzilla.gnome.org/show_bug.cgi?id=101968 


-- 
murr...@murrayc.com
www.murrayc.com
www.openismus.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Images + labels in buttons

2009-11-19 Thread John Stebbins
In previous versions of gnome/gtk, both images and labels appeared in 
buttons.  Starting with gnome 2.28, if there is a label, the image will 
only appear if the gconf property 
desktop/gnome/interface/buttons_have_icons is True.  In my application, 
the image on some buttons is an important clue to the function of the 
button.  Is there any way to force the image to be displayed regardless 
of the setting of buttons_have_icons?


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Capture console app output into texview?

2009-11-19 Thread Till Harbaum / Lists
Hi,

i am trying to run a text mode application in the background of my gtk one and 
display its output in a textview. I know this is supposed to be done using 
g_spawn_async_with_pipes and then link to the output via g_io_add_watch. I even 
got something that sort of works, but the output is very much delayed and comes 
in chunks and worse, the CPU load is at max while and after i run my code.

Are there any examples for doing this? There must be many programs doing 
something similar to run e.g. some little helper program or similar. 

Regards,
  Till
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: Capture console app output into texview?

2009-11-19 Thread Boggess Rod
 

 -Original Message-
 From: gtk-app-devel-list-boun...@gnome.org 
 [mailto:gtk-app-devel-list-boun...@gnome.org] On Behalf Of 
 Till Harbaum / Lists
 Sent: Thursday, November 19, 2009 4:11 PM
 To: gtk-app-devel-list@gnome.org
 Subject: Capture console app output into texview?
 
 Hi,
 
 i am trying to run a text mode application in the background 
 of my gtk one and display its output in a textview. I know 
 this is supposed to be done using g_spawn_async_with_pipes 
 and then link to the output via g_io_add_watch. I even got 
 something that sort of works, but the output is very much 
 delayed and comes in chunks and worse, the CPU load is at max 
 while and after i run my code.
 
 Are there any examples for doing this? There must be many 
 programs doing something similar to run e.g. some little 
 helper program or similar. 
 
 Regards,
   Till
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

Try using fork() and execlp().
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Images + labels in buttons

2009-11-19 Thread John Stebbins

On 11/19/2009 11:39 AM, John Stebbins wrote:
In previous versions of gnome/gtk, both images and labels appeared in 
buttons.  Starting with gnome 2.28, if there is a label, the image 
will only appear if the gconf property 
desktop/gnome/interface/buttons_have_icons is True.  In my 
application, the image on some buttons is an important clue to the 
function of the button.  Is there any way to force the image to be 
displayed regardless of the setting of buttons_have_icons?


If anyone cares, I found this in the GtkSettings documentation.  It 
forces button icons to be enabled:


g_type_class_unref(g_type_class_ref(GTK_TYPE_BUTTON));
g_object_set(gtk_settings_get_default(), gtk-button-images, TRUE, 
NULL);


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Capture console app output into texview?

2009-11-19 Thread Chris Vine
On Thu, 19 Nov 2009 22:11:18 +0100
Till Harbaum / Lists li...@harbaum.org wrote:
 Hi,
 
 i am trying to run a text mode application in the background of my
 gtk one and display its output in a textview. I know this is supposed
 to be done using g_spawn_async_with_pipes and then link to the output
 via g_io_add_watch. I even got something that sort of works, but the
 output is very much delayed and comes in chunks and worse, the CPU
 load is at max while and after i run my code.
 
 Are there any examples for doing this? There must be many programs
 doing something similar to run e.g. some little helper program or
 similar. 

You generally won't get away with forking after the gtk+ main loop is
running.  You should fork before the main loop is running, and if you
cannot do that start a new thread to fork from.

If you do the latter on a POSIX (unix-like) system you must only call
async-signal-safe functions between the fork and the exec*.  If you are
using windows, I do not know what the restraints are.

Chris


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list