about textview (gtk_text_buffer_insert_with_tags cause segmentaion fault)

2008-07-15 Thread 朱碧岑
Hi all ,
When I insert some text to textview in a thread in the following 
code(myThread::run) . it will segmentation fault . 
Could someone help me to fix this issue.
Any comments and suggestion will be welcomed.

bzhu

#include gtk/gtk.h
#include wchar.h
#include string.h
#include pthread.h
GtkWidget* tv;
GtkTextTag* tag;
#include assert.h
class Thread
{
public:
Thread();
void start();
virtual void run();
private:
pthread_t   m_hThread;
};
Thread::Thread()
{
}
static void* _ou_thread_proc(void* param) 
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL);
Thread* tp = (Thread*)param;
tp-run();
pthread_exit(NULL);
return NULL;
}
void Thread::start()
{
int iret = pthread_create( m_hThread, NULL, _ou_thread_proc,this);
assert(iret == 0);
}
void Thread::run() 
{
}
class myThread:public Thread
{
public :
void run()
{
g_print(Thread is running\n);
//Code belowe will cause the segmentation fault
gdk_threads_enter();
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = Thread is running\n;

gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);//segmentaion
 fault.
gdk_threads_leave();

}
};
void* thread_proc(void* param)
{
gdk_threads_enter();
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = Thread is running\n;
gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);
gdk_threads_leave();
}
myThread g_thread;
void go_click(GtkWidget* goButton,GtkWidget* noWidget)
{
//g_print(You click);
//pthread_t mythread;
//pthread_create(mythread,NULL,thread_proc,NULL);
g_thread.start();
}
int main(int argc,char* argv[])
{
GtkWidget* window;

g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter();
gtk_init(argc,argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
GtkWidget* vbox = gtk_vbox_new(FALSE,2);
gtk_container_add(GTK_CONTAINER(window),vbox);

tv = gtk_text_view_new();
gtk_box_pack_start(GTK_BOX(vbox),tv,TRUE,TRUE,0);
gtk_widget_set_size_request(tv,160,160);
GtkWidget* go = gtk_button_new_with_label(go);
gtk_box_pack_start(GTK_BOX(vbox),go,TRUE,TRUE,0);
g_signal_connect (G_OBJECT (go),clicked,G_CALLBACK (go_click),NULL);
//write a text to the text view
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
tag = gtk_text_buffer_create_tag (tb, 
PASSTAG,scale,PANGO_SCALE_XX_LARGE,NULL);
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = just a test\n;
gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);

gtk_widget_show_all(window);
gtk_main();
gdk_threads_leave();
return 1;
}


Makefile:


CC = g++
RM = rm
GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0 `
GTK_LIBS = `pkg-config --libs --cflags gtk+-2.0 gthread-2.0 `
CFLAGS = -g -Wall
LIBS = -lpthread
.SUFFIXES:.cpp
SRCS = textview.cpp 
#thread.cpp 
OBJS = $(SRCS:.cpp=.o)
.cpp.o:
 $(CC) $(CFLAGS) $(GTK_CFLAGS) -c $
tv: $(OBJS)
 $(CC) $(GTK_LIBS) $(LIBS) -o $@ $(OBJS)
clean:
 $(RM) *.o
 $(RM) tv


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


Re: about textview (gtk_text_buffer_insert_with_tags cause segmentaion fault)

2008-07-15 Thread plt
On Tue, 2008-07-15 at 02:09 +0800, 朱碧岑 wrote:
 Hi all ,
 When I insert some text to textview in a thread in the following 
 code(myThread::run) . it will segmentation fault . 
 Could someone help me to fix this issue.
 Any comments and suggestion will be welcomed.
 
 bzhu
 
 #include gtk/gtk.h
 [...]

 class myThread:public Thread
 {
 public :
 void run()
 {
 g_print(Thread is running\n);
 //Code belowe will cause the segmentation fault
 gdk_threads_enter();
 GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
 GtkTextIter end;
 gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
 gchar text[] = Thread is running\n;
 
 gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);//segmentaion
  fault.

You should add `NULL' to the parameter list:

gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),
end,text,-1,tag, NULL);

 gdk_threads_leave();
 
 }
 };
 ___
 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

Problem writing pixels to GdkPixbuf data buffer

2008-07-15 Thread Luka Napotnik
Hello.

I encounter a strange problem when I'm writing image data to the
GdkPixbuf data buffer.

I create an empty pixbuf and get the data buffer. Then I use:

pixel = pixbuf_data + i * n_channels

, where pixel is a pointer to the pixel, pixbuf_data is the pixbuf data
buffer, i is a counter in a for loop with a condition:

for (i = 0; i  width*height; i++)

This for loop should iterate throught all pixel in the image. The
n_channels variable is 4 because I use a RGBA pixbuf.
When I have this pixel pointer, I use pixel[0], pixel[1], pixel[2] and
pixel[3] to modify the RGBA values.

I then handle the expose-event, create a cairo surface using the
GdkPixbuf and display the surface onto the drawing area. The problem is
when I display the pixbuf the image is shifted to the right for exacly
two pixels. Meaning the first two pixels in the upper left are two
places to the right, making the last two pixels of the row appear in the
second row. I hope you understand.

Am I making something wrong when writing data to the pixbuf? Or is there
any other explanation. Please help.

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

Using g_signal_connect in class

2008-07-15 Thread Marco Rocco

Hello, this is my first post on this mailing list, now i do my request:
can i use g_signal_connect  in a method of my class, using as c_handler 
a private function of class? ...and if i can, how i can do ?

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


Re: Using g_signal_connect in class

2008-07-15 Thread Gabriele Greco
On Tue, Jul 15, 2008 at 12:09 PM, Marco Rocco [EMAIL PROTECTED] wrote:

 Hello, this is my first post on this mailing list, now i do my request:
 can i use g_signal_connect  in a method of my class, using as c_handler a
 private function of class? ...and if i can, how i can do ?


If you use C++ and plain GTK, supposing you are initializing your callback
in the  you should do something like this:

class MyClass
{
  GtkWidget *mywidget_;
  static void handle_click_cbk(GtkWidget *mywidget_, MyClass *data) {
data-handle_click(); }

  void handle_click(); // your real callback
public:
  MyClass() {
 mywidget_ = gtk_button_new();
 g_signal_connect(mywidget_, clicked, GCallback(handle_click_cbk),
this);
  }
};

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


about textview (gtk_text_buffer_insert_with_tags cause segmentaion fault)

2008-07-15 Thread 朱碧岑
Hi all ,
When I insert some text to textview in a thread in the following 
code(myThread::run) . it will segmentation fault . 
Could someone help me to fix this issue.
Any comments and suggestion will be welcomed.

bzhu


