Re: [n00b] what's a smooth_draw_box?

2007-12-17 Thread Daniel Fetchinson
> > I've just started with GTK and been going through the tutorial and
> > examples. My first small application is working all right but the
> > following (I guess) warning keeps being written to the console:
> >
> > CRITICAL **: smooth_draw_box: assertion `width >= -1'
>
> This looks like a message from the gtk theme engine 'smooth'.  Probably
> harmless...

I indeed use the 'smooth' theme engine. Is there any way to make such
messages go away?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [n00b] what's a smooth_draw_box?

2007-12-17 Thread Brian J. Tarricone
On Mon, 17 Dec 2007 18:30:57 -0800 Daniel Fetchinson wrote:

> Hi list,
> 
> I've just started with GTK and been going through the tutorial and
> examples. My first small application is working all right but the
> following (I guess) warning keeps being written to the console:
> 
> CRITICAL **: smooth_draw_box: assertion `width >= -1'

This looks like a message from the gtk theme engine 'smooth'.  Probably
harmless...

> What I believe is the relevant part of my code:
> 
> window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
> gtk_container_set_border_width( GTK_CONTAINER( window ), 50 );
> gtk_widget_show( window );
> scale = gtk_hscale_new( GTK_ADJUSTMENT( adjustment ) );
> gtk_widget_set_size_request( GTK_WIDGET( scale ), 350, 40 );
> gtk_container_add( GTK_CONTAINER( window ), scale );
> gtk_widget_show( scale );
> gtk_main(  );

... unless you're doing something very very odd somewhere else.

-brian

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


[n00b] what's a smooth_draw_box?

2007-12-17 Thread Daniel Fetchinson
Hi list,

I've just started with GTK and been going through the tutorial and
examples. My first small application is working all right but the
following (I guess) warning keeps being written to the console:

