Re: How to send user_data into callback function by glade only?

2009-04-14 Thread donglongchao
在2009-04-11,Tadej Borovšak tadeb...@gmail.com 写道:
2009/4/11 donglongchao donglongc...@163.com:
 Hi all,
 I have a question using glade(3.4.5).
 In the signal tab,there is a item user_data.I want to know how to fill 
 and what to fill to send the data I filled into the callback function, 
 without using gtk_signal_connect(..) or something like that,just and 
 only use glade itself and glade_xml_signal_autoconnect().
 I do not know if i should define the data before I fill and send it,and 
 where should I define my data? global scope? statics
 one?I even do not know if i could send data defined by myself.
 Remember just and only use  glade itself and glade_xml_signal_autoconnect().
 It is a simple question ,but confused me several days,will any one 
 help?Thanks.

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


Hello.

You can only pass other objects created in glade via this field. You
cannot pass structs, integers ...


-- 
Tadej Borovšak
tadeb...@gmail.com
tadej.borov...@gmail.com
Hi,

I fill the item with myspinbutton and I connect clicked signal of a button 
to callback function like follows.

void on_checkbutton1_clicked(GtkButton *checkbutton1,gpointer user_data)
{
gchar spin[10];
GtkWidget * window;
if (gtk_toggle_button_get_active(checkbutton1)) 
{window=gtk_message_dialog_new(NULL,GTK_DIALOG_MODAL |\
   
GTK_DIALOG_DESTROY_WITH_PARENT,
   GTK_MESSAGE_INFO,

GTK_BUTTONS_OK_CANCEL,g_ascii_dtostr(spin,10,gtk_spin_button_get_value((GtkSpinButton*)(user_data;
g_signal_connect(window,response,
   gtk_widget_destroy,NULL);
gtk_widget_show (window);}
}
And I want to show the value of myspinbutton by pass its point to callback 
function.But every time I click the button there is no response.Just left 
(gtk_toggle_button_get_active): assertion `GTK_IS_TOGGLE_BUTTON
(toggle_button)' failed.

But if i do not pass the spinbutton, and the function only have one 
para(GtkButton *checkbutton1), it works,no error,no warning.

I do not know why.Any one could help?Thanks.

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

Problem with GtkCellRendererCombo

2009-04-14 Thread Rudolfo Pinewood

Hello again,
I have a problem with GtkCellRendererCombo, for which I did not find a 
solution yet.


I try to use editing-started signal on that renderer to update combobox 
model based on current selection in my treeview. But it segfaults out 
when I try to receive the currently selected value from my treeview 
treemodel.


Segfault stacktrace: http://pastebin.com/m4694e64b

TreeView creation: http://pastebin.com/m4da78675

editing-started-callback: http://pastebin.com/mcdb04be
Note: here is the segfault in line 20 (gtk_tree_model_get), some things 
that drawed my attention: editable is 0x0, path is 0:0 (even if my 
selected line is the second one in my treeview)


Model update/creation: http://pastebin.com/m3f5f52b7

My questions:
- Does anybody find an error why it segfaults?
- Is my solution the prefered one to do such tasks? (I also tried to use 
cell_data function to update the combobox, this way was working to some 
extend, (combo got values, getting selection works) but seems to cause 
massive recalculating so it even does no longer support drag'n'drop in a 
second application part.)


Greetings,
Christoph Hartwig

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


Unplugging GtkPlug from GtkSocket

2009-04-14 Thread Ravi Kasibhatla
Hi all,

I am creating a plugin for a browser based on webkit, using the xembed
protocol i.e. using GtkSocket  GtkPlug. I have been successfully able to
create the plugin  show the content required on the plugin window, but I am
facing problem when I try to delete the plugin. At the time of deletion of
plugin, I want to delete the plug created, so as to free the resources
allocated to the plug while creating plugin. Can anyone tell me how to do
it, including how to do the cleanup on the GtkSocket side created in the
browser?

It would be of great help if anyone could let me know on this ASAP, as I am
in urgent need of this information. I tried to find any resource telling
more on XEmbed protocol usage and the cleanup process when using XEmbed
protocol on the web, but couldn't get anything concrete help on this topic.

Thanks  Regards,
Ravi Phaneendra K
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Porting UIs to GtkBuilder

2009-04-14 Thread Zeeshan Ali (Khattak)
Hi,
   Reading through planet gnome and related mailing-lists recently, I
got the impression that this would be a good time to port my UIs from
libglade usage to GtkBuilder. So following the guidelines on this
page:

http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkBuilder.html

   I tried to do so:
http://gitorious.org/projects/gupnp-tools/repos/mainline/commits/e8bb5436aa22009b5b312da5a459324382e889c5

   With this change, everything builds but I get this error from two
of my UIs on startup:

Gtk:ERROR:gtkbuilder.c:541:_gtk_builder_add: assertion failed:
(GTK_IS_BUILDABLE (parent))
Aborted

  The error from the third UI says a bit more so i think i can debug
that on my own, but what is this supposed to mean?

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: 2. Re: General tips about GTK+ programming

2009-04-14 Thread Grzegorz Kuczyński

I'm not a specialist, but ...
I thing a good idea  is the separate GUI code and functionaly code. Then 
I can easy move my functionaly code in another GUI toolkit and CLI. I 
mean  two independent part for have interface to share data one another. 
GTK+ us only gets data for user and represent.


I try do this :)

--
Uzywane i nowe auta z Niemiec!
Sprawdz  http://link.interia.pl/f2113

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


Re: Porting UIs to GtkBuilder

2009-04-14 Thread Tristan Van Berkom
On Tue, Apr 14, 2009 at 4:50 PM, Zeeshan Ali (Khattak) zee...@gmail.com wrote:
 Hi,
   Reading through planet gnome and related mailing-lists recently, I
 got the impression that this would be a good time to port my UIs from
 libglade usage to GtkBuilder. So following the guidelines on this
 page:

 http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkBuilder.html

   I tried to do so:
 http://gitorious.org/projects/gupnp-tools/repos/mainline/commits/e8bb5436aa22009b5b312da5a459324382e889c5

Errr, try converting with Glade 3.6 instead of the conversion script ?

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


A few quick questions about gtkprint

2009-04-14 Thread Vamsi Krishna Davuluri
hello,

I am a gsoc applicant for sugar, and doing a project which adds print
support to our applications.
The idea is to convert our mime types to a more printable format and print
them.
So, now the question is how does convertion to ps/pdf take place with
gtkprint
I would like to know if it is true that gtkprint uses a common filter for
converting to pdf/ps for any application?
or will it again interact with different respective filters?

Thank you

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


Re: Question about gtkrc

2009-04-14 Thread Thomas Wood
On Tue, 2009-04-07 at 17:03 +0200, bardzo_szorstki wrote:
 Hello. I am writin to tou to ask a few questions.
 The first problem is how to disable icons on GtkButton? There is
 description how to change spacing bewtween label nad the icon, but I
 can't find a solution to disable icons at all.

Take a look at the GtkSettings object. It has a property to disable
icons in buttons, which you can use by adding a line to your gtkrc:

gtk-button-images = 0

 
 The second question is how to change spacing between scroll and the text 
 frame, like here:
 http://gnome-look.org/CONTENT/content-pre1/48820-1.png
 

This url has lots of information on different style properties, and
describes how they are applied:
http://live.gnome.org/GnomeArt/Tutorials/GtkThemes

Regards,

Thomas

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


Unplugging GtkPlug from GtkSocket

2009-04-14 Thread Ravi Kasibhatla
Hi all,

I am creating a plugin for a browser based on webkit, using the xembed
protocol i.e. using GtkSocket  GtkPlug. I have been successfully able to
create the plugin  show the content required on the plugin window, but I am
facing problem when I try to delete the plugin. At the time of deletion of
plugin, I want to delete the plug created, so as to free the resources
allocated to the plug while creating plugin. Can anyone tell me how to do
it, including how to do the cleanup on the GtkSocket side created in the
browser?

It would be of great help if anyone could let me know on this ASAP, as I am
in urgent need of this information. I tried to find any resource telling
more on XEmbed protocol usage and the cleanup process when using XEmbed
protocol on the web, but couldn't get anything concrete help on this topic.

Thanks  Regards,
Ravi Phaneendra K
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Unplugging GtkPlug from GtkSocket

2009-04-14 Thread Christian Dywan
Am Wed, 15 Apr 2009 00:19:38 +0530
schrieb Ravi Kasibhatla kasibhatla.r...@gmail.com:

 Hi all,
 
 I am creating a plugin for a browser based on webkit, using the xembed
 protocol i.e. using GtkSocket  GtkPlug. I have been successfully
 able to create the plugin  show the content required on the plugin
 window, but I am facing problem when I try to delete the plugin. At
 the time of deletion of plugin, I want to delete the plug created, so
 as to free the resources allocated to the plug while creating plugin.
 Can anyone tell me how to do it, including how to do the cleanup on
 the GtkSocket side created in the browser?
 
 It would be of great help if anyone could let me know on this ASAP,
 as I am in urgent need of this information. I tried to find any
 resource telling more on XEmbed protocol usage and the cleanup
 process when using XEmbed protocol on the web, but couldn't get
 anything concrete help on this topic.
 
 Thanks  Regards,
 Ravi Phaneendra K

Hey Ravi,

so what problem are you facing exactly? From what I understand you have
an nsplugin that creates a socket and loads a plug from somewhere.
Please correct me if I misunderstand the scenario. And I assume you are
in charge of the socket and plug code. So both are GtkWidgets which
have the usual finalize, dispose and destroy, plus the plug-removed
signal on GtkSocket.

I haven't used this in a while since it is somewhat messy, so it would
be good if you could provide more context about what you are doing and
what is not working.

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