#include gtk/gtk.h
#include wchar.h
#include string.h
#include pthread.h
GtkWidget* tv;
GtkTextTag* tag;
#include assert.h
class Thread
{
public:
Thread();
void start();
virtual void run();
private:
pthread_t   m_hThread;
};
Thread::Thread()
{
}
static void* _ou_thread_proc(void* param) 
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL);
Thread* tp = (Thread*)param;
tp-run();
pthread_exit(NULL);
return NULL;
}
void Thread::start()
{
int iret = pthread_create( m_hThread, NULL, _ou_thread_proc,this);
assert(iret == 0);
}
void Thread::run() 
{
}
class myThread:public Thread
{
public :
void run()
{
g_print(Thread is running\n);
//Code belowe will cause the segmentation fault
gdk_threads_enter();
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = Thread is running\n;

gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);//segmentaion
 fault.
gdk_threads_leave();

}
};
void* thread_proc(void* param)
{
gdk_threads_enter();
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = Thread is running\n;
gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);
gdk_threads_leave();
}
myThread g_thread;
void go_click(GtkWidget* goButton,GtkWidget* noWidget)
{
//g_print(You click);
//pthread_t mythread;
//pthread_create(mythread,NULL,thread_proc,NULL);
g_thread.start();
}
int main(int argc,char* argv[])
{
GtkWidget* window;

g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter();
gtk_init(argc,argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
GtkWidget* vbox = gtk_vbox_new(FALSE,2);
gtk_container_add(GTK_CONTAINER(window),vbox);

tv = gtk_text_view_new();
gtk_box_pack_start(GTK_BOX(vbox),tv,TRUE,TRUE,0);
gtk_widget_set_size_request(tv,160,160);
GtkWidget* go = gtk_button_new_with_label(go);
gtk_box_pack_start(GTK_BOX(vbox),go,TRUE,TRUE,0);
g_signal_connect (G_OBJECT (go),clicked,G_CALLBACK (go_click),NULL);
//write a text to the text view
GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
tag = gtk_text_buffer_create_tag (tb, 
PASSTAG,scale,PANGO_SCALE_XX_LARGE,NULL);
GtkTextIter end;
gtk_text_buffer_get_end_iter(GTK_TEXT_BUFFER(tb),end);
gchar text[] = just a test\n;
gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),end,text,-1,tag);

gtk_widget_show_all(window);
gtk_main();
gdk_threads_leave();
return 1;
}


Makefile:


CC = g++
RM = rm
GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0 `
GTK_LIBS = `pkg-config --libs --cflags gtk+-2.0 gthread-2.0 `
CFLAGS = -g -Wall
LIBS = -lpthread
.SUFFIXES:.cpp
SRCS = textview.cpp 
#thread.cpp 
OBJS = $(SRCS:.cpp=.o)
.cpp.o:
 $(CC) $(CFLAGS) $(GTK_CFLAGS) -c $
tv: $(OBJS)
 $(CC) $(GTK_LIBS) $(LIBS) -o $@ $(OBJS)
clean:
 $(RM) *.o
 $(RM) tv


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


Using g_signal_connect in class

2008-07-15 Thread Marco Rocco

Hello, this is my first post on this mailing list, now i do my request:
can i use g_signal_connect  in a method of my class, using as c_handler 
a private function of class? ...and if i can, how i can do ?

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


Getting a Column Number

2008-07-15 Thread dhk
The following will get me the Column from a treeview, but from 
focus_column I don't know if I'm in the first, second, third . . . or 
last column.


GtkTreePath *tp=NULL;
GtkTreeViewColumn *focus_column=NULL;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(treeview), tp, focus_column);

How do you get the column number from a GtkTreeViewColumn pointer?  Is 
there a way to get the previous and/or next Column or column number?


Thanks,

Dave

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


Re: gtk-app-devel-list Digest, Vol 51, Issue 21

2008-07-15 Thread Steve Splonskowski

More good list karma - this is a great resource.

Does it work?


splons


On Jul 15, 2008, at 3:11 AM, [EMAIL PROTECTED] wrote:


Send gtk-app-devel-list mailing list submissions to
gtk-app-devel-list@gnome.org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of gtk-app-devel-list digest...


Today's Topics:

  1. Re: font size gtk_*_new_with_label [SOLVED] (Luis Ariel Lecca)
  2. How do I get the enter key to press OK when in a GTk::Entry
 widget? (Garth's KidStuff)
  3. Re: How do I get the enter key to press OK when in a
 GTk::Entry widget? (Eduardo M KALINOWSKI)
  4. about textview (gtk_text_buffer_insert_with_tags cause
 segmentaionfault) ( ??? )
  5. Re: about textview (gtk_text_buffer_insert_with_tags cause
 segmentaion fault) (plt)
  6. Problem writing pixels to GdkPixbuf data buffer (Luka Napotnik)
  7. Using g_signal_connect in class (Marco Rocco)


--

Message: 1
Date: Mon, 14 Jul 2008 10:50:20 -0700 (PDT)
From: Luis Ariel Lecca [EMAIL PROTECTED]
Subject: Re: font size gtk_*_new_with_label [SOLVED]
To: gtk-app-devel-list@gnome.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

thanks to the 3 guys who gave me a hand with this...

Here one function in C to resolve this:

gint8	GuiUtils_Font_Change( GtkWidget *pCtrl, c8 *C8pname,  
PangoFontDescription *pfont )

{   
gint8   S8retval = -1;

 if( C8pname  pfont )
{   
if( GTK_IS_WINDOW(pCtrl)/*||GTK_IS_LIST_ITEM(pCtrl)*/ )
{   
pCtrl = lookup_widget( pCtrl/*GTK_WIDGET(pCtrl)*/, 
C8pname );
}   

if( pCtrl )
{   
if( !GTK_IS_LABEL(pCtrl) )
{   
if( GTK_IS_BUTTON(pCtrl)||GTK_IS_ITEM(pCtrl) )
{   
pCtrl = gtk_bin_get_child( 
GTK_BIN(pCtrl) );
}   
else if( GTK_IS_STATUSBAR(pCtrl) )
{   
pCtrl = 
GTK_WIDGET((GTK_STATUSBAR(pCtrl)-label) );
}   
else if( GTK_IS_FRAME(pCtrl) )
{   
pCtrl = 
GTK_WIDGET((GTK_FRAME(pCtrl)-label_widget) );
}   
else if( GTK_IS_ENTRY(pCtrl) )
{   
pCtrl = lookup_widget( 
((GTK_ENTRY(pCtrl)-widget)), C8pname );
}   
}   

if( pCtrl )
{   
gtk_widget_modify_font( pCtrl, pfont );
S8retval = 0;
}   
}   
}   

return S8retval;
}   



--- El dom 13-jul-08, Tomas Carnecky [EMAIL PROTECTED] escribi?:


De: Tomas Carnecky [EMAIL PROTECTED]
Asunto: Re: font size gtk_*_new_with_label
Para: [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org
Fecha: domingo, 13 de julio de 2008, 9:39 am
Luis Ariel Lecca wrote:

Hi All ! I will appreciate very much any help :)

I'm using

gtk_widget_modify_font()  and

style = gtk_rc_style_new();
pango_font_description_free( style-font_desc );
style-font_desc = pfont;
gtk_widget_modify_style( widget, style );

to change the font size of my labels, but I can't

do it on created

buttons with gtk_*_new_with_label() and neither in my

statusbar.


I couldn't find any example on the net. I

understand that I dont have the reference to the labels...
, but when gtk refresh the screen needs the reference to
the labels...


So how to get the reference pointer or directly how to

change the font size on these objects ?


I have custom labels with my widgets...
Now, I'd rather change as less as possible the

Glade code (Glade use _with_label in generation code).

I think that would be better using with_label than a

custom button (I'm not completetly sure about it on
gtk).


Could any body give me some help about this problem? I

need to solve it


Why don't you use pango markup?

button = gtk_button_new();
label = gtk_label_new();
gtk_label_set_markup(GTK_LABEL(label), span
size='large'A/span);
gtk_container_add(GTK_CONTAINER (button), label);

tom


Using g_signal_connect in class

2008-07-15 Thread Marco Rocco
Thanks, I have done, but i have the problem of how i get treepath, and 
how i can pass to callback functions,

look my class:

class GtkCtree{
  private:
  GtkWidget *treeview;
  GtkListStore *liststore;
  Tdata string_to_data(const char *data_string);
  static void cell_edited_cbk(GtkWidget treeview, GtkCtree *data){
  data-cell_edited();
  }
  void cell_edited(GtkCellRendererText *cell, const gchar 
*path_string, const gchar *new_text,

  gpointer data){
  /* get column */
  guint column_number= 
GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(cell), my_column_num));

/* get row */
  GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
/* update model */
  GtkTreeIter iter;
  gtk_tree_model_get_iter(GTK_TREE_MODEL(liststore), iter, path);
  gchar *old_text;
  gtk_tree_model_get(GTK_TREE_MODEL(liststore), iter, 
column_number,

old_text, -1);
  gtk_list_store_set(GTK_LIST_STORE(liststore), iter, 
column_number, new_text, -1);

  g_free(old_text);
  }
public:
  GtkCtree();
  GtkWidget *get_widget();
  void set(GladeXML *xml_file_glade, const char *nome_treeview, int 
ncolonne, ...);
  void inserisci_colonna(const char *titolo_colonna, const char 
*tipo_dato_gtk, int ncolonna);

  void inserisci_riga(int ncolonne, ...);
  int get_ID_selezionato();
  Tdata get_data_selezionata();
  void clear();
  void inserisci_colonna_editable(const char *titolo_colonna, const 
char *tipo_dato_gtk,

  int ncolonna);
};


void GtkCtree::inserisci_colonna_editable(const char *titolo_colonna, 
const char *tipo_dato_gtk,

  int ncolonna){
  GtkCellRenderer *renderer;
  GtkTreeViewColumn  *colonna;
  gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), 
GTK_TREE_MODEL(liststore));

  renderer= gtk_cell_renderer_text_new();
  colonna= gtk_tree_view_column_new_with_attributes(titolo_colonna, 
renderer,
  
tipo_dato_gtk, ncolonna,

  NULL);
  gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), colonna);
g_object_set_data(G_OBJECT(renderer), my_column_num, 
GUINT_TO_POINTER(1));
  g_object_set(renderer, editable, TRUE, NULL); //setta il testo 
editabile
g_signal_connect(renderer, edited, (GCallback) cell_edited_cbk, 
liststore);

}


void GtkClist::set(GladeXML *xml_file_glade, const char *nome_treeview, 
int ncolonne, ...){

  treeview= glade_xml_get_widget(xml_file_glade, nome_treeview);
  va_list arg_pt;
  va_start(arg_pt, ncolonne);
  GType *array;
  array= new GType[ncolonne];
  for (int i=0; incolonne; i++)
  array[i]= va_arg(arg_pt, GType);
  liststore = gtk_list_store_newv(ncolonne, array);
  va_end(arg_pt);
}

void GtkClist::inserisci_riga(int ncolonne, ...){
  va_list args;
  va_start(args, ncolonne);
  GtkTreeIter newrow;
  gtk_list_store_append(GTK_LIST_STORE(liststore), newrow);
  gtk_list_store_set_valist(GTK_LIST_STORE(liststore), newrow, args);
  va_end(args);
}

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


Re: Problem writing pixels to GdkPixbuf data buffer

2008-07-15 Thread Jim George
2008/7/15 Luka Napotnik [EMAIL PROTECTED]:
 Hello.

 I encounter a strange problem when I'm writing image data to the
 GdkPixbuf data buffer.

 I create an empty pixbuf and get the data buffer. Then I use:

 pixel = pixbuf_data + i * n_channels

 , where pixel is a pointer to the pixel, pixbuf_data is the pixbuf data
 buffer, i is a counter in a for loop with a condition:

 for (i = 0; i  width*height; i++)

 This for loop should iterate throught all pixel in the image. The
 n_channels variable is 4 because I use a RGBA pixbuf.
 When I have this pixel pointer, I use pixel[0], pixel[1], pixel[2] and
 pixel[3] to modify the RGBA values.

 I then handle the expose-event, create a cairo surface using the
 GdkPixbuf and display the surface onto the drawing area. The problem is
 when I display the pixbuf the image is shifted to the right for exacly
 two pixels. Meaning the first two pixels in the upper left are two
 places to the right, making the last two pixels of the row appear in the
 second row. I hope you understand.

 Am I making something wrong when writing data to the pixbuf? Or is there
 any other explanation. Please help.

 Greets,
 Luka


Luka,
You should change this to something like this:
pixel = gdk_pixbuf_get_pixels(pixbuf);
rowstride = gdk_pixbuf_get_rowstride(pixbuf);
for(y=0;yheight;y++) {
  for(x=0;xwidth;x++) {
/* do something with 'pixel' */
pixel += n_channels;
  }
  pixel += (rowstride - n_channels*width);
}

Rowstride can be something other than n_channels*width, which could
cause problems similar to what you're describing.
-Jim
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


newbie Question

2008-07-15 Thread Craig Petty
How would i make a gtk+ for a wireless networking?


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


Re: newbie Question

2008-07-15 Thread Tomas Carnecky

Craig Petty wrote:

How would i make a gtk+ for a wireless networking?


First read gtk tutorials. Then compile, run and modify some gtk samples, 
just so you get into how gtk works. Then you can read the sourcecode of 
other gtk applications to understand how a 'big' application is 
structured. And then, if you have a specific question about for example 
how to create a custom widget, or how to list available wireless 
networks, you can get back to this mailinglist and ask it.


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


Re: gtk_widget_set_sensitive and mouse pointer

2008-07-15 Thread Mitko Haralanov
On Mon, 14 Jul 2008 09:34:13 -0400
Eric Masson @ Savant Protection [EMAIL PROTECTED] wrote:

 To fix this, do the following after making the widget sensitive:
 gint x,y;
 GdkWindow *windowUnderMouse=gdk_window_at_pointer(x,y);
 if(windowUnderMouse){
 GdkEventCrossing e;
 e.type=GDK_ENTER_NOTIFY;
 e.window=windowUnderMouse;
 e.send_event=1;
 e.subwindow=0;
 e.time=GDK_CURRENT_TIME;
 e.x=0;
 e.y=0;
 e.x_root=0;
 e.y_root=0;
 e.mode=GDK_CROSSING_NORMAL;
 e.detail=GDK_NOTIFY_UNKNOWN;
 e.focus=true;
 e.state=0;
 gdk_event_put((GdkEvent *)e);
 }

I tried porting this piece of code to PyGTK and while it works for the
most part one thing that jumps out is that, if the widget in question
has a tooltip, the tooltip does not show up at the pointer location but
rather in the top left corner of the screen.
One difference between this code and the PyGTK version is that PyGTK
insists on e.subwindow to the a GdkWindow instance (gtk.gdk.Window). I
am setting e.subwindow to windowUnderMouse (which seems to make sense
since it is the window that was entered or left) but I am not sure
whether that creates the problem with the tooltips.

Any input?

-- 
Mitko Haralanov
==
You know, Callahan's is a peaceable bar, but if you ask that dog what
his favorite formatter is, and he says roff! roff!, well, I'll just
have to...
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Getting a Column Number

2008-07-15 Thread dhk

Anyone?

The following will get me the Column from a treeview, but from 
focus_column I don't know if I'm in the first, second, third . . . or 
last column.


GtkTreePath *tp=NULL;
GtkTreeViewColumn *focus_column=NULL;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(treeview), tp, focus_column);

How do you get the column number from a GtkTreeViewColumn pointer?  Is 
there a way to get the previous and/or next Column or column number?


Thanks,

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


Re: newbie Question

2008-07-15 Thread Craig Petty
how to list available wireless networks and create a custom widget?



--- On Tue, 7/15/08, Tomas Carnecky [EMAIL PROTECTED] wrote:

 From: Tomas Carnecky [EMAIL PROTECTED]
 Subject: Re: newbie Question
 To: [EMAIL PROTECTED]
 Cc: gtk-app-devel-list@gnome.org
 Date: Tuesday, July 15, 2008, 11:40 AM
 Craig Petty wrote:
  How would i make a gtk+ for a wireless networking?
 
 First read gtk tutorials. Then compile, run and modify some
 gtk samples, 
 just so you get into how gtk works. Then you can read the
 sourcecode of 
 other gtk applications to understand how a 'big'
 application is 
 structured. And then, if you have a specific question about
 for example 
 how to create a custom widget, or how to list available
 wireless 
 networks, you can get back to this mailinglist and ask it.
 
 tom


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