Solved: How to make a gtktreeview column flexible?

2008-04-26 Thread Till Harbaum / Lists
Hi,

in have solved this problem. Here's the answer for reference:

Instead of using gtk_tree_view_insert_column_with_attributes to insert
a column, one might use seperate calls to  
gtk_tree_view_column_new_with_attributes
and gtk_tree_view_insert_column as this give us an explicit reference to
the column. Thus one can use gtk_tree_view_column_set_expand(TRUE)
on that column and voila ... the column scales nicely with the window width.

Till

Am Freitag 25 April 2008 schrieb Till Harbaum / Lists:
> Hi,
> 
> i have a gtktreeview filling the complete width of a window. Now i want the 
> view to always use the full width. I therefore want the middle column (a text
> column) to be flexible. I want it to be as wide as possible for any given 
> window
> width. So if you make the window wider i want this column to become wider.
> 
> If i just enable ellipsis in the columns text renderer the column gets very 
> small and only a fraction of the window width is used. If i make it a fixed 
> width it's exactly that: fixed width.
> 
> How do i make the column always use a much space as possible but never
> more than available?
> 
> Till
> ___
> 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: Learning Glade

2008-04-26 Thread Patrick Braga
Well, I can figure out how to use Glade, but after I have a .glade file,
how do I use it in my program?

On Sat, 2008-04-26 at 17:17 +0800, Alvis Koon wrote:
> Hi,
> 
> glade by itself is quite self-explanatory.
> Try glade2, even easier.
> 
> Just begin with vbox and hbox and put widgets there, then you will get
> the layout you want.
> 
> Yours faithfully,
> 
> Alvis Koon
> 
> On 26/04/2008, Patrick Braga <[EMAIL PROTECTED]> wrote:
> > Hi, I'm a relative newcomer to GTK+ programming, but I've been using
> >  GNU/Linux for about a year and a half, know it pretty well, and am
> >  enjoying writing applications for it.
> >
> >  However, I feel it will be easier for me to write graphical applications
> >  with an interface designer. The GNOME Library
> >  (http://library.gnome.org/ ) wasn't very useful and I haven't been able
> >  to find any decent, up-to-date tutorials on Glade.
> >
> >  Links and/or sample code will be appreciated :)
> >
> >  ~The Unix Geek
> >  http://theunixgeek.blogspot.com/
> >
> >
> >  ___
> >  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: Solved: How to make a gtktreeview column flexible?

2008-04-26 Thread Thomas Dybdahl Ahle
Interesting, and that make the text eclipse correctly as well?

On Sat, 2008-04-26 at 11:16 +0100, Till Harbaum / Lists wrote:
> Hi,
> 
> in have solved this problem. Here's the answer for reference:
> 
> Instead of using gtk_tree_view_insert_column_with_attributes to insert
> a column, one might use seperate calls to  
> gtk_tree_view_column_new_with_attributes
> and gtk_tree_view_insert_column as this give us an explicit reference to
> the column. Thus one can use gtk_tree_view_column_set_expand(TRUE)
> on that column and voila ... the column scales nicely with the window width.
> 
> Till
> 
> Am Freitag 25 April 2008 schrieb Till Harbaum / Lists:
> > Hi,
> > 
> > i have a gtktreeview filling the complete width of a window. Now i want the 
> > view to always use the full width. I therefore want the middle column (a 
> > text
> > column) to be flexible. I want it to be as wide as possible for any given 
> > window
> > width. So if you make the window wider i want this column to become wider.
> > 
> > If i just enable ellipsis in the columns text renderer the column gets very 
> > small and only a fraction of the window width is used. If i make it a fixed 
> > width it's exactly that: fixed width.
> > 
> > How do i make the column always use a much space as possible but never
> > more than available?
> > 
> > Till
> > ___
> > 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
-- 
Best Regards,
Med Venlig Hilsen,
Thomas

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


Re: Solved: How to make a gtktreeview column flexible?

2008-04-26 Thread Till Harbaum / Lists
Am Samstag 26 April 2008 schrieb Thomas Dybdahl Ahle:
> Interesting, and that make the text eclipse correctly as well?
You have to enable ellipsize seperately of course, but then yes, once 
the window is not wide enough the text in the "flexible" column is being
ellipsized nicely.

