Re: Emulate doubleclick in GtkCList?

2001-10-02 Thread Paul Davis

>can someone tell me, if there is a possibility to get the doubleclick =
>event from an row of the CList.
>It's needed for an own file-browser

of course.

   gtk_signal_connect (GTK_OBJECT(the_clist), "button_press_event",
   (GtkSignalFunc) my_handler, NULL);

   

   gint my_handler (GtkWidget *w, GdkEventButton *ev, gpointer data) 
   {
   gint row, col;

   switch (ev->type) {
   case GDK_2BUTTON_PRESS:
gtk_clist_get_selection_info (GTK_CLIST(w), ev->x, ev->y,
  &row, &col);
break;
   ...

You may want to (conditionally) add:

  gtk_signal_emit_stop_by_signal (w, "button_press_event");

in the handler to prevent the button press(es) from having their usual
effect. Or you may not.

all clear?

oh, and please stop sending HTML formatted email in addition to plain
text email. its wasteful of internet bandwidth and utterly horrible
for those of us who use text-based email software.

--p

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: combo box

2001-10-02 Thread Alexey Semenov

On Mon, 1 Oct 2001, Paul Davis wrote:

> > my_func is signal handler for both - key press and key_release
> >events, but only key_press is active all the time
>
> I noted on the list a week or so ago that a number of widgets only
> receive key_press by default. you need to use gtk_widget_add_events()
> if you want key_release as well.
>
> >release never appears and after press  focus goes out (it goes out
> >right afrer key_press, before release  button !)
>
> yep, thats the way the built-in focus handlers work.
>
> >if i remove
> >gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_release_event")
> >- no more Gtk-Warnings, but focus goes out of combo's entry area.
>
> did you conditionalize the stop_by_name() on the type of event? you
> should have:
>
>gint my_callback (GtKWidget *w, GdkEventKey *event, gpointer data)
>{
> ...
>   switch (event->type) {
>   case GDK_KEY_PRESS:
>gtk_signal_emit_stop_by_name (w, "key_press_event");
>break;
>   case GDK_KEY_RELEASE:
>gtk_signal_emit_stop_by_name (w, "key_release_event");
>break;
> default:
>break;
> }
>   return TRUE;
>   }
>
> --p

ok, lets go from the way begining:

1. i create combo box:

combo2 = gtk_combo_new ();

and assign signal handler:

gtk_signal_connect_object(GTK_OBJECT (GTK_ENTRY(GTK_COMBO(combo2)->entry )) , 
"key_press_event", GTK_SIGNA
L_FUNC(my_func),GTK_OBJECT (GTK_ENTRY(GTK_COMBO(combo2)->entry)));

2. inside my_func

void my_func (GtkWidget* widget, GdkEventKey* event, gpointer data)

 ev = event->type;

 printf ("event->type = %d\n", ev); - get 8 all the time (key_pressed)

 switch (event->keyval) {
case GDK_Up:
... do smth. usefull...

and try to stop emission to prevent  focus-out:

gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");


no errors, but after press  focus goes out (it hapened before !!!
release  )

i tried also return TRUE | FALSE instead of void.


question is: why signal "key_pressed" doesn't stop and goes further to
focus-handler?



PS: i partially solved this problem by using
gtk_combo_disable_activate(GTK_COMBO(combo1));
gtk_combo_set_use_arrows_always (GTK_COMBO(combo1), TRUE);
in developer version, but it's not what i'd like to :(

PPS: you can see all the src here: www.enlight.ru/ptkdic/


any ideas?



---
See you later...
 Alexey.


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Emulate doubleclick in GtkCList?

2001-10-02 Thread Claus Trojahn

jeahh, thx helped a lot... i now have a new step of my selfmade ftp-client
:-)

sorry for the html-mail. i forgot that. it's my really first time on a
maillist, so i hope this massage will there also be.

thx a lot

claus


- Original Message -
From: "Paul Davis" <[EMAIL PROTECTED]>
To: "Claus Trojahn" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 3:08 PM
Subject: Re: Emulate doubleclick in GtkCList?


> >can someone tell me, if there is a possibility to get the doubleclick =
> >event from an row of the CList.
> >It's needed for an own file-browser
>
> of course.
>
>gtk_signal_connect (GTK_OBJECT(the_clist), "button_press_event",
>(GtkSignalFunc) my_handler, NULL);
>
>
>
>gint my_handler (GtkWidget *w, GdkEventButton *ev, gpointer data)
>{
>gint row, col;
>
>switch (ev->type) {
>case GDK_2BUTTON_PRESS:
> gtk_clist_get_selection_info (GTK_CLIST(w), ev->x, ev->y,
>   &row, &col);
> break;
>...
>
> You may want to (conditionally) add:
>
>   gtk_signal_emit_stop_by_signal (w, "button_press_event");
>
> in the handler to prevent the button press(es) from having their usual
> effect. Or you may not.
>
> all clear?
>
> oh, and please stop sending HTML formatted email in addition to plain
> text email. its wasteful of internet bandwidth and utterly horrible
> for those of us who use text-based email software.
>
> --p


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



combo box

2001-10-02 Thread Alexey Semenov

hi,

i'd like to rebind default keys of cobmbo box like , , ,
etc.

...

combo1 = gtk_combo_new ();
...
gtk_signal_connect_object(GTK_OBJECT
(GTK_ENTRY(GTK_COMBO(combo1)->entry )) , "key_press_event", GTK_SIGNAL_FUNC(my_func),
GTK_OBJECT (GTK_ENTRY(GTK_COMBO(combo1)->entry)));

my_func (GtkWidget* widget, GdkEventKey* event, gpointer data)
{
switch (event->keyval) {
...
case GDK_Up:

... do smth. usefull, then i'd like to supress Up ...

gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_release_event");
break;
...
}

... to prevent focus moving out of entry.
all works, but i'm getting:

Gtk-WARNING **: gtk_signal_emit_stop(): no current emission (27) for object `GtkEntry'

and sigsegv some time.

if i remove any of two lines with gtk_signal_emit_stop... or swap
order - focus going out of combobox's entry.

any ideas?


---
See you later...
 Alexey.


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: [gtkextra] Disabling middle mouse button paste in GtkSheet

2001-10-02 Thread Adrian Feiguin


On Fri, 28 Sep 2001 [EMAIL PROTECTED] wrote:

> Well, I attached my callback like this:
>
> gtk_signal_connect(GTK_OBJECT(sheet), "button_press_event", (GtkSignalFunc) 
>callback, NULL);
>
> gboolean
> callback (GtkWidget *w, GdkEventButton *event, gpointer data) {
>

gtk_signal_emit_stop_by_name(..."button_press_event"...)

> }
>

Try this out.
Saludos,


> return TRUE or FALSE doesn't seem to matter, it still pastes the text.  On a
> related note, gtk_sheet_set_active_cell() appears to lose one click toward
> double or triple clicks.  You need to start over.  This kind of sucks because I
> want a single middle mouse button click to do gtk_sheet_set_active_cell() on
> the clicked cell and a double middle mouse button click to do something else,
> neither of which to paste the text.
>
> Perhaps this is a Gtk+ question, so I copied that list.
>
> In message <[EMAIL PROTECTED]>, A
> drian Feiguin writes:
>
> >I never tried but surely you can connect the "button press" event signal
> >to a callback function and interrupt the propagation of the signal.
> >Saludos,
> >
> >
> >On Sun, 23 Sep 2001 [EMAIL PROTECTED] wrote:
> >
> >> Is is possible to prevent the middle mouse button from pasting the current
> >> selection with the GtkSheet widget?  I need this because I'm overriding the
> >> normal middle button paste functionality.
> >>
> >> John
> >>
> >>
> >
>
>


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



[gtk] GTK on memory framebuffer?

2001-10-02 Thread Cam Mayor

Hi all,

One of the projects we are looking at right now has a really tight deadline 
for a customer demo.  (that is, our customer wants to demo it to somebody 
else)  We are putting together a clunky demo unit for the first pass as a 
proof of concept.  It runs a linux 2.4.6 variant on an ARM processor, 
which has an LCD framebuffer memory mapped.

We do not currently have any kernel mode LCD or framebuffer drivers.  We do, 
however, have a user mode driver.  That is, we can compile writes to the 
framebuffer into an application via writing raw data.  Ultimately we plan on 
using kernel mode drivers and using gtk for our gui widgets.

Now the question:

Can gtk act on a pure bitmap/framebuffer image (defined only as a data 
structure), or does it need to act on the actual devices of display?   If it 
can operate on a raw image, we can easily do some blitting back and forth 
between two bitmaps kept in memory; the one not being displayed is the one 
modified, until it gets swapped with the currently displayed bitmap.  Is this 
possible with Gtk?  This would allow us to use Gtk for our development for 
the demo, and allow us to keep the overall architecture for the post-demo 
development.

While i'm at it, has anybody else compiled Gtk for the ARM architecture?

cheers,
cam

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



./configure can't find X

2001-10-02 Thread Michael Kuhlen

Hi there,

anybody willing to help me out? I'm trying to install gtk+-1.2.10 on
RedHat7.1  (2.4.2-2). The ./configure script 
crashes when it tries to find X, these are its last lines:

checking for X... no
configure: error:
*** X libraries or include files not found. Check 'config.log' for
*** more details.

The relevant lines of config.log are:

configure:4544: checking for X
configure:4611: gcc -E  conftest.c >/dev/null 2>conftest.out
configure:4607:27: X11/Intrinsic.h: No such file or directory
configure: failed program was:
#line 4606 "configure"
#include "confdefs.h"
#include 
configure:4687: gcc -o conftest -g -O2 -Wall   conftest.c -lXt   1>&5
configure: In function `main':
configure:4683: warning: implicit declaration of function `XtMalloc'
/usr/bin/ld: cannot find -lXt
collect2: ld returned 1 exit status
configure: failed program was:
#line 4680 "configure"
#include "confdefs.h"

int main() {
XtMalloc()
; return 0; }


I don't seem to have a file called Intrinsic.h, so I guess it doesn't know
where to find the X11 libraries? I do have the Xt libraries, they're in
/usr/X11R6/lib, at least I have a file named libXt.so.6.0, and a sym link
to it called libXt.so.6. When I try to compile anything with gcc -lXt I
get "/usr/bin/ld: cannot find -lXt", even when I add -L/usr/X11R6/lib.
/usr/X11R6/lib is in my /etc/ld.so.conf file, and I've run ldconfig over
and over again.

Clearly there's something fundamental that I don't know about, please help
me out.

thanks a lot, mike


*
*   *
*  Michael Kuhlen  Astronomy Department UCSC*
*  email: [EMAIL PROTECTED]  Kerr Hall*
*  home phone: (831) 469-3890  1156 High Street *
*  work phone: (831) 459-4485  Santa Cruz, CA 95060 *
*   *
*



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



gtk

2001-10-02 Thread landie

trying to upgrade to gtk 1.3.9 i get tis error during make install  any
help?




To sin by silence when they should protest makes cowards  out of men.  --Abraham 
Lincoln

-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBDuyaGQRBADuy5RgRve2BFembRa15NJOkIHlsUOQrsDazsLzTnvNIQanyuFy
xRDS/aiRsnNEY9FY5Q9vpkn6FkC1kgGbu3IODFoA2IG6x5gWxu2ZrUXdzA+BCx5S
7TyB6o2slBc8scNCGrpZUwtPjfFrRQG0ScS3eDO+0D5imc9l+1vGNzq0VwCgpj/Q
fCeeUUKnjBrj7KryVHwd6qMD/37IWO2vKgEgHmZ/hrkEDcd79lurxaknxmdzEoD9
evwEKhlHbxcg7AVS6UD5CowCDAIDK/88ygQLFK+3ZoG7pLormPNfEUlYH9pIDgUU
X1aVElu656GM5Cr4g+6KuOOUIobfw4AM1yCyIrAakFMGQtGRu80f6X9ViaYInW9F
m6ZxBADYJ/FwpWVHqCeaSLeSCnzpP3Jki/KiXgUF0/B6aWYTojo643d69vVjK6Ca
IedAcAve3kk2InBWEzjFt8C7widt2G6aJYXsHDzRkzhhttHHXemoOlgCNKz2T23M
ZD3tN2HC8YNE/ODoUF+1PM+FJ/h2guVCCMLCrlGakBE/xyomf7QsUm9sYW5kbyBS
b21hbiAoZnJlZSkgPGxhbmR5QGRlc3BpZXJ0YXByLmNvbT6IXQQTEQIAHQUCO7Jo
ZAUJAsfqAAULBwoDBAMVAwIDFgIBAheAAAoJEEZFYl4vkkomfs4Anij31JBfYFeB
ZR7q4hN4Z9oQf5aWAJ9gzF42zDT2wDFlapTm/T2uIOb9t7kBDQQ7smhrEAQA8xWk
008LVtTnJadrvmhydU0Pa4sUgKNozeg7k0f0NpeZYDm1nY2oPuscM9+fPU9gZ+pc
X6eMZzAF4oE6jOhoA7OnEFhl7zdVa1tjKOIITbadP3RgZHFRY/9dS34KNJlvuJYX
x+XqSa6W/Y2fa2FOEs2q4DSekUYclx2Vpbd1E4sAAwYEAIB5tYHGm7lVzauO8O0K
jTRzBLEZesgXu9B1aD/HGOlQ55Af9j1ZiiXY9IceiEWymfLpjTwhrM7/rYJC50lo
/H+6AROoTFuyZ8GulQvdr5YSeGhW9gmrh+s/uj7PDYBgtbQh10zNefIXRI/W/QlR
xYaB/Q/8N8LrpJ3TB8IPVcdmiEwEGBECAAwFAjuyaGsFCQLH6gAACgkQRkViXi+S
SibQPACfbXb9XvrS9G3XTqUGnaTeGkA/w1wAniY/hTrnZdCrdLsG3ANDcTmZBioC
=ZXxw
-END PGP PUBLIC KEY BLOCK-


Making install in po
make[1]: Entering directory `/home/landie/gtk+-1.3.9/po'
if test -r ".././mkinstalldirs"; then \
  .././mkinstalldirs /usr/local/; \
else \
  /bin/sh ../mkinstalldirs /usr/local/; \
fi
if test "gtk20" = "gettext"; then \
  if test -r ".././mkinstalldirs"; then \
.././mkinstalldirs /usr/local/share/gettext/po; \
  else \
/bin/sh ../mkinstalldirs /usr/local/share/gettext/po; \
  fi; \
  /usr/bin/install -c -m 644 ./Makefile.in.in \
  /usr/local/share/gettext/po/Makefile.in.in; \
else \
  : ; \
fi
make[1]: Leaving directory `/home/landie/gtk+-1.3.9/po'
Making install in gdk-pixbuf
make[1]: Entering directory `/home/landie/gtk+-1.3.9/gdk-pixbuf'
Making install in pixops
make[2]: Entering directory `/home/landie/gtk+-1.3.9/gdk-pixbuf/pixops'
make[3]: Entering directory `/home/landie/gtk+-1.3.9/gdk-pixbuf/pixops'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/landie/gtk+-1.3.9/gdk-pixbuf/pixops'
make[2]: Leaving directory `/home/landie/gtk+-1.3.9/gdk-pixbuf/pixops'
make[2]: Entering directory `/home/landie/gtk+-1.3.9/gdk-pixbuf'
make[3]: Entering directory `/home/landie/gtk+-1.3.9/gdk-pixbuf'
/bin/sh ../mkinstalldirs /usr/local/lib
/bin/sh ../libtool  --mode=install /usr/bin/install -c libgdk_pixbuf-1.3.la 
/usr/local/lib/libgdk_pixbuf-1.3.la
/usr/bin/install -c .libs/libgdk_pixbuf-1.3.so.9.0.0 
/usr/local/lib/libgdk_pixbuf-1.3.so.9.0.0
(cd /usr/local/lib && rm -f libgdk_pixbuf-1.3.so.9 && ln -s libgdk_pixbuf-1.3.so.9.0.0 
libgdk_pixbuf-1.3.so.9)
(cd /usr/local/lib && rm -f libgdk_pixbuf-1.3.so && ln -s libgdk_pixbuf-1.3.so.9.0.0 
libgdk_pixbuf-1.3.so)
/usr/bin/install -c .libs/libgdk_pixbuf-1.3.lai /usr/local/lib/libgdk_pixbuf-1.3.la
/usr/bin/install -c .libs/libgdk_pixbuf-1.3.a /usr/local/lib/libgdk_pixbuf-1.3.a
ranlib /usr/local/lib/libgdk_pixbuf-1.3.a
chmod 644 /usr/local/lib/libgdk_pixbuf-1.3.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
--
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
 during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
 during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
--
/bin/sh ../mkinstalldirs /usr/local/bin
 /bin/sh ../libtool  --mode=install /usr/bin/install -c  gdk-pixbuf-csource 
/usr/local/bin/gdk-pixbuf-csource
/usr/bin/install -c .libs/gdk-pixbuf-csource /usr/local/bin/gdk-pixbuf-csource
/bin/sh ../mkinstalldirs /usr/local/lib/gtk-2.0/1.3.9/loaders
/bin/sh ../libtool  --mode=install /usr/bin/install -c libpixbufloader-png.la 
/usr/local/lib/gtk-2.0/1.3.9/loaders/libpixbufloader-png.la
libtool: install: warning: relinking `libpixbufloader-png.la'
cd /home/landie/g

Re: [gtkextra] Disabling middle mouse button paste in GtkSheet

2001-10-02 Thread Adrian Feiguin

You have to add a line:
  if(event->button == 2){ /* 2 for middle button */
   ...
  }

BTW I just bought Havoc's book at Border's for 6 bucks. I know it's freely
available on the web, but it could be handy to have a hard copy.
Saludos,


On Sat, 29 Sep 2001 [EMAIL PROTECTED] wrote:

> No effect.
> 
> I added:
> 
> gtk_signal_emit_stop_by_name(GTK_OBJECT(w), "button_press_event");
> 
> as the first thing in my callback.  It is doing *something*, because it
> prevents the user from selecting cells or a region.  (I only want to put it in
> the section of my handler that handles second mouse button events, but this was
> suitable for testing).
> 
> I also still have no idea why gtk_sheet_set_active_cell() seems to swallow a
> button press event going towards double or triple clicks.
> 
> Gtk+ signal handling is really rough around the edges.  It's *really* hard to
> do anything beyond processing "clicked" events and the occasional select/
> unselect_row.  (Like my attempt to hack around severe limitations in the
> GtkCombo widget causing XFree86 4.x to crash.)  At least much harder than Motif
> is...
> 
> Thanks for your help,
> John
> 
> In message <[EMAIL PROTECTED]>, A
> drian Feiguin writes:
> 
> >
> >On Fri, 28 Sep 2001 [EMAIL PROTECTED] wrote:
> >
> >> Well, I attached my callback like this:
> >>
> >> gtk_signal_connect(GTK_OBJECT(sheet), "button_press_event", (GtkSignalFunc) 
> >callback, NULL);
> >>
> >> gboolean
> >> callback (GtkWidget *w, GdkEventButton *event, gpointer data) {
> >>
> >
> >gtk_signal_emit_stop_by_name(..."button_press_event"...)
> >
> >> }
> >>
> >
> >Try this out.
> >Saludos,
> >
> >
> >> return TRUE or FALSE doesn't seem to matter, it still pastes the text.  On a
> >> related note, gtk_sheet_set_active_cell() appears to lose one click toward
> >> double or triple clicks.  You need to start over.  This kind of sucks becaus
> >e I
> >> want a single middle mouse button click to do gtk_sheet_set_active_cell() on
> >> the clicked cell and a double middle mouse button click to do something else
> >,
> >> neither of which to paste the text.
> >>
> >> Perhaps this is a Gtk+ question, so I copied that list.
> >>
> >> In message <[EMAIL PROTECTED]>
> >, A
> >> drian Feiguin writes:
> >>
> >> >I never tried but surely you can connect the "button press" event signal
> >> >to a callback function and interrupt the propagation of the signal.
> >> >Saludos,
> >> >
> >> >
> >> >On Sun, 23 Sep 2001 [EMAIL PROTECTED] wrote:
> >> >
> >> >> Is is possible to prevent the middle mouse button from pasting the curren
> >t
> >> >> selection with the GtkSheet widget?  I need this because I'm overriding t
> >he
> >> >> normal middle button paste functionality.
> >> >>
> >> >> John
> >> >>
> >> >>
> >> >
> >>
> >>
> 
> -- 
> John GOTTS <[EMAIL PROTECTED]>  http://linuxsavvy.com/staff/jgotts
> 


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Set gc_light/dark color using resource?

2001-10-02 Thread jos

HI!!!

When gtk draws a 'raised' button of a certain
background color, it draws the top and left edges
in a somewhat lighter color (gc_light) and the
bottom and right edges in a somewhat darker color
(gc_dark). Is it possible to set these colors 
explicitly? In the .gtkrc file I can only find
entries for the background color. 

best regards

jos van riswick

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: ./configure can't find X

2001-10-02 Thread Sven Neumann

Hi,

Michael Kuhlen <[EMAIL PROTECTED]> writes:

> anybody willing to help me out? I'm trying to install gtk+-1.2.10 on
> RedHat7.1  (2.4.2-2). The ./configure script 
> crashes when it tries to find X, these are its last lines:

it doesn't crash, it exits with an error.

> I don't seem to have a file called Intrinsic.h, so I guess it doesn't know
> where to find the X11 libraries?

no, it doesn't find the X11 header files. Most probably you don't have
them installed. Try installing libX11-dev or something similar (I don't
have a RedHat system at hand to look it up).


Salut, Sven

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: gtk

2001-10-02 Thread Sven Neumann

Hi,

landie <[EMAIL PROTECTED]> writes:

> trying to upgrade to gtk 1.3.9 i get tis error during make install  any
> help?

> /usr/bin/install: reading `.libs/libgdk-x11-1.3.a': Input/output error

hmm, filesystem corrupt or out of space? cosmic neutrons??


Salut, Sven

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: gtk_object_unref

2001-10-02 Thread Jean-Christophe Berthon

>
> "Jean-Christophe Berthon" <[EMAIL PROTECTED]> writes:
> > (I've read some older threads about it - like the one about the
container -
> > but in my case my objects and points are drawings on a gtk-canvas and I
want
> > to ref and unref some of the GtkCanvasItem that are shared...)
> >
> >
> > I hope I've been clear enough, if you need more explanation, tell me
what
> > you didn't understand and I will try to say it differently.
>
> Say you create the canvas item to give it to object A - do you also
> reference it?

first thank you all for your answers.
Yes you right I didn't reference it.


>
> If not, then you are assuming ownership of the "floating" reference,
> which isn't allowed. The canvas will then strip the floating reference
> off the item when you add the item to the canvas; and object A will
> end up not owning any reference at all.
>
> If you do this:
>
>  obj = whatever_gtk_object_new ();
>
> Then the immediate situation is that "obj" has one floating reference,
> and zero owned references. To remove the floating reference, do this:
>
>  gtk_object_sink (obj);
>
> That will finalize the object if it hasn't already been finalized.
>
> What the canvas does is this:
>
>  gtk_object_ref  (obj);
>  gtk_object_sink (obj);
>
> So then "obj" has one reference owned by the canvas, and zero floating
> references.
>
> Anyhow, short answer, you need another gtk_object_ref(), rather than
> taking ownership of the floating reference. No one can ever own the
> floating reference; if you want to call unref on a GtkObject, you must
> first call ref; there are no exceptions, even if you created the
> object yourself.
>

OK. I didn't really understand everything (esp. about the floating
reference, I don't exactly what this thing mean or is...). But I've tryed to
add to my code a gtk_object_sink just after the creation of the canvas item.
Then I've tryed to add instead gtk_object_ref and gtk_object_sink. And
finally I've tryed gtk_object_ref only instead of the previous two commands.
But in all this case I got the warnings.

But I want to precise one thing.
The unref operation occur in a callback of the canvas item. So one of them
receive an action from the user and I have to unref this item and a second
one (passed with the void* of the callback).
The item that fired the event has a ref_count of 3 (instead I would expect
1) while the other one has a ref_count of 1 (which should be normal).
I'm applying the unref to both of them, so after the unref execute there
ref_count decremente of 1 (so respectively to 2 and 0). I'm getting a
warning only on the second item but both are destroyed!!! (I guess this job
is done when leaving the callback as at this moment I receive a second
warning (again about this ref_count).)

If you need I can send a extract of my code with all the involved parts.

Again thanks all for your help,
Have a nice day (or night)...

Best regards,
Jean-Christophe






___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: ./configure can't find X

2001-10-02 Thread Valdis . Kletnieks

On Tue, 02 Oct 2001 18:51:45 +0200, Sven Neumann said:

> > I don't seem to have a file called Intrinsic.h, so I guess it doesn't know
> > where to find the X11 libraries?
> 
> no, it doesn't find the X11 header files. Most probably you don't have
> them installed. Try installing libX11-dev or something similar (I don't
> have a RedHat system at hand to look it up).

XFree86-devel

/Valdis

 PGP signature


Re: gtk_object_unref

2001-10-02 Thread Havoc Pennington



"Jean-Christophe Berthon" <[EMAIL PROTECTED]> writes: 
> OK. I didn't really understand everything (esp. about the floating
> reference, I don't exactly what this thing mean or is...). But I've tryed to
> add to my code a gtk_object_sink just after the creation of the
> canvas item.

You shouldn't need to sink, just be sure you ref.

> Then I've tryed to add instead gtk_object_ref and gtk_object_sink. 

That should be OK.

> And
> finally I've tryed gtk_object_ref only instead of the previous two
> commands.

Also should be OK.

> But in all this case I got the warnings.

Something else is wrong then.

> But I want to precise one thing.
> The unref operation occur in a callback of the canvas item. So one of them
> receive an action from the user and I have to unref this item and a second
> one (passed with the void* of the callback).
> The item that fired the event has a ref_count of 3 (instead I would expect
> 1)

The signal subsystem will temporarily add references while emitting a
signal on an object, that explains the refcount of 3.

Havoc

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: [gtk] GTK on memory framebuffer?

2001-10-02 Thread Alex Larsson

On Fri, 28 Sep 2001, Cam Mayor wrote:

> Now the question:
> 
> Can gtk act on a pure bitmap/framebuffer image (defined only as a data 
> structure), or does it need to act on the actual devices of display?   If it 
> can operate on a raw image, we can easily do some blitting back and forth 
> between two bitmaps kept in memory; the one not being displayed is the one 
> modified, until it gets swapped with the currently displayed bitmap.  Is this 
> possible with Gtk?  This would allow us to use Gtk for our development for 
> the demo, and allow us to keep the overall architecture for the post-demo 
> development.

This would need a small amount of localized changes in GtkFB. Should be 
really easy.

Just use the shadow buffer mode of GtkFB and make the shadow buffer 
updates update to your framebuffer by changeing the shadow_copy_rect 
function pointers in gtk+/gdk/linux-fb/gdkrender-fb.c:gdk_shadow_fb_init() 
to your own. 

You'd have to remove some stuff from the initialization code too. The 
parts that opens the framebuffer device and sets up resolutions etc. And 
you need to hardcode your framebuffer layout data (size, depth etc).
 
> While i'm at it, has anybody else compiled Gtk for the ARM architecture?

I don't think so. Gtk+ 2 at least.

/ Alex




___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Help - need some insight into experience.

2001-10-02 Thread Dinesh Nadarajah

Hi:

Does GTK/GDK do anything before displaying the messages. Here is what I see.

I compiled the messages using msgfmt as usual. The messages are iso-8859-1
compliant encoded.

Then I set my local to ta_IN (I guess it is nolonger just ta). And the
messages I see make no sense. They seem to be a collection of characters but
no meaningful words.

Then as a test I compiled my messages into en_GB (which I assumed would also
be iso-8859-1 compliant) and then set my locale to en_GB. Now I see the
messages but many of the characters in the extended ASCII set (128 - 255)
are not displayed (about 12 of them).

I can only conclude that GDK or something is doing/analyzing the locale and
the encoding that locale expects and does something to the messages.

Can anyone shed some light on this?

If this is something that would need to be fixed in the future versions, I 
would verymuch like to talk to someone involved with glib/gtk/gdk to help 
fix this.

Thanks in advance.

_Dinesh

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Help - need some insight into experience.

2001-10-02 Thread Havoc Pennington


"Dinesh Nadarajah" <[EMAIL PROTECTED]> writes:
> 
> Does GTK/GDK do anything before displaying the messages. Here is
> what I see.

GTK doesn't, but gettext converts them into the locale's encoding, and
GDK/GTK 1.2 require them to be in the locale encoding. For GDK/GTK
1.3.x, they must be in UTF-8.

> I compiled the messages using msgfmt as usual. The messages are iso-8859-1
> compliant encoded.
> 
> Then I set my local to ta_IN (I guess it is nolonger just ta). And the
> messages I see make no sense. They seem to be a collection of characters but
> no meaningful words.

So the first question is whether the ta_IN locale uses ISO-8859-1.  It
probably doesn't. Given that, you need to use the correct encoding for
the locale; for example, UTF-8 might work (try ta_IN.UTF-8 perhaps).

Havoc

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



RE: [gtk] GTK on memory framebuffer?

2001-10-02 Thread Random User

Thank you to all who replied, you've helped a lot with
your replies. (and sorry about the original version showing up later)

cheers,
cam

-
Protect yourself from spam, use http://sneakemail.com

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Help - need some insight into experience.

2001-10-02 Thread Dinesh Nadarajah

I am trying to understand the flow of conversions and so please bbare with 
me:

My messages are in iso-8859-1/15 format.
I set my locale to ta_IN. I think the encoding for that locale is TSCII-0.
Hence gettext tries to convert from iso-8859-1/15 to TSCII-0.
The font used to display the messages is also iso-8859-1/15 compliant.

Who do I contact about introducing versions of the ta_IN locale: e.g 
ta_IN.ISO8859-1/15.

If I converted all my messages to UTF-8 (conversion from iso-8859-1/15 to 
UTF-8) can I still use my iso-8859-1 font or do I need Unicode fonts.

Thanks for the response.

-D


>From: Havoc Pennington <[EMAIL PROTECTED]>
>To: "Dinesh Nadarajah" <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: Help - need some insight into experience.
>Date: 02 Oct 2001 17:20:58 -0400
>
>
>"Dinesh Nadarajah" <[EMAIL PROTECTED]> writes:
> >
> > Does GTK/GDK do anything before displaying the messages. Here is
> > what I see.
>
>GTK doesn't, but gettext converts them into the locale's encoding, and
>GDK/GTK 1.2 require them to be in the locale encoding. For GDK/GTK
>1.3.x, they must be in UTF-8.
>
> > I compiled the messages using msgfmt as usual. The messages are 
>iso-8859-1
> > compliant encoded.
> >
> > Then I set my local to ta_IN (I guess it is nolonger just ta). And the
> > messages I see make no sense. They seem to be a collection of characters 
>but
> > no meaningful words.
>
>So the first question is whether the ta_IN locale uses ISO-8859-1.  It
>probably doesn't. Given that, you need to use the correct encoding for
>the locale; for example, UTF-8 might work (try ta_IN.UTF-8 perhaps).
>
>Havoc
>
>___
>gtk-list mailing list
>[EMAIL PROTECTED]
>http://mail.gnome.org/mailman/listinfo/gtk-list


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



PHP-GTK: Scrolled Window whoes

2001-10-02 Thread Sérgio Santos

Hi,

I’m having trouble with scrolled windows, I have an application that
uses two scrolled windows, one with a table with GtkEntry boxes and
another with a table with GtkButton, (Listed Vertically).

When I scroll down and press one of the buttons (or entry boxes) the
window automaticly scrolls up again. I though that assigning vadjustment
would solve my problem, but it doesn’t.

What property am I missing? Must I set vadjument for the table? For the
buttons/entry boxes ? Please help, I’m a bit confused here.


The code is like this:
$scrolled_window = &new GtkScrolledWindow();
$scrolled_window->set_border_width(5);
$scrolled_window->set_policy(GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
$box1->pack_start($scrolled_window);
$box2 = &new GtKVBox(false,2);
$box2->set_border_width(5);
$scrolled_window->add_with_viewport($box2);
$box2->set_focus_vadjustment($scrolled_window->get_vadjustment());


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



generic MVC question

2001-10-02 Thread Paul Davis

[ i'm not sure where else to discuss this. if anyone has some
  ideas on good MVC forums, let me know. thx. --p ]

suppose you have a combined View+Controller.

you use the Controller to attempt to change the Model. this usage
changes the appearance of the View. the attempt to change the Model
fails for some reason (e.g. an illegal value).

what causes the View to be reset to the correct state? 

i ask because in a genuine MVC model, you never update the View based
on the return value of a modifier function - the View is updated when
notified of a change in the Model. in this case, there is no change in
the Model, but the View is "stale" because it was modified to reflect
what was happening in the Controller.

if you combine View+Controller, do you have to always check for result
of a Model modifier function, and reset the View if the function
failed? or is there some better paradigm for this that i'm not seeing.

--p

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: Help - need some insight into experience.

2001-10-02 Thread Havoc Pennington


"Dinesh Nadarajah" <[EMAIL PROTECTED]> writes:
> I am trying to understand the flow of conversions and so please bbare
> with me:
> 
> My messages are in iso-8859-1/15 format.
> I set my locale to ta_IN. I think the encoding for that locale is TSCII-0.
> Hence gettext tries to convert from iso-8859-1/15 to TSCII-0.

Yes, I believe that's correct.

> The font used to display the messages is also iso-8859-1/15
> compliant.

Should not be. You have to use a font that supports the encoding of
the locale. GTK's default font should support the locale encoding if:

 - you call gtk_set_locale(NULL) before gtk_init()
 - there is no warning message printed about "locale not supported by 
   C library"
 - you actually have fonts in your locale's encoding

If you load your own fonts, you need to use gdk_fontset_load() rather
than gdk_font_load(); gdk_font_load() won't work properly because it
doesn't automatically get the right font for the locale encoding.

This all applies to GTK 1.2.x, the 1.3.x series is completely
different (uses Unicode throughout, GdkFont replaced by Pango)

> Who do I contact about introducing versions of the ta_IN locale: e.g
> ta_IN.ISO8859-1/15.

This is an operating system issue, it happens on the C library level.
So it depends on the operating system. 

You shouldn't need to care about the encoding though - if your OS
comes with ta_IN using TSCII-0, then it should also come with fonts
that can be used in that encoding...

It's possible your OS already supports ta_IN.ISO-8859-1, try setting
your locale to that and it might work...

> If I converted all my messages to UTF-8 (conversion from iso-8859-1/15
> to UTF-8) can I still use my iso-8859-1 font or do I need Unicode
> fonts.

With GTK 1.2 UTF-8 is not treated specially in any way. If your locale
was a UTF-8 locale (ta_IN.UTF-8 or something), then yes you would need
a Unicode font, and GTK should automatically use it. If your locale is
iso-8859-1 then you need an 8859-1 font. And for TSCII-0 you need a
TSCII-0 font. At least, I think so. Possibly the X fontset mechanism
has some ability to use fonts from one encoding to emulate a font from
another encoding, I'm not sure.

Anyway, basically GTK 1.2 uses the locale model, which means that
everything works in the locale's encoding. You can't choose your own
encoding. GTK 1.3 instead works in UTF-8 encoding at all times, so you
don't have those issues.

Havoc

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



Re: [PATCH] make make dist work without making first

2001-10-02 Thread rsteinke

From: Raja R Harinath <[EMAIL PROTECTED]>
>
> However, it appears that the reason you want to build $(libglib) is
> that you want to distribute the built sources.  It's not necessary to
> distribute those files which are generated using C code (i.e. using
> glib-genmarshal.*).  It is only necessary to distribute stuff built
> with Perl.  
>
> Wouldn't that be a better way to solve the problem rather than
> building $(libglib)?  Of course, this'll require the use of
> BUILT_SOURCES with a sane released 'automake' (say v1.5). 
>
>   BUILT_SOURCES = $(perl_built_files) $(c_built_files)
>   dist-hook-local: $(perl_built_sources)

Is this the canonical way of avoiding including the marshaller code in
a tarball? Something like

BUILT_SOURCES = foo_marshal.c foo_marshal.h

I'm not familiar with this automake option, so I'd appreciate it
if you could point me some where I could get some more discussion.
I don't remember seeing it in the online version of the book, but
I could be wrong.

Since this seems to be going off-topic for gtk-devel-list, I'm
setting it to go to gtk-list instead.

Ron Steinke

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list



SOLVED: PHP-GTK: Scrolled Window whoes

2001-10-02 Thread Sérgio Santos

Well, I was really going in cicles.

What I did was remove the focus_vadjustment from $box2 (the viewport for
scrolled_window) and used it in the table containing the buttons / Entry
boxes(that is then packed into $box2). 
What happens is:

If I type a value into one box and then go down (pressing down arrow)
when it reaches the last seen item, it scrolls automaticly, and also if
I  scroll down/up and click on an item, it works as expected. 
Without any set_focus_vadjustment, it works ok when scrolling, but it
won't auto-scroll if I get past the last visible item.

Sergio


-Original Message-

Hi,

I’m having trouble with scrolled windows, I have an application that
uses two scrolled windows, one with a table with GtkEntry boxes and
another with a table with GtkButton, (Listed Vertically).

When I scroll down and press one of the buttons (or entry boxes) the
window automaticly scrolls up again. I though that assigning vadjustment
would solve my problem, but it doesn’t.

What property am I missing? Must I set vadjument for the table? For the
buttons/entry boxes ? Please help, I’m a bit confused here.


The code is like this:
$scrolled_window = &new GtkScrolledWindow();
$scrolled_window->set_border_width(5);
$scrolled_window->set_policy(GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
$box1->pack_start($scrolled_window);
$box2 = &new GtKVBox(false,2);
$box2->set_border_width(5);
$scrolled_window->add_with_viewport($box2);
$box2->set_focus_vadjustment($scrolled_window->get_vadjustment());


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list