Re: gtk3: FileChooser schema not found

2011-02-15 Thread Emmanuele Bassi
Requiring the schema for settings is the fundamental tenet of the GSettings
design. By not having the schema like in GConf you are trading a bit of
convenience for less safety; a lot of bugs in GConf-using applications were
due to missing schemas or wrong fallbacks for unset keys, so when I say
"convenience" I mean for casual use and not for real applications.

A schema in GSettings is the equivalent of the UI file for GtkBuilder; in
both cases an application cannot be expected to run correctly if missing.

If you wanted unspecified storage for state, I suggest storing a file under
XDG_CONFIG_HOME; you can use GKeyFile or JSON-GLib for the serialization
format.

Ciao,
Emmanuele.

(Sorry for the quote style: I'm using my phone)

On 14 Feb 2011 23:32, "Kevin DeKorte"  wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 02/14/2011 04:08 PM, Allin Cottrell wrote:
> On Sun, 13 Feb 2011, Allin Cottrell wrote:
>
>> I ...
To me that is probably the biggest disadvantage with using GSettings is
that the application will crash if settings can't be found. I would like
to see this behavior changed to be more like gconf where missing keys
are allowed to be missing.

Kevin



- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk1Zu4AACgkQ6w2kMH0L1dFfIgCfQaqAUGVbX8VAlNT4Lx8CJE7n
CeIAnissRATzC4984x82ggrxVTX2enHM
=NhdA
-END PGP SIGNATURE-

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


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 I am trying to adapt
> it to GtkDrawingArea as the parent_class.
>
> However, the button_press_event code is no longer activated within the
> custom widget now that it's a drawing area. How do I activate it?
>
> I know with an ordinary GtkDrawingArea if I want to add
> button-press-events to use gtk_add_events, but the code that uses the
> custom widget shouldn't need to do this and besides the widget needs
> to connect to it's own internal private implementation code anyway so
> gtk_add_events is obviously wrong.
>
> Can anyone provide some pointers please?

Yes James, just add the call to gtk_widget_add_events into the
yourwidget_init function.

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


OOP in C (A SIMPLE BUT EASY LIBRARY. NOT USEFUL FOR Professional APP)

2011-02-15 Thread Mike
HI, ALL.
I HAVE A FRIEND. HE WIRTES A OOP LIBRARY FOR C, LOOKS NICE AND LIKE CPP
(USEFUL FOR SIMPLE APP. Lack of FUNCTIONAL FOR Professional APP).

URL (RAR FORMAT): http://code.google.com/p/ooc-gcc/downloads/list

IF YOU CAN READ CHINESE (OR USE TRANSLATOR SUCH AS GOOGLE TRANSLATOR),
YOU CAN VISIT THIS PAGE: http://pingf.is-programmer.com/posts/24088.html

SORRY FOR MY POOR ENGLISH.
IF YOU DON'T LIKE IT, PLEASE REPORT YOUR REASON TO GOOGLE CODE, MY
FRIEND WILL THANK YOU. :-)

BEST WISHES.
MIKE.

-- 
Mike.
Blog: http://www.ekd123.org/
Fedora Project Contributor.

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


enlarge the scrollable area

2011-02-15 Thread Stefano Facchini

Hi,

I'm trying to build a scrolled window in a such a way that the child 
widget has always the same size, regardless of the size of the scrolled 
window itself. I tried gtk_scrolled_window_set_min_content_width, but 
this also sets the minimum size of the scrolled window. Basically, I 
need something to force the size of the child widget (for example a 
TextView), or to enlarge the scrollable area without enlarging the 
scrolled window. Is it possible to have this behavior?


thank you!

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


Re: enlarge the scrollable area

2011-02-15 Thread Tristan Van Berkom
On Wed, Feb 16, 2011 at 1:49 AM, Stefano Facchini
 wrote:
> Hi,
>
> I'm trying to build a scrolled window in a such a way that the child widget
> has always the same size, regardless of the size of the scrolled window
> itself. I tried gtk_scrolled_window_set_min_content_width, but this also
> sets the minimum size of the scrolled window. Basically, I need something to
> force the size of the child widget (for example a TextView), or to enlarge
> the scrollable area without enlarging the scrolled window. Is it possible to
> have this behavior?

Sounds like you should be able to get away with just
gtk_widget_set_size_request()
on the child textview, that should ensure the child text view always
receives at least
the size you set for it's minimum request without restricting the size
of the parent
scrolled window.

Note: In GTK+ 2.x setting the size request of the child widget was acting like
gtk_scrolled_window_set_min_content_width/height() as a sort of implied hidden
feature, in GTK+ 3.x you can choose to force the size of the scrolled window
by using the new api or just force the size of the child by using
gtk_widget_set_size_request().

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: gtk3: FileChooser schema not found

2011-02-15 Thread Allin Cottrell
On Tue, 15 Feb 2011, Emmanuele Bassi wrote:

> Requiring the schema for settings is the fundamental tenet of the GSettings
> design. By not having the schema like in GConf you are trading a bit of
> convenience for less safety...
>
> A schema in GSettings is the equivalent of the UI file for GtkBuilder; in
> both cases an application cannot be expected to run correctly if missing.

