Re: DGSEAL_ENABLE: replace direct addressing in statusbar

2010-07-04 Thread Nader Morshed
Oh, woops, just glanced at the documentation, well, I guess you could leave it 
with the -label for now, and once 3.0 comes, switch over as both the method 
and GSEAL stuff will be in place at that point. You could always write the code 
for the transition now and add a preprocessor check like so:

#if GLIB_CHECK_VERSION(3, 0, 0)
// new code which gets the box's child
#else
// old code you pasted in the mail
#endif

On Sun, 04 Jul 2010 06:57:48 +0100
Carlos Pereira jose.carlos.pere...@ist.utl.pt wrote:

 On 07/04/10 06:17, Nader Morshed wrote:
  statusbar = gtk_statusbar_new ();
  label = gtk_statusbar_get_message_area (GTK_STATUSBAR (statusbar));
  gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
 
 Thanks Nader, I believe you are in the right path (although the 
 documentation actually says this returns a box, not a label):
 
 http://library.gnome.org/devel/gtk/stable/GtkStatusbar.html#gtk-statusbar-get-message-area
 
 Anyway this has been added in Gtk 2.20, I am still running 2.18.3, lots 
 of users also, it might be better to wait...
 
 Thanks!
 Carlos
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
Nader Morshed morshed.na...@gmail.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Window move at menubar in Gnome

2010-07-04 Thread Andreas Volz
Hello,

since I installed Ubuntu 10.04 I noticed that I could move windows
while dragging the menubar in Gnome. I like this feature. But I don't
use Gnome, but Enlightenment 17. I would like to implement support for
this feature in E17, but I don't know which calls are behind this on X
level. I tried to find some documentation about it, but failed. Before
I start to dig into Gtk+ code I hope someone on this list could answer
this question.

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


GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread John Emmas
Anyone who's familiar with the MS Windows API will know that it contains a 
function called UpdateWindow().  A call to UpdateWindow() forces the specified 
window's client area to be repainted immediately (i.e. bypassing any other 
messages or operations that may be pending for the window).  Is there any 
equivalent functionality within GTK+?

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


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread Alexander Nagel

Hi,

i'm using gtk_events_pending to realize this.

HTH
Alexander

Am 04.07.2010 15:38, schrieb John Emmas:

Anyone who's familiar with the MS Windows API will know that it contains a 
function called UpdateWindow().  A call to UpdateWindow() forces the specified 
window's client area to be repainted immediately (i.e. bypassing any other 
messages or operations that may be pending for the window).  Is there any 
equivalent functionality within GTK+?

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


--

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage:
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread Nader Morshed
I believe you're looking for: gtk_widget_queue_draw()

On Sun, 4 Jul 2010 14:38:57 +0100
John Emmas john...@tiscali.co.uk wrote:

 Anyone who's familiar with the MS Windows API will know that it contains a 
 function called UpdateWindow().  A call to UpdateWindow() forces the 
 specified window's client area to be repainted immediately (i.e. bypassing 
 any other messages or operations that may be pending for the window).  Is 
 there any equivalent functionality within GTK+?
 
 John
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


-- 
Nader Morshed morshed.na...@gmail.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/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread John Emmas

On 4 Jul 2010, at 16:11, Nader Morshed wrote:

 I believe you're looking for: gtk_widget_queue_draw()
 

On 4 Jul 2010, at 15:02, Alexander Nagel wrote:

 
 i'm using gtk_events_pending to realize this.
 

Thanks guys - but if I'm reading the documentation correctly I don't think 
either of those calls is quite right.  gtk_widget_queue_draw() seems to be 
roughly equivalent to InvalidateRect() in Windows (i.e. it schedules a window 
to be repainted at some point in the near future - though not necessarily 
immediately).  gtk_events_pending() seems to be more useful for ensuring that 
GUI operations don't get bottlenecked while there's a lengthy operation being 
processed.  Neither of those is quite what I need.  I'm looking for is a 
function that will force a window to be repainted at once, before any other 
pending events get processed.  Thanks.

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


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread jcupitt
On 4 July 2010 16:50, John Emmas john...@tiscali.co.uk wrote:
 operation being processed.  Neither of those is quite what I need.  I'm 
 looking for is a function that will force a window to be repainted at once, 
 before any other pending events get processed.

There's gdk_window_process_updates():

http://library.gnome.org/devel/gdk/stable/gdk-Windows.html#gdk-window-process-updates

But I'm not certain is does much any more. Generally, you just paint
in the expose handler and nowhere else, and calls like this are
unnecessary.

What are you trying to achieve? Perhaps there's some other way to get
the effect you need.

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


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread Claudio Saavedra
On Sun, 2010-07-04 at 16:50 +0100, John Emmas wrote:
 I'm looking for is a function that will force a window to be repainted
 at once, before any other pending events get processed.

There is hardly any reason why you would want to do that, unless you
want to write very bad code.

But if you insist, probably gdk_window_process_updates() is what you
need.

Claudio


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


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread Lance Dillon




