Re: EuGTK: notebook control stuff

new topic     » goto parent     » topic index » view thread      » older message » newer message
Raul said...

Hi,

please, can someone tell me how do I add to a tab in a notebook the X icon to allow closing the tab?

thanks!

I'm not sure what you want to do here. Normally, you don't 'close' a tab, you just open a different page by clicking on some tab other than the current one. There's always one page visible. You can have a button or a link on a notebook page which will change to another page when clicked. I suppose you could use a ToolButton with an X image in it instead of the "Click me" caption if you wanted something smaller than a regular button.

add(pg3,create(GtkButton,"_Click me","go_to_pg",1)) 
 
global function go_to_pg(atom ctl, integer pg) 
return set(notebook,"current page",pg-1) 
end function 

Maybe you're thinking of something like a multi-file editor, where you can close one of the files using its tab. You can remove a page if you don't need it any more:

set(notebook,"remove page",n) -- where n is the page number 

To do this with the name of the file PLUS an icon, you'll probably need to make your own custom button to attach to the tab. I'll try to work up a demo of that, maybe tomorrow.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu