RE: start-editing signal?

2007-09-21 Thread Allin Cottrell
On Fri, 21 Sep 2007, Prewitt, Nathan C ERDC-ITL-MS Contractor wrote:

> On my machine, it did not revert back to "bottles of coke".  
> Depending on where I moved the pointer, it either made the 
> change to "foo" or it left "foo" and I was still able to edit 
> the cell.

A relevant question occurs to me: Do you have your window manager 
set on "click to focus" or "focus follows mouse"?  I have the 
latter.

In any case, I think the behaviour that most users would expect 
is: when the window you left with an uncommitted edit regains 
focus, the uncommitted edit would still be there, and still 
uncommitted.

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: start-editing signal?

2007-09-21 Thread Allin Cottrell
On Fri, 21 Sep 2007, Prewitt, Nathan C ERDC-ITL-MS Contractor wrote:

> On my machine, it did not revert back to "bottles of coke".  
> Depending on where I moved the pointer, it either made the 
> change to "foo" or it left "foo" and I was still able to edit 
> the cell.

Interesting.  The machine from which I reported this is running 
Ubuntu 7.04, with gtk 2.10.11.  When I move the mouse pointer out 
of the treeview window, the cell edit-in-progress immediately 
disappears and "bottles of coke" comes back.  I have another 
machine running GTK 2.12; I'll check on that, though I'm pretty 
sure the effect was the same.

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Row number in TreeView

2007-09-21 Thread Claudio Saavedra
On Mon, 2007-09-17 at 09:29 +0100, Lukasz Gromotowicz wrote:
> 
> gint* i = gtk_tree_path_get_indices (path);

I think you should use the appropriate gtkmm API to do that. Something
like

  gint *i = path.get_indices();

or so. 

I only told you about the generic C method, but you should map that to
the binding you are using.

Claudio
-- 
Claudio Saavedra  <[EMAIL PROTECTED]>

Día del Software Libre, Curicó  http://curico.diadelsoftwarelibre.cl

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

RE: start-editing signal?

2007-09-21 Thread Prewitt, Nathan C ERDC-ITL-MS Contractor

On my machine, it did not revert back to "bottles of coke".  Depending on
where I moved the pointer, it either made the change to "foo" or it left
"foo" and I was still able to edit the cell.

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


Re: start-editing signal?

2007-09-21 Thread Allin Cottrell
On Fri, 21 Sep 2007, David Ne?as (Yeti) wrote:

> Start with the correct signal name...

Yes, sorry about that.  But here's a real question about cell 
editing in a treeview.  I can make the point by reference to 
gtk-demo:

1. Start gtk-demo and select "Editable cells" under "Tree View".
Double-click to get the demo.

2. Click on the "bottles of coke" cell to edit it.

3. Type "foo" (and only that, no Enter).

4. Move the pointer out of the treeview window, then move it back 
in.

My expectation: the unfinished edit will still be in place. 

Actual behaviour: the "bottles of coke" cell is as it was before I 
started; my edit-in-progress is gone.

This may not be a bug as such, but I would like to know if there's 
a way of preserving the state of the cell-editing process, in face 
of the treeview window temporarily losing focus.

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: start-editing signal?

2007-09-21 Thread Yeti
On Fri, Sep 21, 2007 at 03:11:12PM -0400, Allin Cottrell wrote:
> I'm trying to connect a callback to "start-editing" on a cell 
> renderer, but I must be doing something wrong.  My code is
> basically
> 
> static void create_cell_renderer (gpointer p)
> {
> GtkCellRenderer *r;
> 
> r = gtk_cell_renderer_text_new();
> 
> g_object_set(r, "ypad", 1, 
>"xalign", 1.0, 
>"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
>NULL);
> g_signal_connect(r, "start-editing",
>G_CALLBACK(cell_edit_start), p);
> }
> 
> When this code is invoked, I'm getting
> 
> GLib-GObject-WARNING **: gsignal.c:1669: signal `start-editing' is 
> invalid for instance `0x822a5f0'
> 
> I've verified that 0x822a5f0 is indeed the return value from
> gtk_cell_renderer_text_new.
> 
> Can anyone tell me how to make a valid hook-up?

Start with the correct signal name:

http://library.gnome.org/devel/gtk/stable/GtkCellRenderer.html#GtkCellRenderer-editing-started

Looking at the documentation should be first thing when you
get a GObject complaint about invalid signal/property name.

Yeti

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


Re: start-editing signal?

2007-09-21 Thread Allin Cottrell
On Fri, 21 Sep 2007, Allin Cottrell wrote:

> I'm trying to connect a callback to "start-editing" on a cell 
> renderer, but I must be doing something wrong.  

Duh, sorry, that should be "editing-started", not "start-editing".  
Then it works.

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


start-editing signal?

2007-09-21 Thread Allin Cottrell
I'm trying to connect a callback to "start-editing" on a cell 
renderer, but I must be doing something wrong.  My code is
basically

static void create_cell_renderer (gpointer p)
{
GtkCellRenderer *r;

r = gtk_cell_renderer_text_new();

g_object_set(r, "ypad", 1, 
 "xalign", 1.0, 
 "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
 NULL);
g_signal_connect(r, "start-editing",
 G_CALLBACK(cell_edit_start), p);
}

When this code is invoked, I'm getting