If a UI file is missing, I agree, it's all over. No point in
showing a blank window. But a file selector can surely have
reasonable default behavior; it did in gtk2.

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


Re: enlarge the scrollable area

2011-02-15 Thread Stefano Facchini

Il 15/02/2011 18:55, Tristan Van Berkom ha scritto:

On Wed, Feb 16, 2011 at 1:49 AM, Stefano Facchini
  wrote:

Hi,

I'm trying to build a scrolled window in a such a way that the child widget
has always the same size, regardless of the size of the scrolled window
itself. I tried gtk_scrolled_window_set_min_content_width, but this also
sets the minimum size of the scrolled window. Basically, I need something to
force the size of the child widget (for example a TextView), or to enlarge
the scrollable area without enlarging the scrolled window. Is it possible to
have this behavior?

Sounds like you should be able to get away with just
gtk_widget_set_size_request()
on the child textview, that should ensure the child text view always
receives at least
the size you set for it's minimum request without restricting the size
of the parent
scrolled window.

Note: In GTK+ 2.x setting the size request of the child widget was acting like
gtk_scrolled_window_set_min_content_width/height() as a sort of implied hidden
feature, in GTK+ 3.x you can choose to force the size of the scrolled window
by using the new api or just force the size of the child by using
gtk_widget_set_size_request().

Cheers,
   -Tristan


Thanks for your answer, but I can't obtain what I need. Is the following 
code what you meant?


  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  textview = gtk_text_view_new ();

  gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);

  gtk_container_add (GTK_CONTAINER (window), scrolled_window);
  gtk_container_add (GTK_CONTAINER (scrolled_window), textview);

  gtk_widget_set_size_request (textview, 600, -1);

I had the the following results:
gtk2: the window has a minimum width of 600 pixel
gtk3: the window is 400x300, and so is the textview!

I just want a 400x300 window with a 600x300 textview (or any other 
widget, this is just an example) inside the scrollable.


cheers
Stefano

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


interested in gtk+ project development

2011-02-15 Thread Patrick Noble
Hey All,
My names Patrick Noble, and was hoping for a few pointers... I am interested
in learning about and helping out in a development project such as Glade or
GTK+, and was wondering if my experience level makes this pointless. I am
currently learning through C, and am fairly confident in its main structure
and common built in functions. I also have experience working with the gooey
GUI builder of glade, although I have almost no knowledge of GTK+
programming. Any advice as far as skills I should look into or places I
could help out?

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


Re: interested in gtk+ project development

2011-02-15 Thread Andrew Cowie
On Tue, 2011-02-15 at 20:47 -0800, Patrick Noble wrote:
> My names Patrick Noble, and was hoping for a few pointers... I am interested
> in learning about and helping out in a development project 

The best thing to do is get involved in a project that _uses_ GTK. Pick
something on the GNOME desktop that you like and have a good poke around
inside it to see how it does business. Evince, the PDF viewer, has a
good reputation. I'm sure others can suggest different apps worthy of
study.

Concurrently, start working on something *small* that uses GTK so you
get a good feel, over time, for what it's like to use the library and
its API. After a while you'll start to get a sense of things.

Finally, you can certainly subscribe to the other GTK lists (and if
you're really brave, to the gtk+ bugzilla traffic) and start seeing how
development happens.

The biggest thing, though, is that you don't have to learn it all by
yourself. Studying (and, more to the point, working on) existing code
bases (such as the Evince example earlier) will help you learn about how
to pull larger applications together. No one teaches that part in
school.

Enjoy,

AfC
Sydney

-- 
Andrew Frederick Cowie

Operational Dynamics is an operations and engineering consultancy
focusing on IT strategy, organizational architecture, systems
review, and effective procedures for change management: enabling
successful deployment of mission critical information technology in
enterprises, worldwide.

http://www.operationaldynamics.com/

Sydney   New York   Toronto   London
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: interested in gtk+ project development

2011-02-15 Thread Tristan Van Berkom
On Wed, Feb 16, 2011 at 1:47 PM, Patrick Noble  wrote:
> Hey All,
> My names Patrick Noble, and was hoping for a few pointers... I am interested
> in learning about and helping out in a development project such as Glade or
> GTK+, and was wondering if my experience level makes this pointless. I am
> currently learning through C, and am fairly confident in its main structure
> and common built in functions. I also have experience working with the gooey
> GUI builder of glade, although I have almost no knowledge of GTK+
> programming. Any advice as far as skills I should look into or places I
> could help out?

We are always short of hackers for Glade, I wont be around for the
following couple of days but if you want to contribute to Glade I will be
pleased and happy to coach you and help you to learn about GTK+/GObject
and the Glade code base.

The best thing would be for you to hang out on the #glade3 irc channel,
and it wouldn't hurt to lurk around on #gtk+ too at least to observe and
learn.

Thanks for taking an interest, if you're interested in hacking on Glade
please do come and hang out on irc for starters (and... try building
Glade git master with GTK+ 3.0).

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