- Original Message 
 From: jcup...@gmail.com jcup...@gmail.com
 To: John Emmas john...@tiscali.co.uk
 Cc: gtk-app-devel-list gtk-app-devel-list@gnome.org
 Sent: Sun, July 4, 2010 12:51:52 PM
 Subject: Re: GTK/GDK equivalent to UpdateWindow() ?
 
 On 4 July 2010 16:50, John Emmas 
 href=mailto:john...@tiscali.co.uk;john...@tiscali.co.uk wrote:
 
 operation being processed.  Neither of those is quite what I need.  I'm 
 looking 
 for is a function that will force a window to be repainted at once, before 
 any 
 other pending events get processed.

There's 
 gdk_window_process_updates():

http://library.gnome.org/devel/gdk/stable/gdk-Windows.html#gdk-window-process-updates

But 
 I'm not certain is does much any more. Generally, you just paint
in the 
 expose handler and nowhere else, and calls like this 
 are
unnecessary.

What are you trying to achieve? Perhaps there's some 
 other way to get
the effect you 
 need.

John

-


Maybe this is what you want?


http://library.gnome.org/devel/gdk/stable/GdkDisplay.html#gdk-display-flush
http://library.gnome.org/devel/gdk/stable/gdk-Windows.html#gdk-window-flush

This one is possible, but the others may be more useful or relevant:

http://library.gnome.org/devel/gdk/stable/gdk-General.html#gdk-flush



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


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread John Emmas

On 4 Jul 2010, at 17:51, jcup...@gmail.com wrote:

 
 What are you trying to achieve? Perhaps there's some other way to get
 the effect you need.
 

Actually John, it's the same problem that I had in my other thread (where I was 
trying to draw a now line onto a scrolling canvas).  Here's what I wrote at 
the time:-

 
 I'd like the viewport to have a vertical now line (similar to the play head 
 on a tape recorder).  At the moment, this is drawn onto the canvas.  
 Therefore every 1/30th second, it needs to be erased, then the viewport needs 
 to be adjusted, then the now line needs to be redrawn.  This produces a 
 very flickery now line.
 

Upon closer inspection, the now line isn't really flickery; it's actually 
wobbling slightly, from side to side.  I suspect that the erase stage is 
being queued and not really taking place at the right time (i.e. the now line 
hasn't yet been erased by the time the scrolling movement takes place).  So 
before trying your suggestion of utilising a pixmap (which might be quite 
difficult to achieve, due to the window needing scroll bars and stuff) I 
thought I might try to 'force' a redraw, immediately after the erase stage 
(just so that I can be certain it's actually being done, and not simply being 
queued).  gdk_window_process_updates() does look as though it should work 
(assuming it does still do something).  In fact, it looks as if it was designed 
precisely with this kind of scenario in mind.  I'll give it a try and see what 
happens.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How to hide the sub-menu title of a GtkComboBoxEntry ?

2010-07-04 Thread Lyre
 I created a GtkComboBoxEntry with GtkTreeStore. The problem is, the
sub-menu have a title whose value is the same as it's parent. How could I
drop this title?

I notice that a GtkComboBox example in gtk-demo without this title, it's
done by by  gtk_cell_layout_set_cell_data_func () which have a parameter of
GtkCellRenderer * 。But is there a way to get the renderer from
GtkComboBoxEntry?

Here is an example:

#if 0
gcc -Wall -O2 -o main main.c `pkg-config --libs --cflags gtk+-2.0`
exit
#endif

#include gtk/gtk.h

#define ARRAY_SIZE(A)(sizeof(A) / sizeof (A[0]))

gchar *abc[] =
{
title 1,
a---,
b---,
c---,
NULL,
};

gchar *def[] =
{
title 2,
d---,
e---,
f---,
NULL,
};

gchar **list[] =
{
abc,
def,
};

GtkTreeModel *model_new (void)
{
GtkTreeIter iter, iter2;
gint i;

GtkTreeStore *store = gtk_tree_store_new (1, G_TYPE_STRING);
for (i = 0; i  ARRAY_SIZE(list); i++)
{
gtk_tree_store_append (store, iter, NULL);
gtk_tree_store_set (store, iter, 0, list[i][0],-1);

gchar **str = (list[i][1]);
for (; *str != NULL; str++)
{
gtk_tree_store_append (store, iter2, iter);
gtk_tree_store_set (store, iter2, 0, *str, -1);
}
}

return GTK_TREE_MODEL (store);
}

static void is_capital_sensitive (GtkCellLayout   *cell_layout,
GtkCellRenderer *cell,
GtkTreeModel*tree_model,
GtkTreeIter *iter,
gpointer data)
{
gboolean sensitive;

sensitive = !gtk_tree_model_iter_has_child (tree_model, iter);

g_object_set (cell, sensitive, sensitive, NULL);
}

int main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *box;
GtkWidget *combo;
GtkCellRenderer *renderer;

gtk_init (argc, argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), destroy, G_CALLBACK
(gtk_main_quit), (gpointer)window);

box = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), box);

GtkTreeModel *model = model_new();

combo = gtk_combo_box_entry_new ();
gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model);
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (combo), 0);
gtk_box_pack_start_defaults (GTK_BOX (box), combo);


GtkWidget *c = gtk_combo_box_new();
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (c), renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (c), renderer, text,
0, NULL);
gtk_combo_box_set_model (GTK_COMBO_BOX (c), model);
gtk_box_pack_start_defaults (GTK_BOX (box), c);
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (c),
renderer,
is_capital_sensitive,
NULL, NULL);

gtk_widget_show_all (window);

gtk_main ();

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