GLib-GObject-WARNING **: gsignal.c:1669: signal `start-editing' is 
invalid for instance `0x822a5f0'

I've verified that 0x822a5f0 is indeed the return value from
gtk_cell_renderer_text_new.

Can anyone tell me how to make a valid hook-up?  Thanks!

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


emit keypress event into event loop

2007-09-21 Thread vano

Hello,

Anybody has idea how to emit in GTK (2.11.6) some keypress event into
main event loop?

I have mouse clickable button and want to send to my text_view a
keyboard press.

I'm doing this way:

in main code:

g_signal_connect(G_OBJECT(my_button), "button-press-event",
 G_CALLBACK(press_callback), G_OBJECT(textview));

in callback:

static void press_callback( GtkWidget *widget,
GdkEventButton *e, GtkWidget *text_view )
{
g_print("button press\n");

GdkEvent *event;

event = gdk_event_new(GDK_KEY_PRESS);

event->key.keyval = GDK_K;
event->key.window = gtk_text_view_get_window(text_view,
GTK_TEXT_WINDOW_TEXT);
event->key.time = 0;

gtk_main_do_event(&event);
}

I get nothing in my text_view view but have the following debug output:
GLib-GObject-WARNING **: invalid uninstantiatable type `' in
cast to `GdkWindow'
gtktextview.c:4303: focus_out_event
>Lines Validated (gtktextview.c:3492)
 visible rect: 0,0 226 x 107
 invalidated rect: 0,0 226 x 28
>Exposed (gtktextview.c:4447)

or if trying another approach with sending event directly to text_view
widget:

static void press_callback( GtkWidget *widget,
GdkEventButton *e, GtkWidget *text_view )
{
g_print("button press\n");

GdkEvent *event;

event = gdk_event_new(GDK_KEY_PRESS);

event->key.keyval = GDK_K;
event->key.window = gtk_text_view_get_window(text_view,
GTK_TEXT_WINDOW_TEXT);
event->key.time = 0;

g_signal_emit_by_name(GTK_TEXT_VIEW(text_view), "key_press_event", 
event);

}

the program seems go in correct way, but I get segmentation fault:

>Invalidate, onscreen_validated = 1 now FALSE (gtktextview.c:3442)
gtktextview.c:3454: adding first validate idle 13
gtktextview.c:3461: adding incremental validate idle 14
gtktextview.c:1812
Invalidating due to layout invalidate signal
>Invalidate, onscreen_validated = 0 now FALSE (gtktextview.c:3442)
Invalidating due to layout invalidate signal
>Invalidate, onscreen_validated = 0 now FALSE (gtktextview.c:3442)
TEXTVIEW: K -- callback of "changed" signal for TextView
gtktextview.c:7131: scrolling onscreen
gtktextview.c:1812
gtktextview.c:3410
removing first validate in gtktextview.c:3367
>Updating layout width (gtktextview.c:1965)
Segmentation fault

Please suggest correct mailing list if I'm posting on the wrong one.

Thanks!

Best regards,
Ivan






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


add mark to a point in a gtkplot pressing 'c'

2007-09-21 Thread ferri_marllo
hello again...
i solve part of my problem(i ask before),but now the problem is that i want to
mark a point in my graphic,pressing 'c' key,not clicking on it...
how can i do it??
thanks a lot...



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


Re: Animation with GTK+

2007-09-21 Thread geminitojanus
On 9/12/07, Prokopenko, Konstantyn <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm totally new to the GUI application development in Linux X11. I was
> mostly involved in embedded non-graphical development.
> Now I need to create GUI interface application using GTK+.
> Could you advise me the best way to create animation of a rotating
> object in GTK window? This object is going to be a picture of a device
> rotating in sync with a real hardware device. Which library/extension I
> can use?

It really depends on the horsepower of your device. If it's got a
little brawn, you can probably do everything you want to do through
Cairo: http://cairographics.org (if your device is using a version of
GTK+ 2.8 or newer). Based on the change of the rotation in your
device, you could have it call the ::expose method on a
GtkDrawingArea, and simply do whatever drawing in Cairo you wish from
there. It's not incredibly powerful, but it's enough for simple
animations and such, and it saves you from having to port over a huge
canvas widget.

If you're using an older version of GTK+, or your hardware doesn't
have hardware floating point, performance might not be so hot through
Cairo though, and you'll want to look at messing with GdkPixbufs.

Hope that gets you started.

> Thank you.
>
> Regards,
> Konstantyn
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


select point in a graph using keyboard,not clicj event

2007-09-21 Thread ferri_marllo
Hello!!
I,ve built an appilcation which plot a graph into a canvas,i'd like to connect
two signals to it...one of this is to move a cursor inside(key_press_event),but
i'd like too that eaxh time i press c in a graph(on point)it will be seected...
how can i do it



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


which level (directfb or gtk++)shoud I use to draw image?

2007-09-21 Thread summer xia
hello all

I am developing a media player on Linux. We choose the Gtk+ based on
DirectFB is our GUI library. But I wonder to know which level API
should be choosed when draw image on LCD, use Gtk+ object such as
GdkPixbuf, GdkImage and so on, or use IDirectFB,IDirectFBSurface and
so on? If I want to use the IDirectFB and IDirectFBSurface to draw
image on LCD, how can I get these interface from the GDK or Gtk+
object?

Thanks for any kind help.

Regards

XiaGuangTai

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