Re: Setting ComboBox Uneditable

2005-02-23 Thread Giovanni Manenti
On Tue, 22 Feb 2005 07:44:20 -0500, Andy Grebe <[EMAIL PROTECTED]> wrote:
Hi,
I'm trying to make the combo box uneditable.  It looks like it would
have a GtkEntry as part of the struct, but I can't seem to find it in
the header to set that uneditable.
Thanks,
Andy Grebe
Try this
gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO(Combo)->entry),FALSE);
Giovanni
___
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 with no keyboard/mouse

2005-02-23 Thread Zeeshan Ali
Hello,
   IMHO another option is to implement an in-kernel 'input' device. I
dont know ANYTHING about the other options people suggested you here
but this way would enable you to:

1. Generate both keyboard/mouse events from the same device
2. Use your device from any (even non-gtk and non-X) application.

So far, I have just made a test device and it worked prety well
and in a few days i'll be making a device driver for a pin-pad device
(as soon as i get it) using this techique. If you need any
help/guidance, please let me know (in private as this is not a list
for such discussions). Bye.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


weird behavior in GTK+-2.4.14

2005-02-23 Thread Dave Andruczyk

I have a weird nagging problem that's driving me crazy..

I have a program with upwards of several hundred Gui controls (most are
spinbuttons or textentries.)

I'm getting spurious events being emitted by the spinbuttons on focus(into and
out of the application) changes.  (but not ALL of them even do it even though
they all have the same signal handlers) on focus changes.

i.e. if I click in a spinbutton (i.e. click in the text part, don't change
anything and don't click on the arrows) it emits the "value changed" signal
handler (which I feel is incorrect as the value has NOT changed).  After
changing the value the "value_changed" signal fires TWICE. debugging prints out
that it fires off with the previous value and then again with thenew value
(Annoying, but livable)

Now if I move the mouse in and out of the window (system configured with Focus
FOLLOWS mouse) each time the focus  LEAVES the application it emits the
"value_changed" signal TWICE.  focusing back in fires no value_changed signal.

the gui controls are loaded by a glade file, and according to glade there are 4
signal handlers for each of the spinbuttons..

"value_changed" goes to spin_button_handler <-- this is the one firing on focus
changes

"changed" goes to entry_changed_handler (used to do things when the user
manually edits the text part of the spinbutton)

"key_press_event" and "key_release_event" both go to key_event (which handles
keyboard shortcuts)

WHY is it firing off "value_changed" signals on a focus change?, and how the
hell do I stop it from doing that?

Why is it firing off the value changed signal TWICE when changing the
spinbutton's value? (once with  old once with new)



=
Dave J. Andruczyk



__ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Setting ComboBox Uneditable

2005-02-23 Thread Antonio Gomes
Is it not enought

gtk_function_that_set_uneditable (GTK_COMBO(combo)->entry, FALSE);

;)

??

Best Regards ...


On Tue, 22 Feb 2005 07:44:20 -0500, Andy Grebe <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm trying to make the combo box uneditable.  It looks like it would
> have a GtkEntry as part of the struct, but I can't seem to find it in
> the header to set that uneditable.
> 
> Thanks,
> Andy Grebe
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 


-- 
Antonio Gomes
Embedded Linux Developer
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnlogia
Manaus/Br
___
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 with no keyboard/mouse

2005-02-23 Thread Mihael Vrbanec
Hi,

> Let's assume for the moment that the remote has just six buttons.  Menu,
> up, down, left, right, select.  Any thoughts on the best way to inject
> events?  So far I have found that a "move-focus" signal on the window
> containing a bunch of button and slider widgets is not the answer (for
> direction navigation).  Neither does gtk_window_propagate_key_event()
> seem to be what I want.  I, of course, want to use the GTK
> infrastructure instead of rolling my own.  Any suggestions?
> 
> thanks for any light you can shed on this!

Well, I did not try it myself but perhaps g_signal_emit() and friends
are the functions you are looking for.

Hope this helps.

bxe Miq
-- 
 **   Mihael Vrbanec---   Uni Karlsruhe   **
***  eMail:   [EMAIL PROTECTED] ***
 **   Homepage:  miqster.homeip.net/~miq/ **


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
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 with no keyboard/mouse

2005-02-23 Thread Brian J. Tarricone
Mike Rosenlof wrote:
This system will have a display, and a remote control device.  I'm
planning on a separate thread from the GUI which receives the remote
codes, interprets them, and injects appropriate events into the GUI.
Let's assume for the moment that the remote has just six buttons.  Menu,
up, down, left, right, select.  Any thoughts on the best way to inject
events?  So far I have found that a "move-focus" signal on the window
containing a bunch of button and slider widgets is not the answer (for
direction navigation).  Neither does gtk_window_propagate_key_event()
seem to be what I want.  I, of course, want to use the GTK
infrastructure instead of rolling my own.  Any suggestions?
As another poster mentioned, I too have had problems using 
gdk_event_put() to synthesize events.  What has worked for me is using 
XSendEvent(), passing it the window of the target widget.  You need to 
call it twice, for ButtonPress and ButtonRelease.  If you're just doing 
button presses, I believe you can use gtk_button_clicked()[1] instead.  
There are probably other similar functions you can call for other 
widgets that are "clickable" in the sense of activating them; the API 
docs will help here.  Note that GtkButton is a subclass for a bunch of 
different button types (like GtkCheckButton), so gtk_button_click() will 
work for all of them.

For widget navigation, I'd suggest using a state machine.  So you keep 
track of which widget has focus, and create a state table for the 
transitions, so you basically have a list of starting widgets, and for 
each of the four arrow directions, you have a widget to move to.  Then 
just use gdk_widget_grab_focus() to make the change.

   -brian
[1] 
http://developer.gnome.org/doc/API/2.0/gtk/GtkButton.html#gtk-button-clicked
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: notebook widget like in Firefox

2005-02-23 Thread John (J5) Palmieri
On Wed, 2005-02-23 at 23:04 +0100, Khiraly wrote:
> Dear List,
> 
>   I'm developing an application in which I'd like the windows to be able
> to be grouped on tabs, exactly like Firefox does.
>   I've looked into the notebook widget, and it would meet my
> expectations - but I cannot place an X (close) button on the right side
> of the tabs (one X overall, no Xs for the separate tabs, just like
> Firefox).
>   This would be a chat window alike those in the popular Xchat2 program,
> but I'd like the pages grouped like in the Firefox browser.
> 
>   Could someone recommend me a documentation for this? I've checked the
> GTK API specifications concerning to the notebook widget, but I see no
> information on this. But I really hope there is a solution for this,
> either one not in the documentation or one I had skipped.
> 
>   All suggestions are welcome.

You would need to hack the GtkNotebook code to do this.  Should be easy
given that they already add forward (>) and backward (<) stepper buttons
in the same location you want the close button.  

> Best regards,
> Khiraly
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
-- 
John (J5) Palmieri
Associate Software Engineer
Desktop Group
Red Hat, Inc.
Blog: http://martianrock.com

___
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 with no keyboard/mouse

2005-02-23 Thread Marc Santhoff
Am Mi, den 23.02.2005 schrieb Mike Rosenlof um 21:23:
> Hello,
> 
> I'm starting design work on an application which will run on a system
> with no keyboard or mouse.  I'm not an experienced GTK programmer, I'm
> very experienced in embedded systems development FWIW.
> 
> 
> This system will have a display, and a remote control device.  I'm
> planning on a separate thread from the GUI which receives the remote
> codes, interprets them, and injects appropriate events into the GUI.
> 
> Let's assume for the moment that the remote has just six buttons.  Menu,
> up, down, left, right, select.  Any thoughts on the best way to inject
> events?  So far I have found that a "move-focus" signal on the window
> containing a bunch of button and slider widgets is not the answer (for
> direction navigation).  Neither does gtk_window_propagate_key_event()
> seem to be what I want.  I, of course, want to use the GTK
> infrastructure instead of rolling my own.  Any suggestions?

According to some postings on this list, some people tried to synthesize
GDK events from their code and failed.

In my own GTK+1.2 application without mouse and with some keyboard-type
messages sending controller board I use the XTest-extension of X11 and
I'm satisfied with that.