CRITICAL **: smooth_draw_box: assertion `width >= -1'

and strangely enough Google doesn't return any pages for the queries

http://www.google.com/search?q=smooth_draw_box+site%3Agtk.org
http://www.google.com/search?q=smooth_draw_box+site%3Alibrary.gnome.org

What I believe is the relevant part of my code:

window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_container_set_border_width( GTK_CONTAINER( window ), 50 );
gtk_widget_show( window );
scale = gtk_hscale_new( GTK_ADJUSTMENT( adjustment ) );
gtk_widget_set_size_request( GTK_WIDGET( scale ), 350, 40 );
gtk_container_add( GTK_CONTAINER( window ), scale );
gtk_widget_show( scale );
gtk_main(  );


All I want to have in my top level window is a scale widget. What's wrong?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Application with plugins

2007-12-17 Thread Jordan Walsh
I use gmodule in Glib to load my modules. Every plugin must have an init()
function that is called when the module loads. In the init function the
plugin can use application interfaces to "hook" itself onto pre-defined
application functions, or create their own to hook into. It is much simpler
than a Gobject based system and works nicely.



On 11/29/07, Matí­as Alejandro Torres <[EMAIL PROTECTED]> wrote:
>
> Micah Carrick escribió:
> > You may want to take a look at how Gedit created a GObject-based plugin
> > system.
> >
> > - Micah Carrick
> >
> Or the Pidgin plugin system.
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Jordan Walsh
(910) 639-0111
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: App blueprint, advice please!

2007-12-17 Thread Dan H
On Mon, 17 Dec 2007 08:52:11 -0500
Patrick <[EMAIL PROTECTED]> wrote:

> So as Dan was saying, I can launch other programs written in other 
> languages from system() function calls. So I could link lots of
> them together regardless of language they are written in and if I
> really needed to I could still access Bash commands like ssh,
> netcat right?

Those aren't "bash commands" -- they are other programs! All those things that 
you seem to think of as part of bash (cp, ls, rm, ftp, ssh, nc, tar, sed, gzip 
etc.) are in fact all external programs. The difference between "shell" 
languages and other languages is that shells typically interpret all commands 
as external programs to be started, with the exception of the few truly builtin 
commands (see the section BUILTIN COMMANDS) in the bash man page.

So to start another program from bash, just write it on a single line.

To start another program from C or Perl, just wrap it into a system() function 
call.

Ruby and Python will have similar functions, but I don't know them.

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


Re: App blueprint, advice please!

2007-12-17 Thread Patrick
Thanks to Dan and John for your last posts and thanks to all. I am 
really delighted with the response to my question!

So it looks like the I could use Bash to spawn other programs but it is 
likely problematic and no one actually recommends it as a first option.

So as Dan was saying, I can launch other programs written in other 
languages from system() function calls. So I could link lots of them 
together regardless of language they are written in and if I really 
needed to I could still access Bash commands like ssh, netcat right?

I think both Python and Ruby can be extended with C without using a 
system call.

Is there anything wrong with calling them from system calls instead?

Thanks again Göran! I read up on Ruby last night for a couple of hours. 
I am sure I can pick this up.

Python is the only language I can actually work at a reasonable pace in. 
I am just learning C.

Is there a reason you chose Ruby over Python? If I am already using 
Python, do you think I need to switch languages to achieve my goal?

And thanks for the tip, I want to sell code not software!

I am going to save this entire thread somewhere safe. I hope one day I 
can compensate or somehow return the favor to all involved.

THANKS!!!-Patrick







>
>

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


Re: Is it possible to show a image in the notebook tab label place?

2007-12-17 Thread Damien Caliste
Hello,

Le 17/12/2007, Binary Chen <[EMAIL PROTECTED]> a écrit :
> I want to show a picture in the notebook tab label place, instead just
> show a plain text, how can I do this?
The tab label is not limited to GtkLabel. You can put whatever widget
you want (an image, a button...), see:
http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html#gtk-notebook-append-page

Example of code:
GtkWidget *notebook, *hbox, *label, *image;

  hbox = gtk_hbox_new(FALSE, 0);
  label = gtk_label_new("Pouet");
  gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  image = gtk_image_new_from_stock(GTK_STOCK_CLOSE,
   GTK_ICON_SIZE_MENU);
  gtk_box_pack_end(GTK_BOX(hbox), image, FALSE, FALSE, 2);
  gtk_widget_show_all(hbox);

  notebook = gtk_notebook_new();
  gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
   child, hbox);

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

Re: Can I make a not aligned gtk treeview?

2007-12-17 Thread Binary Chen
Hi Michael,

Finally I solved the problem by this way!

Thanks.
Bin

On Mon, 2007-12-17 at 11:44 +0100, Mikael Hallendal wrote:
> 17 dec 2007 kl. 08.29 skrev Binary Chen:
> 
> Hi,
> 
> A TreeView will always align the columns. However, to achieve the  
> behavior you look for you can pack two cell renderers into the same  
> column.
> 
> Cheers,
>Mikael Hallendal
> 
> > Hi,
> >
> > I have a gtktreeview with two column, the first one is pixbuf, the
> > second one is a string. something happen bad if in a row the first
> > pixbuf is NULL, so it doesn't occupy any place, but in the following  
> > row
> > there is a pixbuf and occupy some place. the default behavior of
> > gtktreeview will align the second column so leave a large blank in  
> > first
> > row.
> >
> > How can I tell treeview not align in different row, but just place the
> > column independently?
> >
> > Thanks.
> > Bin
> >
> > ___
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 

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


Reparsing with GtkBuilder

2007-12-17 Thread amol
Hi
If i used gtk_builder_add_from_string to parse some string for builder
which already has some content then application terminates  with
following message
>Gtk-ERROR **: file gtkbuilder.c: line 567
(apply_delayed_properties): assertion failed: (object != NULL)
if builder had already set some delayed property.

If builder had not set any delayed property previously then it does not
crashes while reparsing with add_string.

Is this bug in Gtk+?

Delayed properties are applied in parser finished.
If we parse any buffer again with same builder then it tries to set the
delayed properties again which are irrelevant.
setting builder->delayed_properties to NULL in parser_finished solves
above problem but is this a right solution or it has any other side
effects?
If new buffer has any delayed properties associated with objects then
builder->delayed_properties will set again and that properties will be
applied in parser_finished.

Regards
Amol




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


Re: Can I make a not aligned gtk treeview?

2007-12-17 Thread Mikael Hallendal
17 dec 2007 kl. 08.29 skrev Binary Chen:

Hi,

A TreeView will always align the columns. However, to achieve the  
behavior you look for you can pack two cell renderers into the same  
column.

Cheers,
   Mikael Hallendal

> Hi,
>
> I have a gtktreeview with two column, the first one is pixbuf, the
> second one is a string. something happen bad if in a row the first
> pixbuf is NULL, so it doesn't occupy any place, but in the following  
> row
> there is a pixbuf and occupy some place. the default behavior of
> gtktreeview will align the second column so leave a large blank in  
> first
> row.
>
> How can I tell treeview not align in different row, but just place the
> column independently?
>
> Thanks.
> Bin
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: App blueprint, advice please!

2007-12-17 Thread jcupitt
On Dec 16, 2007 9:21 PM, Patrick <[EMAIL PROTECTED]> wrote:
> I don't need much convincing that the
> whole Bash as a nervous system + (Python/C/Ruby etc) as the muscle is a
> dumb idea!

I did something slightly similar (quite) a few years ago to control a
large painting scanner. The program had to control a large robot, a
lighting and filter system and a camera, be easy to modify and be
usable by non-experts.

I did a simple GUI in C++/Motif (shows how long ago this was) with
large buttons for "Start Scan" and so on. Each button launched a bash
script, and each bash script used a set of low-level programs written
in C to drive different parts of the hardware.

It worked reasonably well. As I recall, the issues with the design were:

1) difficulties transferring data between the GUI and bash at script
start and stop time
2) bash's lack of complex data structures and arithmetic
3) progress feedback from a running bash script was ugly
4) cancelling a running script (and leaving the hardware in a sane
state) was ugly
5) performance ... was fine, actually, but I can imagine applications
where it might not be

If I had to do it again I think I'd do the whole thing in Python
(except the very low-level hardware control). It ought to fix these
problems.

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


Re: GtkTreeView: how to reduce size of cell

2007-12-17 Thread Abirami.T
hi,

The padding space can be reduced by setting the style parameter 
"vertical-separator" through rc file.
The height of the cell renderer can also be set to a lesser value using 
the "height" style property.

Regards,
Abirami.

- Original Message - 
From: "Romain Liévin" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, December 15, 2007 4:33 PM
Subject: GtkTreeView: how to reduce size of cell


> Hi,
>
> I'm working on a debugger
> (http://www.lievin.net/downloads/lpg/vti_dock.png). As you can see,
> there is a lot of space between each line of the left upper frame.
>
> How can I decrease space between lines or value of padding in cell?
>
> I did not find any useful function in the GTK API which could do my job...
>
> Romain.
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list 


The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments contained in it.

Contact your Administrator for further information.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: App blueprint, advice please!

2007-12-17 Thread Dan H
On Sun, 16 Dec 2007 16:21:02 -0500
Patrick <[EMAIL PROTECTED]> wrote:

> I have wanted to learn Ruby for a while now, I could definitely do
> that. Nicola was saying that my Bash idea might be a problem
> because of the spawn time involved with bash.

Whether you can or cannot live with certain "spawn" delays of course depends 
only on how frequent those spawns occur.

> Is Ruby pretty fast
> spawning these secondary programs?
> 
> Is the Ruby shell a true system shell? I am just wondering if I
> could still access ftp, netcat, ssh ect..

You can call external programs without hassle from any compiled or interpreted 
language I'm aware of with a single system() function call. So there's no need 
to contrive some artificial division between "system shell", "interpreted 
language" or "script".

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