gtk box and flow layout

2007-02-18 Thread daa84
Hello!

Can I create flow layout box in gtk like java FlowLayout Layout Manager?
Or it is need to create derivative class (from GtkTable for example) and 
release it behaviour itself?

Thanks.

Sorry for my bad english:)

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


A few drawing questions

2007-02-18 Thread Mark A. Nicolosi
Hi, I'm working on a game and I was wondering what would be best to use for
drawing? I'm having a hard time figuring out how all the different drawing
APIs fit together. As far as I can tell there is GDK, Cairo, GnomeCanvas
(dead?), and other things like GooCanvas. Everything get's drawn to a gdk
window in a drawing area, right?

I want to draw a map (a bunch of tiles) to the screen. Also I'll need to
draw things on top of this, like nicely rounded, semi-transparent area with
information when a user requests more information on a certain entity in the
map. Eventually, I'd like to do small visual effects, like animating water
(nothing fancy) and moving the player character around without jumping from
tile to tile.

I've played around with gdk a little bit. I ended up drawing the entire map
to a gdk window (256x256 tiles and tiles are 32x32 pixels) and put it inside
a ScrolledWindow. But as you can imagine that ate up a lot of memory. I
guess the right approach would be to only have the drawing area as big as
will fit in the window and then update it when the area is scrolled?

I'm programming in C#, but I decided to post here instead of gtk#, because I
think there's more people here. Thanks for the help.

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


Re: gtk box and flow layout

2007-02-18 Thread James Scott Jr
daa84,

You may want to explore using the GtkLayout container.  From what I know
of the Java FlowLayout, both GtkTable and GtkLayout are close
approximations of the FlowLayout.   

http://developer.gnome.org/doc/API/2.0/gtk/GtkLayout.html



On Sun, 2007-02-18 at 11:14 +0300, daa84 wrote:

 Hello!
 
 Can I create flow layout box in gtk like java FlowLayout Layout Manager?
 Or it is need to create derivative class (from GtkTable for example) and 
 release it behaviour itself?
 
 Thanks.
 
 Sorry for my bad english:)
 

James Scott, Jr. 
Registered Linux User #270764
FC6 on Dual AMD-MP 2400+
Author: {gfhcm, gkrellfah2,gapcmon,giw}.sourceforge.net
http://mysite.verizon.net/skoona/index.html
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gtk box and flow layout

2007-02-18 Thread Paul Pogonyshev
daa84 wrote:
 Can I create flow layout box in gtk like java FlowLayout Layout Manager?
 Or it is need to create derivative class (from GtkTable for example) and 
 release it behaviour itself?

In case you want row-breaking functionality of FlowLayout (e.g. when third
widget is placed below the first two since there is not enough width), you
likely need a custom container, as standard ones don't support this.
Otherwise you probably just want GtkHBox/GtkVBox.

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


Problems with Threading Concept

2007-02-18 Thread naveen
Hi all,

I have GUI developed based on gtk+-2.2.0,

1) I have button to start some process (continuous).
2) I need to stop that process, when i click the same button.

to do the above tasks i developed a small application using threading
concepts...

//
#include gtk/gtk.h
#include stdio.h
#include pthread.h

 int flag=1,toggle=0;
int i=0;
pthread_t yes_tid; 

void hello()
{

while (flag)
{
  gdk_threads_enter ();

  printf (%d %d\n,i++,flag);
  if (gtk_events_pending())
  gtk_main_iteration(); // Handle unprocessed GTK events

  gdk_threads_leave ();
}

}

void hello_print( GtkWidget *widget,
gpointer   data )
{  
   if(toggle==0)
{
 toggle=1;
 flag=1;
 pthread_create (yes_tid, NULL,(void *)hello, NULL);
}
else
{
 flag=0;
 toggle=0;
}

}
int main(int   argc,
  char *argv[] )
{

GtkWidget *window;
GtkWidget *button;
g_thread_init (NULL);
gdk_threads_init ();

  gdk_threads_enter ();

gtk_init (argc, argv);

/* create a new window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

g_signal_connect (G_OBJECT (window), destroy,
  G_CALLBACK (gtk_main_quit), NULL);

gtk_container_set_border_width (GTK_CONTAINER (window), 100);

button = gtk_button_new_with_label(click it);

g_signal_connect (G_OBJECT (button), clicked,
  G_CALLBACK (hello_print), NULL);

gtk_container_add (GTK_CONTAINER (window), button);

gtk_widget_show (button);
gtk_widget_show (window);

gtk_main ();

   gdk_threads_leave ();

return 0;
}

//
But the problem here for me is, the stop is not happening immediatly
after the click..

Is there any mistake the way i am doning it ... or do i need to follow
any other procedure for it.. please help me out...

Regards,
Naveen.

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