For doing so it is enough to call "XTestFakeKeyEvent" two times (once
for each up and down event) with the parameters set at your will. This
is connected by using "gdk_input_add" right after initializing gtk.

This way the app will not notice any difference between a real keyboard
and this events. The only thing getting somewhat complicated is using
accelerator keys, but it is possible.

HTH,
Marc


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


notebook widget like in Firefox

2005-02-23 Thread Khiraly
Dear List,

  I'm developing an application in which I'd like the windows to be able
to be grouped on tabs, exactly like Firefox does.
  I've looked into the notebook widget, and it would meet my
expectations - but I cannot place an X (close) button on the right side
of the tabs (one X overall, no Xs for the separate tabs, just like
Firefox).
  This would be a chat window alike those in the popular Xchat2 program,
but I'd like the pages grouped like in the Firefox browser.

  Could someone recommend me a documentation for this? I've checked the
GTK API specifications concerning to the notebook widget, but I see no
information on this. But I really hope there is a solution for this,
either one not in the documentation or one I had skipped.

  All suggestions are welcome.

Best regards,
Khiraly

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


Re: A bug in Gtk+?

2005-02-23 Thread Owen Taylor
On Wed, 2005-02-23 at 14:31 +0500, Zeeshan Ali wrote:
> Hello,
> 
> On Wed, 23 Feb 2005 10:12:07 +0200, Olexiy Avramchenko
> <[EMAIL PROTECTED]> wrote:
> > When you create main loop with NULL as context parameter, main loop gets
> > shared default context. Before you create your main loop, default
> > context was populated with functions from gtk/gdk.
> > 
> > The blocker is gdk_event_prepare (it just locks the global mutex), GLib
> > code call it because the event source is not removed by gtk_main_quit.
> 
> Thanks. Got it :)
>  
> > You may:
> > 1. Create separate context (this looks like the best solution).
> > 2. Use gdk_threads_leave() before your g_main_loop_run() call.
>I'll go for #1 i think.

Note that if you want to integrate your own callbacks with GTK+
GUI callbacks in the same thread (like repaint events), you need to do
1... you can only have one running contex per thread. And in fact, what
gtk_main() looks like is basically:

 gtk_threads_leave();
 g_main_loop_run();
 gtk_threads_enter();

So it's very much the "normal" way things work.

Regards,
Owen


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


Re: Auto Scrolling Text

2005-02-23 Thread Harring Figueiredo


--- Andrew Gatt <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Does anyone know how to create a text widget, that if
> you set text wider than the widget it will
> automatically scroll the text held in the buffer? Or
> point me in the right direction of an example?
> 
> Thanks
> Andrew


 gFTP has this feature on the message text window. 

Hope this helps

Harring.




__ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GTK app with no keyboard/mouse

2005-02-23 Thread Mike Rosenlof

Hello,

I'm starting design work on an application which will run on a system
with no keyboard or mouse.  I'm not an experienced GTK programmer, I'm
very experienced in embedded systems development FWIW.


This system will have a display, and a remote control device.  I'm
planning on a separate thread from the GUI which receives the remote
codes, interprets them, and injects appropriate events into the GUI.

Let's assume for the moment that the remote has just six buttons.  Menu,
up, down, left, right, select.  Any thoughts on the best way to inject
events?  So far I have found that a "move-focus" signal on the window
containing a bunch of button and slider widgets is not the answer (for
direction navigation).  Neither does gtk_window_propagate_key_event()
seem to be what I want.  I, of course, want to use the GTK
infrastructure instead of rolling my own.  Any suggestions?

thanks for any light you can shed on this!
-mike

---

Mike Rosenlof
Brillian Corporation
5490 Conestoga Court
Boulder, Colorado  80301

phone 720-406-8400 x30
fax   303-545-2633
 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: On treeviews and custom treemodels again

2005-02-23 Thread Stefan Kost
Hi Denis,
you might want to read over your mail and be a bit clearer. The probelm 
is not really understandable to me.

Stefan
Hi !
After some investigation here are my conclusions :
When one's implements its own GtkTreeModel, he has 2 solutions to tell 
the cell_renderers what to "render" :

1. put a property on the object which is given in the GValue given by

gtk_tree_model_get_value 
 
