Re: GtkNotebook question
| From: | Alan Knowles | Date: | Mon, 17 Jun 2002 00:33:10 +0000 |
| Subject: | Re: GtkNotebook question | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2135@lists.php.net to get a copy of this message | ||
try changing this
$g_main_notebook->append_page($cd, new GtkLabel($channelName));
to this
$label = &new GtkLabel($channelName);
$label->show();
$g_main_notebook->append_page($cd, $label);
-- you need to 'show the label'
regards
alan
Bryan Clark wrote:
I'm trying to write an irc client in php-gtk, with a GtkNotebook for the different windows (think something similar to xchat). append_page() doesn't seem to be completely working, though -- when I create the main window, I add an empty tab for a server. That works without a problem. However, if I try to add a tab for a channel after joining it, the new tab doesn't appear. Here are the two functions (actually methods of the main window class) that are supposed to add the tabs:function create_server_tab($sd) { global $g_main_notebook;if (($serverName = $sd->get_server()) != null) { $this->m_servs[strtolower($serverName)] = $sd; } else { $serverName = '(none)'; }$g_main_notebook->append_page($sd, new GtkLabel($serverName)); }function create_channel_tab($cd) { global $g_main_notebook; $channelName = $cd->get_channel(); $serverName = $cd->get_server(); echo "Making new tab for $channelName on $serverName\n";if (($channelName != '') && ($serverName != '')) { $this->m_chans[strtolower($serverName)][strtolower($channelName)] = $cd; } else { $channelName = '(none)'; }$g_main_notebook->append_page($cd, new GtkLabel($channelName)); }The append_page() calls work happily when they come before the window is shown, but not after that. Is there anything special that needs to be done after append_page() that I'm missing? Thanks for looking.