Till

> 
> On Sat, 2008-04-26 at 11:16 +0100, Till Harbaum / Lists wrote:
> > Hi,
> > 
> > in have solved this problem. Here's the answer for reference:
> > 
> > Instead of using gtk_tree_view_insert_column_with_attributes to insert
> > a column, one might use seperate calls to  
> > gtk_tree_view_column_new_with_attributes
> > and gtk_tree_view_insert_column as this give us an explicit reference to
> > the column. Thus one can use gtk_tree_view_column_set_expand(TRUE)
> > on that column and voila ... the column scales nicely with the window width.
> > 
> > Till
> > 
> > Am Freitag 25 April 2008 schrieb Till Harbaum / Lists:
> > > Hi,
> > > 
> > > i have a gtktreeview filling the complete width of a window. Now i want 
> > > the 
> > > view to always use the full width. I therefore want the middle column (a 
> > > text
> > > column) to be flexible. I want it to be as wide as possible for any given 
> > > window
> > > width. So if you make the window wider i want this column to become wider.
> > > 
> > > If i just enable ellipsis in the columns text renderer the column gets 
> > > very 
> > > small and only a fraction of the window width is used. If i make it a 
> > > fixed 
> > > width it's exactly that: fixed width.
> > > 
> > > How do i make the column always use a much space as possible but never
> > > more than available?
> > > 
> > > Till
> > > ___
> > > 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


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


Re: Learning Glade

2008-04-26 Thread Tristan Van Berkom
On Sat, Apr 26, 2008 at 7:47 AM, Patrick Braga
<[EMAIL PROTECTED]> wrote:
[...]
>  > On 26/04/2008, Patrick Braga <[EMAIL PROTECTED]> wrote:
>  > > Hi, I'm a relative newcomer to GTK+ programming, but I've been using
>  > >  GNU/Linux for about a year and a half, know it pretty well, and am
>  > >  enjoying writing applications for it.
>  > >
>  > >  However, I feel it will be easier for me to write graphical applications
>  > >  with an interface designer. The GNOME Library
>  > >  (http://library.gnome.org/ ) wasn't very useful and I haven't been able
>  > >  to find any decent, up-to-date tutorials on Glade.

this came up as google's third hit for "libglade":
   http://library.gnome.org/devel/libglade/unstable/

The first chapter "libglade programming basics" displays the 3 or so lines
of code it takes you to load a libglade interface, plus you have the refference
manual that follows.

The GtkBuilder manual, first hit on google for "gtkbuilder":
http://library.gnome.org/devel/gtk/2.12/GtkBuilder.html

doesnt include a code example but its used in the same basic
way as libglade was used.

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


Re: Learning Glade

2008-04-26 Thread Patrick Braga
Thanks - the code included in those docs seem helpful. I'll try them
out.

On Sat, 2008-04-26 at 09:51 -0300, Tristan Van Berkom wrote:
> On Sat, Apr 26, 2008 at 7:47 AM, Patrick Braga
> <[EMAIL PROTECTED]> wrote:
> [...]
> >  > On 26/04/2008, Patrick Braga <[EMAIL PROTECTED]> wrote:
> >  > > Hi, I'm a relative newcomer to GTK+ programming, but I've been using
> >  > >  GNU/Linux for about a year and a half, know it pretty well, and am
> >  > >  enjoying writing applications for it.
> >  > >
> >  > >  However, I feel it will be easier for me to write graphical 
> > applications
> >  > >  with an interface designer. The GNOME Library
> >  > >  (http://library.gnome.org/ ) wasn't very useful and I haven't been 
> > able
> >  > >  to find any decent, up-to-date tutorials on Glade.
> 
> this came up as google's third hit for "libglade":
>http://library.gnome.org/devel/libglade/unstable/
> 
> The first chapter "libglade programming basics" displays the 3 or so lines
> of code it takes you to load a libglade interface, plus you have the 
> refference
> manual that follows.
> 
> The GtkBuilder manual, first hit on google for "gtkbuilder":
> http://library.gnome.org/devel/gtk/2.12/GtkBuilder.html
> 
> doesnt include a code example but its used in the same basic
> way as libglade was used.
> 
> Cheers,
> -Tristan

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


Re: Solved: How to make a gtktreeview column flexible?

2008-04-26 Thread Thomas Dybdahl Ahle

On Sat, 2008-04-26 at 12:16 +0100, Till Harbaum / Lists wrote:
> Am Samstag 26 April 2008 schrieb Thomas Dybdahl Ahle:
> > Interesting, and that make the text eclipse correctly as well?
> You have to enable ellipsize seperately of course, but then yes, once 
> the window is not wide enough the text in the "flexible" column is being
> ellipsized nicely.

And the trick was setting expand(True). Interesting. In my code I use a
listener on the size-request signal, to change the fixed width of the
column.

> Till
> 
> > 
> > On Sat, 2008-04-26 at 11:16 +0100, Till Harbaum / Lists wrote:
> > > Hi,
> > > 
> > > in have solved this problem. Here's the answer for reference:
> > > 
> > > Instead of using gtk_tree_view_insert_column_with_attributes to insert
> > > a column, one might use seperate calls to  
> > > gtk_tree_view_column_new_with_attributes
> > > and gtk_tree_view_insert_column as this give us an explicit reference to
> > > the column. Thus one can use gtk_tree_view_column_set_expand(TRUE)
> > > on that column and voila ... the column scales nicely with the window 
> > > width.
> > > 
> > > Till
> > > 
> > > Am Freitag 25 April 2008 schrieb Till Harbaum / Lists:
> > > > Hi,
> > > > 
> > > > i have a gtktreeview filling the complete width of a window. Now i want 
> > > > the 
> > > > view to always use the full width. I therefore want the middle column 
> > > > (a text
> > > > column) to be flexible. I want it to be as wide as possible for any 
> > > > given window
> > > > width. So if you make the window wider i want this column to become 
> > > > wider.
> > > > 
> > > > If i just enable ellipsis in the columns text renderer the column gets 
> > > > very 
> > > > small and only a fraction of the window width is used. If i make it a 
> > > > fixed 
> > > > width it's exactly that: fixed width.
> > > > 
> > > > How do i make the column always use a much space as possible but never
> > > > more than available?
> > > > 
> > > > Till
> > > > ___
> > > > 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
> 
> 
-- 
Best Regards,
Med Venlig Hilsen,
Thomas

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


Re: Learning Glade

2008-04-26 Thread Carlos Pereira

> However, I feel it will be easier for me to write graphical applications
> with an interface designer. The GNOME Library
> (http://library.gnome.org/ ) wasn't very useful and I haven't been able
> to find any decent, up-to-date tutorials on Glade.
>   
GTK Forums have several examples with C and Glade:
http://www.gtkforums.com/forum-15.html

Carlos
> Links and/or sample code will be appreciated :)
>
> ~The Unix Geek
> http://theunixgeek.blogspot.com/
>
>   

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


Re: setting the font of a dialog widget

2008-04-26 Thread Garth's KidStuff
Hey there,

I just now got back to this problem.  Maybe I'm misunderstanding something,
but it seems that the solution you recommend is solely a solution for
Gtk::Labels -- not for general widgets.  I can change the font size for
labels -- but not for other widgets (e.g. CheckButton, RadioButton.).
That's my issue.

To recap:  How do I change the font size of a general widget?

Thanks in advance.

2008/4/18 Garth's KidStuff <[EMAIL PROTECTED]>:
>  that's not relevant).  If the widget I'm trying to set happens to be a
>  Gtk::Label, then it works.  But other widgets (e.g. Gtk::Frame or
>  Gtk::Checkbutton) don't and just seem to use their default font no matter
>  what.  For example:

I do this with gtk_label_set_markup(). For example:

 gtk_label_set_markup (GTK_LABEL (label), "hello");

> // Add the fixed widget to the dialog and size it properly
> get_vbox()->add(m_Fixed);
> m_Fixed.set_size_request( 566, 500 );

Fixed size widgets should be avoided if you possibly can, I'm sure you
know this. gtk has a lot of layout widgets you can use to make
resizeable dialogs.

John


-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list