(GtkTreeModel 
 
*tree_model,
 GtkTreeIter 
 
*iter,
 gint 
 
column,
 GValue 
 
*value);

2. use a void (*GtkTreeCellDataFunc 
) 
(GtkTreeViewColumn 
 
*tree_column,
 GtkCellRenderer 
 
*cell,
 GtkTreeModel 
 
*tree_model,
 GtkTreeIter 
 
*iter,
 gpointer 
 
data);

Now the problem is that when you use the second solution, you cannot 
control the layout of the cell_renderers for on column (you only have 
one function to set it :

 gtk_tree_view_column_set_cell_data_func () )
Now my problem is that I want to 2 cell renderers and for the FIRST 
one, I want to put the boolean expand of the function

voidgtk_tree_view_column_pack_start 
 
(GtkTreeViewColumn 
 
*tree_column,
GtkCellRenderer 
 
*cell,
gboolean 
 
expand);

to FALSE and I cannot do it with the solution 2. because the way to 
provide this boolean does not exists in the API :-(

So I should use solution 2 BUT :
I do not want to put properties specific to gui stuff on my data model 
so I should introduce an Object returned by gtk_tree_model_get_value 
 
which contains the real object
Is there a solution that I do not see to solve my problem ?

Denis
___
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


Re: On GtkTreeModelFilters

2005-02-23 Thread Stefan Kost
Hi Denis,
for me it works fine in gtk-2.4.X.
Stefan
Hi !
Again a question on treemodels : I saw that the GtkTreeModelFilters 
where introduced in gtk 2.4 but is documented only in 2.6

Does this mean that the feature should be considered as experimental 
in 2.4 ? or can I rely on it ?

Thank you by advance for your help,
Denis
___
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


On GtkTreeModelFilters

2005-02-23 Thread Denis
Hi !
Again a question on treemodels : I saw that the GtkTreeModelFilters 
where introduced in gtk 2.4 but is documented only in 2.6

Does this mean that the feature should be considered as experimental in 
2.4 ? or can I rely on it ?

Thank you by advance for your help,
Denis
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


On treeviews and custom treemodels again

2005-02-23 Thread Denis
Hi !
After some investigation here are my conclusions :
When one's implements its own GtkTreeModel, he has 2 solutions to tell 
the cell_renderers what to "render" :

1. put a property on the object which is given in the GValue given by
 

gtk_tree_model_get_value 

 (GtkTreeModel  
*tree_model,
 GtkTreeIter 
 
*iter,
 gint 
 
column,
 GValue 

 *value);
2. use a void (*GtkTreeCellDataFunc 
)
 (GtkTreeViewColumn 
 *tree_column,
 GtkCellRenderer 
 *cell,
 GtkTreeModel 
 *tree_model,
 GtkTreeIter 
 
*iter,
 gpointer 

 data);
Now the problem is that when you use the second solution, you cannot control the layout of the cell_renderers for on column (you only have one function to set it : 

 gtk_tree_view_column_set_cell_data_func () )
Now my problem is that I want to 2 cell renderers and for the FIRST one, 
I want to put the boolean expand of the function

voidgtk_tree_view_column_pack_start 

 (GtkTreeViewColumn 
 *tree_column,
GtkCellRenderer 
 *cell,
gboolean 

 expand);
to FALSE and I cannot do it with the solution 2. because the way to provide 
this boolean does not exists in the API :-(
So I should use solution 2 BUT :
I do not want to put properties specific to gui stuff on my data model so I should introduce an Object returned by gtk_tree_model_get_value  which contains the real object 

Is there a solution that I do not see to solve my problem ?
Denis
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: A bug in Gtk+? (+ OT suff)

2005-02-23 Thread Hubert Sokolowski
> Zeeshan Ali ha scritto lo scorso 23/02/2005 10:31:
> [...]
>>Yep, in a software of mine that is for ATM machines. You mean to
>> ask why i am using both the GMainLoop and gtk_main* in the same
>> software, right? At one hand i dont want to bring in gtk+ (glib only)
>> into the card-reader interfacing module and OTOH i need nested main
>> loops inside the gui module, for which IMHO i'll need to do some more
>> labour if done using GMainLoop way. You may call it a "nessecity of my
>> laziness" :)
>
> Please, forgive my OT question, but I'm going to start a gtk+ project
> involving the use of a smart card reader and I'd very happy to know your
> suggestions about linux supported hardware.

look at it http://www.opensc.org/


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


Re: A bug in Gtk+? (+ OT suff)

2005-02-23 Thread Zeeshan Ali
Hello,

> Please, forgive my OT question, but I'm going to start a gtk+ project
> involving the use of a smart card reader and I'd very happy to know your
> suggestions about linux supported hardware.

Welcome to the gang! Sorry to dissappoint you but I too am very
new to all this. So far i've only interfaced only one card-reader
(ICT3K5 by Custom) device and one printer (VKP80 from Custom again).
If you need help on these devices or want to know how i am doing the
gtk+ part, we can continue our conversation about it in private :)
Bye.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: A bug in Gtk+?

2005-02-23 Thread Olexiy Avramchenko
Zeeshan Ali wrote:
You may call it a "nessecity of my laziness" :)
Sure, L:) Laziness is great power and the reason of why there're so many 
programming tools and libs avalaible.

