[gtk-list] Re: Notebook question (another)



Didimo Emilio Grimaldo Tunon wrote:

> The first thing I want to ask is whether it is possible to have the
> notebook page number automatically assigned, or if this information
> is available somewhere in the widget. The reason for this is one needs
> the gtk_notebook_set_page() with a page/tab number but it seems one
> has to keep track of it (among appends, prepends etc etc etc). I have
> been trying to use (now by memory, don't have my code here) gtk_notebook_
> get_page() or something like that during the creation of a tab and then
> putting that in a special structure, but the number I get back doesn't
> seem to be reliable. Any ideas, hints or suggestions are welcome.

The way I've been doing this in my project is to create the page, append it,
then call mysubroutine that finds the last page, and using that as 'current'.
It works good :) I spoze you
could use the label to check? if ==NULL ?

> The other thing is a strange behaviour I am seeing in my notebook, I
> create about 5 tabs but focus always goes to the 3rd. I look in my code
> and don't see any set_page() that could cause this.

this again can be solved with a subroutine to find the # of the last page

> Ah! yet another notebook question... In my button callback I use
> gtk_notebook_set_page() to automatically 'focus' to the output tab but
> this does not seem to work from within this callback, only in the main
> or the menu callback. A bit strange.

set the focus like this:gtk_widget_grab_focus(notebook->item);

if you have problems figuring out a subroutine, feel free to look at my source

http://shells.clipboard.com/~br0ke/bide

the subroutine I use is b_last() in misc.c, and it's used in spawn_edit() in
new.c


	-Erik <br0ke@shells.clipboard.com>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]