* gtk: toolbar space style
@ 2001-04-04 5:50 David Pirotte
[not found] ` <986400337.1886.1.camel@soleil>
0 siblings, 1 reply; 7+ messages in thread
From: David Pirotte @ 2001-04-04 5:50 UTC (permalink / raw)
To: guile-gtk, guile-user
Hello,
can someone tell me if it is possible (and how) I can tell a
toolbar to set its space style to 'line
manythanks,
david
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gtk: toolbar space style
[not found] ` <986400337.1886.1.camel@soleil>
@ 2001-04-04 12:40 ` David Pirotte
[not found] ` <986428047.18191.5.camel@soleil>
2001-04-04 12:41 ` David Pirotte
1 sibling, 1 reply; 7+ messages in thread
From: David Pirotte @ 2001-04-04 12:40 UTC (permalink / raw)
To: Ariel Rios; +Cc: guile-gtk, guile-user
Ariel Rios wrote:
>
> (define-enum GtkToolBarSpaceStyle
> (empty GTK_TOOLBAR_SPACE_EMPTY)
> (line GTK_TOOLBAR_SPACE_LINE))
>
Thanks Ariel,
but don't you also need to add:
(define-func gtk_toolbar_set_space_style
none
((GtkToolbar toolbar)
(GtkToolBarSpaceStyle style))
)
or something like that: it's not in my gtk-1.2.defs file (I am
using guile-gtk-0.19)
can I just add these lines (including yours of course) and just recompile?
if not, where is the cvs site for guile-gtk ?
thanks again
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gtk: toolbar space style
[not found] ` <986400337.1886.1.camel@soleil>
2001-04-04 12:40 ` David Pirotte
@ 2001-04-04 12:41 ` David Pirotte
1 sibling, 0 replies; 7+ messages in thread
From: David Pirotte @ 2001-04-04 12:41 UTC (permalink / raw)
To: Ariel Rios; +Cc: guile-gtk, guile-user
Ariel Rios wrote:
>
> (define-enum GtkToolBarSpaceStyle
> (empty GTK_TOOLBAR_SPACE_EMPTY)
> (line GTK_TOOLBAR_SPACE_LINE))
>
Thanks Ariel,
but don't you also need to add:
(define-func gtk_toolbar_set_space_style
none
((GtkToolbar toolbar)
(GtkToolBarSpaceStyle style))
)
or something like that: it's not in my gtk-1.2.defs file (I am
using guile-gtk-0.19)
can I just add these lines (including yours of course) and just recompile?
if not, where is the cvs site for guile-gtk ?
thanks again
David
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gtk: toolbar space style
[not found] ` <986428047.18191.5.camel@soleil>
@ 2001-04-05 2:41 ` David Pirotte
2001-04-05 5:28 ` Announcing guile-gobject Martin Baulig
[not found] ` <986508739.1535.0.camel@soleil>
0 siblings, 2 replies; 7+ messages in thread
From: David Pirotte @ 2001-04-05 2:41 UTC (permalink / raw)
To: Ariel Rios; +Cc: guile-gtk, guile-user
Ariel Rios wrote:
> ...
> It is on the GNOME cvs.
> You can find info on http://developer.gnome.org/tools/cvs.html
> But basically you need to do:
> $export CVSROOT=':pserver:anonymous@anoncvs.gnome.org:/cvs/gnome'
> $cvs login
Ariel,
I did a checkout of both gnome-guile and guile-gtk, but I get the same
little problem when trying to compile:
david@faust:~/ftp/guile/gnome-guile/guile-gtk 27 $ sh ./autogen.sh
./autogen.sh: gnome-autogen.sh: no such file or directory
and
david@faust:~/ftp/guile/guile-gtk 30 $ sh ./autogen.sh
./autogen.sh: gnome-autogen.sh: o such file or directory
thanks,
david
PS: for info to who may help:
the 'Mixp library' (Guile (Projects List)) refers to a home page that
contains a damaged tar.gz file
^ permalink raw reply [flat|nested] 7+ messages in thread
* Announcing guile-gobject
2001-04-05 2:41 ` David Pirotte
@ 2001-04-05 5:28 ` Martin Baulig
2001-04-09 9:25 ` Marius Vollmer
[not found] ` <986508739.1535.0.camel@soleil>
1 sibling, 1 reply; 7+ messages in thread
From: Martin Baulig @ 2001-04-05 5:28 UTC (permalink / raw)
To: guile-gtk; +Cc: gnome-hackers
Hi guys,
about a week ago I started some little hacking project because I felt
like I must hack something to feel good.
The result of this hacking week is now in GNOME CVS in the `guile-gobject'
module, right in time before GUADEC ...
Unfortunately, I don't have much time to write what guile-gobject is and
how it is different from guile-gtk since I need to leave to GUADEC soon,
but maybe we can have some little BOF about it there.
It's basically a new set of scheme / guile bindings for GNOME 2.0 which is
based on gobject. The main difference to guile-gtk is that it is using goops
and g-wrap and that it's based on gobject.
Basically, with guile-gobject you don't need any C compiled glue code to
access arbitrary GObject's and other glib/gobject based types such as
GEnum and GFlags. This all works with very little C code, most of the stuff
is done in scheme.
The other big advantage of guile-gobject is that it's a two-way wrapper;
you cannot only access a GObject which is defined in some C library from
Guile, you can also write your own GObjects in Guile and access them from C.
This code is still very experimental and unfinished, I just hacked on it for
about a week or so.
Here's some example code:
====
(use-modules (gobject gobject) (oop goops))
;; Assuming your C code has a GObject `Foo' and there's
;; a C function foo_get_type ().
(define-class <foo> (<gobject>))
(define foo (make <foo>))
;; Assuming there's a GObject `Bar' and a scheme function
;; (bar-get-type) returning Bar's GType.
(define bar (make <gobject> #:type (bar-get-type)))
;; Derive `Bar', creating your own `SuperBar' GObject in scheme
(define super-bar-type (g-type-create-object (bar-get-type) 'SuperBar '()))
(define super-bar-class (g-object-class-from-type super-bar-type))
(define super-bar (make <gobject> #:type super-bar-type))
;; Assuming `Foo' has a boolean `foo property
(g-object-get-property foo 'foo)
(g-object-set-property foo 'foo #t)
;; Assuming `Foo' has a signal 'hello' which takes a boolean and a float
;; argument and returns a long
(define retval (g-object-signal-emit foo 'hello #t 3.45))
(display retval) (newline) ;; this will be a long
;; Now let's connect something to the 'hello' signal:
(g-object-signal-connect foo 'hello
(lambda (object a b)
(display (list "HELLO" object a b "END")) (newline)
305))
;; Add a new boolean `super' property to the `SuperBar' GObject
(g-object-class-install-property super-bar-class
(make <gparam-spec-wrapper> #:name 'super #:value-type g-type-boolean))
====
So all glue code that's needed is for C functions, but the whole object
management can be done directly in Scheme. The following isn't finished
yet, but basically it'll be possible to do something like this:
====
;; Assume you have a C function `void test_func (GObject *object)' and its
;; scheme wrapper, you can create your own GObject and pass it to this
;; function
(define super-bar-type (g-type-create-object g-type-object 'SuperBar '()))
(define super-bar-class (g-object-class-from-type super-bar-type))
(define super-bar-get-type (lambda () super-bar-type))
;; This will assume there is a `super-bar-get-type' function
(define-class <super-bar> (<gobject>))
;; You can also say
(define-class <super-bar> (<gobject>) #:type super-bar-type)
;; This create a new instance of `SuperBar'.
(define super-bar (make <super-bar>))
;; You can also use this without creating a class:
(define super-bar (make <gobject> #:type super-bar-type))
;; (test-func) takes a GObject, so let's pass it our `SuperBar':
(test-func super-bar)
====
For the C part, I also had a new and much simpler idea how to wrap a
GObject and how to do the reference counting.
For each GObject, there's a GObjectWrapper:
===
struct _GuileGObject {
int ref_count;
gboolean floating;
size_t size;
void (*finalize) (gpointer);
SCM scm_class;
};
struct _GObjectWrapper {
GuileGObject guile;
GObject *object;
};
===
This wrapper is created on-the-fly when a GObject is about to be passed to
Scheme code and it'll only stay around as long as it's needed:
* when a GObject is passed to Scheme code, a new GObjectWrapper object is
created and the GObject ref'ed.
* the GObjectWrapper is freeded during garbage collecting which will cause
the GObject to be unref'ed.
So when we create a new GObject, it'll be "owned" by its GObjectWrapper and
the unref during garbage collecting will cause it to be destroyed.
* when we call a C function from scheme which takes a GObject, we pass the
GObject itself to C and not its Scheme wrapper; the GObject doesn't know
anything about its GObjectWrapper so that the wrapper can safely be freed
during garbage collecting even if the GObject is still in use (since the C
code must ref the object anyways because it's owned by the caller).
This also works when we create our own GObjects in scheme:
* (g-type-create-object) basically calls g_type_register_static() to register
a new type for the derived object (with the same class and instance sizes
as its parent type) and uses g_type_set_qdata() to assign some per-class
data with the new type. It provides a custom class_init function for the new
type which will override the `get_property', `set_property' etc. functions.
--
Martin Baulig
martin@gnome.org (private)
baulig@suse.de (work)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gtk: toolbar space style
[not found] ` <986508739.1535.0.camel@soleil>
@ 2001-04-06 10:03 ` David Pirotte
0 siblings, 0 replies; 7+ messages in thread
From: David Pirotte @ 2001-04-06 10:03 UTC (permalink / raw)
To: Ariel Rios; +Cc: guile-gtk, guile-user
Sorry, I forgot to use the 'reply-all' so it was only sent to
Ariel ...
Ariel Rios wrote:
>
> On 05 Apr 2001 12:42:03 +0200, David Pirotte wrote:
>
> > Ariel,
> >
> > I did a checkout of both gnome-guile and guile-gtk, but I get the same
> > little problem when trying to compile:
> Ah! You need the gnome-common package from CVS or from ftp.gnome.org
Ariel,
I tried anything I could by myself, but no success:
- gnome-common does not contain the requested gnome-autogen.sh
but why should I do this anyway?
- I have the latest stable gnome lib already installed
- I do not want (at this stage) gnome-guile, but simply guile-gtk
[- even so, why gnome-guile module would not be 'complete' ?]
so why can't we expect to have the autogen.sh of the guile-gtk 'complete'
and 'independant' from gnome?
In the mean time, trying to compile with the additional stuff:
(copying your latest gtk-1.2.defs in guile-gtk-0.19 dir ...)
(and I added in guile-gtk.c)
static GtkType
sgtk_try_missing_type (char *name)
{
static sgtk_type_info missing[] = {
...
{ "GtkToolbarStyle", GTK_TYPE_ENUM },
{ "GtkToolBarSpaceStyle", GTK_TYPE_ENUM },
...
{NULL, GTK_TYPE_NONE}
};
but even doing a
make distclean (to be sure that gtk-glue.c is re-created)
./configure
make
it does not compile properly:
so please help me ...
david
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include
-I/usr/local/include
-I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include -g -O2 -c gtk-glue.c
rm -f .libs/gtk-glue.lo
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/local/include
-I/usr/local/lib/glib/include -I/usr/local/include
-I/usr/X11R6/include -g -O2 -c -fPIC -DPIC gtk-glue.c -o .libs/gtk-glue.lo
gtk-glue.c: In function `sgtk_gtk_style_light_gc':
gtk-glue.c:1080: warning: assignment makes pointer from integer without a cast
gtk-glue.c: In function `sgtk_gtk_style_dark_gc':
gtk-glue.c:1100: warning: assignment makes pointer from integer without a cast
gtk-glue.c: In function `sgtk_gtk_style_mid_gc':
gtk-glue.c:1120: warning: assignment makes pointer from integer without a cast
gtk-glue.c: In function `sgtk_gtk_style_text_gc':
gtk-glue.c:1140: warning: assignment makes pointer from integer without a cast
gtk-glue.c: In function `sgtk_gtk_style_base_gc':
gtk-glue.c:1160: warning: assignment makes pointer from integer without a cast
gtk-glue.c: In function `sgtk_gtk_widget_requisition_width':
gtk-glue.c:1604: `width' undeclared (first use in this function)
gtk-glue.c:1604: (Each undeclared identifier is reported only once
gtk-glue.c:1604: for each function it appears in.)
gtk-glue.c: In function `sgtk_gtk_widget_requisition_height':
gtk-glue.c:1621: `height' undeclared (first use in this function)
gtk-glue.c: In function `sgtk_gtk_widget_allocation_x':
gtk-glue.c:1638: `x' undeclared (first use in this function)
gtk-glue.c: In function `sgtk_gtk_widget_allocation_y':
gtk-glue.c:1655: `y' undeclared (first use in this function)
gtk-glue.c: In function `sgtk_gtk_widget_allocation_width':
gtk-glue.c:1672: `width' undeclared (first use in this function)
gtk-glue.c: In function `sgtk_gtk_widget_allocation_height':
gtk-glue.c:1689: `height' undeclared (first use in this function)
gtk-glue.c: In function `sgtk_gtk_toolbar_set_space_style':
gtk-glue.c:6280: `GtkToolBarSpaceStyle' undeclared (first use in this function)
gtk-glue.c:6280: parse error before `c_style'
gtk-glue.c:6282: `c_style' undeclared (first use in this function)
make: *** [gtk-glue.lo] Error 1
david@faust:/usr/local/src/guile/guile-gtk-0.19 16 $
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Announcing guile-gobject
2001-04-05 5:28 ` Announcing guile-gobject Martin Baulig
@ 2001-04-09 9:25 ` Marius Vollmer
0 siblings, 0 replies; 7+ messages in thread
From: Marius Vollmer @ 2001-04-09 9:25 UTC (permalink / raw)
To: Martin Baulig; +Cc: guile-gtk, gnome-hackers
Martin Baulig <martin@home-of-linux.org> writes:
> The result of this hacking week is now in GNOME CVS in the
> `guile-gobject' module, right in time before GUADEC ...
Splendid! I didn't have a look yet, but it sounds very promising,
indeed!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-04-09 9:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-04 5:50 gtk: toolbar space style David Pirotte
[not found] ` <986400337.1886.1.camel@soleil>
2001-04-04 12:40 ` David Pirotte
[not found] ` <986428047.18191.5.camel@soleil>
2001-04-05 2:41 ` David Pirotte
2001-04-05 5:28 ` Announcing guile-gobject Martin Baulig
2001-04-09 9:25 ` Marius Vollmer
[not found] ` <986508739.1535.0.camel@soleil>
2001-04-06 10:03 ` gtk: toolbar space style David Pirotte
2001-04-04 12:41 ` David Pirotte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).