BTW, you can debug deadlocks with gdb. You just need to attach it to 
running process.
1. Compile program with '-g' (have a libs with debug info around).
2. Run program. Wait when it hang.
3. Run 'gdb  ' (and be sure that you dont have a  
file in local dir).
4. Do 'bt', etc in gdb.

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


Re: A bug in Gtk+? (+ OT suff)

2005-02-23 Thread Carlo Agrusti
Zeeshan Ali ha scritto lo scorso 23/02/2005 10:31:
[...]
   Yep, in a software of mine that is for ATM machines. You mean to
ask why i am using both the GMainLoop and gtk_main* in the same
software, right? At one hand i dont want to bring in gtk+ (glib only)
into the card-reader interfacing module and OTOH i need nested main
loops inside the gui module, for which IMHO i'll need to do some more
labour if done using GMainLoop way. You may call it a "nessecity of my
laziness" :)
Please, forgive my OT question, but I'm going to start a gtk+ project 
involving the use of a smart card reader and I'd very happy to know your 
suggestions about linux supported hardware.

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


GDK_Left can't work

2005-02-23 Thread Falls Huang
Hello!
I've a problem adding an accelerator to the left arrow key. I've tried
with GDK_Left, GDK_KP_Left and GDK_leftarrow as keysym, but none of
those works.

This is my code :
/***/
GtkAccelGroup *accel_group;
GClosure*closure;   
GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

accel_group = gtk_accel_group_new ();
closure = g_cclosure_new(G_CALLBACK(gtk_main_quit), window, NULL);
gtk_accel_group_connect (accel_group, GDK_Left,
 0,GTK_ACCEL_VISIBLE,closure);
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
/***/

If I put something else (like GDK_q) in the gtk_accel_group_connect
function, it works (when I press "q" the callback is called) but I can't make 
the left arrow to work.
 
btw:  I use GTK 2.6.1 from Debian package.

-- 
Regards 
Falls Huang

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


Re: A bug in Gtk+?

2005-02-23 Thread Zeeshan Ali
Hello,

On Wed, 23 Feb 2005 10:12:07 +0200, Olexiy Avramchenko
<[EMAIL PROTECTED]> wrote:
> When you create main loop with NULL as context parameter, main loop gets
> shared default context. Before you create your main loop, default
> context was populated with functions from gtk/gdk.
> 
> The blocker is gdk_event_prepare (it just locks the global mutex), GLib
> code call it because the event source is not removed by gtk_main_quit.

Thanks. Got it :)
 
> You may:
> 1. Create separate context (this looks like the best solution).
> 2. Use gdk_threads_leave() before your g_main_loop_run() call.

   I'll go for #1 i think.
 
> Are you really need to use smth like that in your code ?

   Yep, in a software of mine that is for ATM machines. You mean to
ask why i am using both the GMainLoop and gtk_main* in the same
software, right? At one hand i dont want to bring in gtk+ (glib only)
into the card-reader interfacing module and OTOH i need nested main
loops inside the gui module, for which IMHO i'll need to do some more
labour if done using GMainLoop way. You may call it a "nessecity of my
laziness" :)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Glade and dialogs

2005-02-23 Thread Iago Rubio
On Wed, 2005-02-23 at 06:55, [ A b h i s h e k ] wrote:
> hey guys,
> 
> i am using Glade 2.0 in which i have created a Gnome window as well as a 
> Gnome dialog box. So now when i click on some menu option i would like to 
> display this dialog box.

Glade builds the menu callbacks for you when using the default menus.

 Say you've got the "Open" menu so there exists an on_open1_clicked()
callback in callbacks.c

It also creates a construction function for your dialog, say your dialog
is called foo_dialog, Glade builds a function called 
create_foo_dialog(), see interface.c

What you have to do, is in the the on_open1_clicked() body, write down
some come to build and show your dialog:

void
on_open1_clicked (GtkMenuItem* item, gpointer user_data)
{
GtkWidget *mydlg;

mydlg = create_foo_dialog();
gtk_widget_show(mydlg);
}

>  I dont know how to implement this without getting 
> into the hassle of global variables and all. 

No need for that.

> And also when i do somehow 
> manage to display the Gnome about dialog box, i cannot understand which 
> event is called when i close this box.

Among others the GtkDialog "close" signal.

>  could someone please help me out. Im 
> pretty new to Gtk programming. Thanks

You should take a look at two things in the code:

1.- What signals are connected by Glade and how: search in interface.c
for g_signal_connect()

2.- What callbacks are build by Glade and how are they called: see
callbacks.c and try to match those callbaks with the names on
g_signal_connect() calls on interface.c

This will give you an overall view on how callbacks are connected to
signals, and how to implement your how callbacks.

Check also in Glade the "signals" tab on the property editor - On the
menu "view > property editor" you can show/hide it.

My recomendation is to stuck in the steb-by-step approach of the gtk
tutorial - to get an overview of GTK - before to start playing with
Glade.
http://www.gtk.org/tutorial/

This will make things easier, than try to understand the somewaht
complex code generated by Glade. As example, you don't need to separate
all functions in a bunch of files, but you can easily do it in one file
for small test applications as yours.
 
Regards.
-- 
Iago Rubio
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Glade and dialogs

2005-02-23 Thread Carlo Agrusti
[ A b h i s h e k ] ha scritto lo scorso 23/02/2005 06:55:
hey guys,
i am using Glade 2.0 in which i have created a Gnome window as well as a 
Gnome dialog box. So now when i click on some menu option i would like 
to display this dialog box. I dont know how to implement this without 
getting into the hassle of global variables and all. And also when i do 
somehow manage to display the Gnome about dialog box, i cannot 
understand which event is called when i close this box. could someone 
please help me out. Im pretty new to Gtk programming. Thanks

If you look at glade generated "interface.c", you win find a function 
create_YourDialogName (); you can simply call that function with 
something like this:

GtkWidget * dlg,
  * parent;
parent = lookup_widget (GTK_WIDGET (button), "YourMainWindowName");
dlg= create_YourDialogName ();
gtk_window_set_position (GTK_WINDOW (dlg),
 GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (parent));
gtk_widget_show (dlg);
Of course, all this provided that you're using glade generated code.
Cheers
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: A bug in Gtk+?

2005-02-23 Thread Olexiy Avramchenko
Zeeshan Ali wrote:
Hello,
   
On Tue, 22 Feb 2005 15:22:50 +0100, Stefan Kost <[EMAIL PROTECTED]> wrote:

Are you sure?

   Yeah I am sure and thats why i suspect that it may be pointing to a
bug in gtk+. Why don't you try it youself? Shouldn't  take > 15 mins.
:)
Hi :)
When you create main loop with NULL as context parameter, main loop gets 
shared default context. Before you create your main loop, default 
context was populated with functions from gtk/gdk.

The blocker is gdk_event_prepare (it just locks the global mutex), GLib 
code call it because the event source is not removed by gtk_main_quit.

You may:
1. Create separate context (this looks like the best solution).
2. Use gdk_threads_leave() before your g_main_loop_run() call.
Are you really need to use smth like that in your code ?
Olexiy
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list